From: Ulf Hermann <ulf.hermann@qt.io>
To: <elfutils-devel@sourceware.org>
Subject: [PATCH v2] Detect if symbol versioning is supported (was "Disable symbol versioning if .symver doesn't work")
Date: Wed, 03 May 2017 16:18:00 -0000 [thread overview]
Message-ID: <39668d9a-17ad-72bd-8ddf-2dcda99b6d5c@qt.io> (raw)
If not, throw an error unless symbol versioning was explicitly
disabled.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
ChangeLog | 4 ++++
configure.ac | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 01f88f3..22c46c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-03 Ulf Hermann <ulf.hermann@qt.io>
+
+ * configure.ac: Test if symbol versioning is supported.
+
2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
* configure.ac: Check if the compiler supports
diff --git a/configure.ac b/configure.ac
index 0266a36..48b06de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -376,6 +376,21 @@ AS_IF([test "x$enable_textrelcheck" != "xno"],
AC_ARG_ENABLE([symbol-versioning],
AS_HELP_STRING([--disable-symbol-versioning],
[Disable symbol versioning in shared objects]))
+
+AC_CACHE_CHECK([whether symbol versioning is supported], ac_cv_symbol_versioning, [dnl
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl
+#define NEW_VERSION(name, version) \
+ asm (".symver " #name "," #name "@@@" #version);
+int foo(int x) { return x + 1; }
+NEW_VERSION (foo, ELFUTILS_12.12)
+])], ac_cv_symbol_versioning=yes, ac_cv_symbol_versioning=no)])
+if test "$ac_cv_symbol_versioning" = "no"; then
+ if test "x$enable_symbol_versioning" != "xno"; then
+ AC_MSG_ERROR([Symbol versioning is not supported.
+ Use --disable-symbol-versioning to build without.])
+ fi
+fi
+
AM_CONDITIONAL(SYMBOL_VERSIONING, [test "x$enable_symbol_versioning" != "xno"])
AS_IF([test "x$enable_symbol_versioning" = "xno"],
[AC_MSG_WARN([Disabling symbol versioning breaks ABI compatibility.])
--
2.1.4
reply other threads:[~2017-05-03 15:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39668d9a-17ad-72bd-8ddf-2dcda99b6d5c@qt.io \
--to=ulf.hermann@qt.io \
--cc=elfutils-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).