summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schubert <bernd.schubert@fastmail.fm>2023-01-03 11:46:11 +0100
committerNikolaus Rath <Nikolaus@rath.org>2023-01-04 15:27:21 +0000
commitd372d3f80b5437e652ea501d8a4a917f7001b9d7 (patch)
tree92e3a6be7159d32957fc728a7222ae965306f75b
parent3736e0c85f4a8b624f6f1a27b736c18adbce9c15 (diff)
downloadfuse-d372d3f80b5437e652ea501d8a4a917f7001b9d7.tar.gz
Fixes when HAVE_LIBC_VERSIONED_SYMBOLS is not defined
fuse_loop_mt and fuse_new had not been defined when HAVE_LIBC_VERSIONED_SYMBOLS had not been set and additionally, fuse_new_31 was missing in the version script and was therefore an unusable symbol. This also adds a test for unset HAVE_LIBC_VERSIONED_SYMBOLS.
-rw-r--r--include/fuse.h12
-rw-r--r--lib/fuse_versionscript1
-rwxr-xr-xtest/travis-build.sh37
3 files changed, 42 insertions, 8 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 9897c85..2888d2b 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -948,8 +948,15 @@ struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *o
size_t op_size, void *private_data);
#define fuse_new(args, op, size, data) fuse_new_30(args, op, size, data)
#else
+#if (defined(HAVE_LIBC_VERSIONED_SYMBOLS))
struct fuse *fuse_new(struct fuse_args *args, const struct fuse_operations *op,
size_t op_size, void *private_data);
+#else /* HAVE_LIBC_VERSIONED_SYMBOLS */
+struct fuse *fuse_new_31(struct fuse_args *args,
+ const struct fuse_operations *op,
+ size_t op_size, void *user_data);
+#define fuse_new(args, op, size, data) fuse_new_31(args, op, size, data)
+#endif /* HAVE_LIBC_VERSIONED_SYMBOLS */
#endif
/**
@@ -1046,9 +1053,14 @@ int fuse_loop_mt_32(struct fuse *f, struct fuse_loop_config *config);
*
* See also: fuse_loop()
*/
+#if (defined(HAVE_LIBC_VERSIONED_SYMBOLS))
int fuse_loop_mt(struct fuse *f, struct fuse_loop_config *config);
+#else
+#define fuse_loop_mt(f, config) fuse_loop_mt_312(f, config)
+#endif /* HAVE_LIBC_VERSIONED_SYMBOLS */
#endif
+
/**
* Get the current context
*
diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript
index 7e50e75..a1e9ed8 100644
--- a/lib/fuse_versionscript
+++ b/lib/fuse_versionscript
@@ -139,6 +139,7 @@ FUSE_3.1 {
fuse_lib_help;
fuse_invalidate_path;
fuse_new_30;
+ fuse_new_31;
fuse_new;
} FUSE_3.0;
diff --git a/test/travis-build.sh b/test/travis-build.sh
index 267b6e7..22b3e6a 100755
--- a/test/travis-build.sh
+++ b/test/travis-build.sh
@@ -50,15 +50,20 @@ for CC in gcc gcc-7 gcc-10 clang; do
done
(cd build-$CC; sudo ninja install)
-# Sanitized build
-CC=clang
-CXX=clang++
-for san in undefined address; do
+sanitized_build()
+{
+ san=$1
+ additonal_option=$2
+
echo "=== Building with clang and ${san} sanitizer ==="
- mkdir build-${san}; cd build-${san}
+ [ -n ${additonal_option} ] || echo "Additional option: ${additonal_option}"
+
+ mkdir build-${san}; pushd build-${san}
+
# b_lundef=false is required to work around clang
# bug, cf. https://groups.google.com/forum/#!topic/mesonbuild/tgEdAXIIdC4
- meson -D b_sanitize=${san} -D b_lundef=false -D werror=true "${SOURCE_DIR}" \
+ meson -D b_sanitize=${san} -D b_lundef=false -D werror=true\
+ ${additonal_option} "${SOURCE_DIR}" \
|| (cat meson-logs/meson-log.txt; false)
ninja
@@ -66,11 +71,27 @@ for san in undefined address; do
sudo ${TEST_CMD}
sudo chown root:root util/fusermount3
sudo chmod 4755 util/fusermount3
- # Cleanup temporary files (since they're now owned by root)
+ # Cleanup temporary files (since they are now owned by root)
sudo rm -rf test/.pytest_cache/ test/__pycache__
${TEST_CMD}
- cd ..
+
+ popd
+ rm -fr build-${san}
+}
+
+# Sanitized build
+CC=clang
+CXX=clang++
+for san in undefined address; do
+ sanitized_build ${san}
+done
+
+# Sanitized build without libc versioned symbols
+CC=clang
+CXX=clang++
+for san in undefined address; do
+ sanitized_build ${san} "-Ddisable-libc-symbol-version=true"
done
# Documentation.