diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-03-29 21:46:12 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2021-03-30 13:06:19 +0200 |
commit | 1cedbaf13778de02e38b5dc80a7af246b7ec83e5 (patch) | |
tree | 152ab4ec39c677eb1a349c290952acff641c52f8 /lib/misc | |
parent | 1a17a5ab80b1699ac086ad34852116e7728cc378 (diff) | |
download | lvm2-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 'lib/misc')
-rw-r--r-- | lib/misc/lib.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/misc/lib.h b/lib/misc/lib.h index c14f437a0..a4d109fb4 100644 --- a/lib/misc/lib.h +++ b/lib/misc/lib.h @@ -37,7 +37,7 @@ * specified version string. * * Since versioning is only available when compiling with GCC the entire - * compatibility version should be enclosed in '#if defined(__GNUC__)', + * compatibility version should be enclosed in '#if defined(GNU_SYMVER)', * for example: * * int dm_foo(int bar) @@ -62,7 +62,7 @@ * versions of library symbols prior to the introduction of symbol * versioning: it must never be used for new symbols. */ -#if defined(__GNUC__) +#if defined(GNU_SYMVER) #define DM_EXPORT_SYMBOL(func, ver) \ __asm__(".symver " #func "_v" #ver ", " #func "@DM_" #ver ) #define DM_EXPORT_SYMBOL_BASE(func) \ |