Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect symver attribute support #32

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,15 @@ else
time with Libtool if neither --with-pic nor
--without-pic is used). This define must be
used together with liblzma_linux.map.])
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror" # we need -Werror to make sure the attribute is not ignored
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[__attribute__ ((symver ("test@TEST"))) void foo(void) { }
])],
[AC_DEFINE([HAVE_SYMVER_ATTRIBUTE], [1],
[Define to 1 if GCC supports the symver attribute])],
[])
CFLAGS="$OLD_CFLAGS"
;;
*)
enable_symbol_versions=generic
Expand Down
2 changes: 1 addition & 1 deletion src/liblzma/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
// too (which doesn't support __symver__) so use it to detect if __symver__
// is available. This should be far more reliable than looking at compiler
// version macros as nowadays especially __GNUC__ is defined by many compilers.
# if lzma_has_attribute(__symver__)
# if defined(HAVE_SYMVER_ATTRIBUTE)
# define LZMA_SYMVER_API(extnamever, type, intname) \
extern __attribute__((__symver__(extnamever))) \
LZMA_API(type) intname
Expand Down