public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3] Detect if symbol versioning is supported
@ 2017-08-18 13:50 Ulf Hermann
  2017-08-19  8:11 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Ulf Hermann @ 2017-08-18 13:50 UTC (permalink / raw)
  To: elfutils-devel

If not, throw an error unless symbol versioning was explicitly
disabled.

(Reposting rebased patch, as v2 apparently slipped)

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 d2695721..b720f2cd 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-08-18  Ulf Hermann  <ulf.hermann@qt.io>
 
 	* configure.ac: Check if the compiler supports
diff --git a/configure.ac b/configure.ac
index 25ab19b3..4ab8816a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -386,6 +386,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.11.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] Detect if symbol versioning is supported
  2017-08-18 13:50 [PATCH v3] Detect if symbol versioning is supported Ulf Hermann
@ 2017-08-19  8:11 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2017-08-19  8:11 UTC (permalink / raw)
  To: Ulf Hermann; +Cc: elfutils-devel

On Fri, Aug 18, 2017 at 03:50:42PM +0200, Ulf Hermann wrote:
> If not, throw an error unless symbol versioning was explicitly
> disabled.

I am not sure supporting systems don't do symbol versioning is a
very good thing to do. But since we do (hohum). It does make sense
to explicitly check for it. Applied.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-19  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 13:50 [PATCH v3] Detect if symbol versioning is supported Ulf Hermann
2017-08-19  8:11 ` Mark Wielaard

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).