From 1cedbaf13778de02e38b5dc80a7af246b7ec83e5 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 29 Mar 2021 21:46:12 +0200 Subject: 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 --- libdm/datastruct/bitset.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libdm/datastruct') diff --git a/libdm/datastruct/bitset.c b/libdm/datastruct/bitset.c index 06bd31a9d..8f36ec715 100644 --- a/libdm/datastruct/bitset.c +++ b/libdm/datastruct/bitset.c @@ -242,7 +242,7 @@ bad: return NULL; } -#if defined(__GNUC__) +#if defined(GNU_SYMVER) /* * Maintain backward compatibility with older versions that did not * accept a 'min_num_bits' argument to dm_bitset_parse_list(). @@ -254,6 +254,4 @@ dm_bitset_t dm_bitset_parse_list_v1_02_129(const char *str, struct dm_pool *mem) } DM_EXPORT_SYMBOL(dm_bitset_parse_list, 1_02_129); -#else /* if defined(__GNUC__) */ - #endif -- cgit v1.2.1