This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Disable symbol versioning if .symver doesn't work
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Fri, 28 Apr 2017 13:15:04 +0200
- Subject: [PATCH] Disable symbol versioning if .symver doesn't work
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cPHwi0pbhlA3JNjIVIO9pjGseLYWvq0BXxkTuButsvU=; b=nDsfSFBbJlTWpDTmPyA0ZrDkFlcaiHENTvgTdy9ZMaYM82Jv8c0gkttlyAVY2wCRatUy40DIt1TXMmsmv9KLtidw1oRp0HTh0l/miGfHNXdHipHXIGX4NQPOiOnEgkaYP81ZzN6dkJZkdYvjROuEnX7xxsD5aiFNkzDQW/lGNvQ=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
ChangeLog | 5 +++++
configure.ac | 12 ++++++++++++
2 files changed, 17 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 01f88f3..fb7317c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-28 Ulf Hermann <ulf.hermann@qt.io>
+
+ * configure.ac: Test if symbol versioning is supported and
+ automatically disable it if not.
+
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..efcd3c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -376,6 +376,18 @@ 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
+ enable_symbol_versioning=no
+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