summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-03-29 21:46:12 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-03-30 13:06:19 +0200
commit1cedbaf13778de02e38b5dc80a7af246b7ec83e5 (patch)
tree152ab4ec39c677eb1a349c290952acff641c52f8 /configure
parent1a17a5ab80b1699ac086ad34852116e7728cc378 (diff)
downloadlvm2-1cedbaf13778de02e38b5dc80a7af246b7ec83e5.tar.gz
configure: support builds without versioning
Not all libc (like musl, uclibc dietlibc) libraries support full symbol version resolution in runtime like glibc. Add support to not generate symbol versions when compiling against them. Additionally libdevmapper.so was broken when compiled against uclibc. Runtime linker loader caused calling dm_task_get_info_base() function recursively, leading to segmentation fault. Introduce --with-symvers=STYLE option, which allows to choose between gnu and disabled symbol versioning. By default gnu symbol versioning is used. __GNUC__ check is replaced now with GNU_SYMVER. Additionally ld version script is included only in case of gnu option, which slightly reduces output size. Providing --without-symvers to configure script when building against uclibc library fixes segmentation fault error described above, due to lack of several versions of the same symbol in libdevmapper.so library. Based on: https://patchwork.kernel.org/project/dm-devel/patch/20180831144817.31207-1-m.niestroj@grinn-global.com/ Suggested-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 32 insertions, 3 deletions
diff --git a/configure b/configure
index ff363b046..9fe0c8ddf 100755
--- a/configure
+++ b/configure
@@ -934,6 +934,7 @@ enable_cmirrord
with_cmirrord_pidfile
enable_debug
with_optimisation
+with_symvers
enable_profiling
enable_valgrind_pool
enable_devmapper
@@ -1749,6 +1750,8 @@ Optional Packages:
--with-cmirrord-pidfile=PATH
cmirrord pidfile [PID_DIR/cmirrord.pid]
--with-optimisation=OPT C optimisation flag [OPT=-O2]
+ --with-symvers=STYLE use symbol versioning of the shared library
+ [default=gnu]
--with-lvmlockd-pidfile=PATH
lvmlockd pidfile [PID_DIR/lvmlockd.pid]
--with-lvmpolld-pidfile=PATH
@@ -3103,13 +3106,11 @@ if test -z "$CFLAGS"; then :
fi
case "$host_os" in
linux*)
- CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
# equivalent to -rdynamic
ELDFLAGS="-Wl,--export-dynamic"
# FIXME Generate list and use --dynamic-list=.dlopen.sym
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
- LDDEPS="$LDDEPS .export.sym"
LIB_SUFFIX=so
DEVMAPPER=yes
BUILD_LVMPOLLD=no
@@ -3124,7 +3125,6 @@ case "$host_os" in
;;
darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
- CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
ELDFLAGS=
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
@@ -10394,6 +10394,35 @@ fi
$as_echo "$COPTIMISE_FLAG" >&6; }
################################################################################
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use symbol versioning" >&5
+$as_echo_n "checking whether to use symbol versioning... " >&6; }
+
+# Check whether --with-symvers was given.
+if test "${with_symvers+set}" = set; then :
+ withval=$with_symvers; case "$withval" in
+ gnu|no) symvers=$withval ;;
+ *) as_fn_error $? "Unknown argument to with-symvers" "$LINENO" 5 ;;
+ esac
+else
+ symvers=gnu
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $symvers" >&5
+$as_echo "$symvers" >&6; }
+
+if test "$GCC" = "yes" && test "$symvers" = "gnu" ; then
+
+$as_echo "#define GNU_SYMVER 1" >>confdefs.h
+
+ case "$host_os" in
+ linux*)
+ CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
+ LDDEPS="$LDDEPS .export.sym"
+ ;;
+ esac
+fi
+
+################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to gather gcov profiling data" >&5
$as_echo_n "checking whether to gather gcov profiling data... " >&6; }
# Check whether --enable-profiling was given.