libcilkrts: GNU toolchain, GNU linker scripts (was: Cilk Library)

Thomas Schwinge thomas@codesourcery.com
Mon Sep 29 18:14:00 GMT 2014


Hi!

On Wed, 9 Oct 2013 18:32:11 +0000, "Iyer, Balaji V" <balaji.v.iyer@intel.com> wrote:
> [libcilkrts]

As requested during patch review, symbol versioning infrastructure has
been added to libcilkrts.  However, this is currently
described/implemented as "Linux-only", while in fact it's standard GNU
linker scripts, generally supported with the GNU toolchain, so I'm
proposing to change this as follows.  This increases portability.  Tested
on x86 GNU/Hurd, and x86_64 GNU/Linux is in progress.  OK for trunk once
testing completed?

commit 44e41129a59a4f69d26923a6fa6091902ae584b2
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Sat Sep 20 19:16:44 2014 +0200

    libcilkrts: GNU toolchain, GNU linker scripts.
    
    	libcilkrts/
    	* configure.ac (linux_linker_script): Rename to gnu_linker_script.
    	Also set for *-*-gnu*.
    	(LINUX_LINKER_SCRIPT): Rename to GNU_LINKER_SCRIPT.  Adapt all
    	users.
    	* configure: Regenerate.
    	* Makefile.in: Regenerate.
    	* runtime/linux-symbols.ver: Rename to runtime/gnu-symbols.ver.
---
 libcilkrts/Makefile.am                             |  6 ++--
 libcilkrts/Makefile.in                             |  4 +--
 libcilkrts/configure                               | 32 ++++++++++++----------
 libcilkrts/configure.ac                            | 12 ++++----
 .../runtime/{linux-symbols.ver => gnu-symbols.ver} |  0
 5 files changed, 29 insertions(+), 25 deletions(-)

diff --git libcilkrts/Makefile.am libcilkrts/Makefile.am
index 70538a2..e77dfa6 100644
--- libcilkrts/Makefile.am
+++ libcilkrts/Makefile.am
@@ -95,9 +95,9 @@ libcilkrts_la_LDFLAGS = -version-info 5:0:0
 libcilkrts_la_LDFLAGS += @lt_cv_dlopen_libs@
 libcilkrts_la_LDFLAGS += $(AM_LDFLAGS)
 
-# If we're building on Linux, use the Linux version script
-if LINUX_LINKER_SCRIPT
-    libcilkrts_la_LDFLAGS += -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver
+# If we're building with a GNU toolchain, use the GNU version script.
+if GNU_LINKER_SCRIPT
+  libcilkrts_la_LDFLAGS += -Wl,--version-script,$(srcdir)/runtime/gnu-symbols.ver
 endif
 
 # If we're building on MacOS, use the Mac versioning
diff --git libcilkrts/Makefile.in libcilkrts/Makefile.in
index e1a54b5..dd482b4 100644
--- libcilkrts/Makefile.in
+++ libcilkrts/Makefile.in
@@ -115,8 +115,8 @@ DIST_COMMON = $(srcdir)/include/internal/rev.mk README ChangeLog \
 	$(srcdir)/../mkinstalldirs $(srcdir)/libcilkrts.spec.in \
 	$(srcdir)/../depcomp
 
-# If we're building on Linux, use the Linux version script
-@LINUX_LINKER_SCRIPT_TRUE@am__append_1 = -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver
+# If we're building with a GNU toolchain, use the GNU version script.
+@GNU_LINKER_SCRIPT_TRUE@am__append_1 = -Wl,--version-script,$(srcdir)/runtime/gnu-symbols.ver
 
 # If we're building on MacOS, use the Mac versioning
 @MAC_LINKER_SCRIPT_TRUE@am__append_2 = -Wl,-exported_symbols_list,$(srcdir)/runtime/mac-symbols.txt
diff --git libcilkrts/configure libcilkrts/configure
index be96533..b75533c 100644
--- libcilkrts/configure
+++ libcilkrts/configure
@@ -629,8 +629,8 @@ SED
 LIBTOOL
 MAC_LINKER_SCRIPT_FALSE
 MAC_LINKER_SCRIPT_TRUE
-LINUX_LINKER_SCRIPT_FALSE
-LINUX_LINKER_SCRIPT_TRUE
+GNU_LINKER_SCRIPT_FALSE
+GNU_LINKER_SCRIPT_TRUE
 config_dir
 ALLOCA
 multi_basedir
@@ -5647,19 +5647,21 @@ case "${target}" in
 esac
 
 
-# We have linker scripts for appropriate operating systems
-linux_linker_script=no
+# We have linker scripts for appropriate toolchains.
+
+gnu_linker_script=no
 case "${host}" in
-    *-*-linux*)
-        linux_linker_script=yes
+    *-*-gnu* | *-*-linux*)
+	# Assume a GNU toolchain.
+        gnu_linker_script=yes
         ;;
 esac
- if test "$linux_linker_script" = "yes"; then
-  LINUX_LINKER_SCRIPT_TRUE=
-  LINUX_LINKER_SCRIPT_FALSE='#'
+ if test "$gnu_linker_script" = "yes"; then
+  GNU_LINKER_SCRIPT_TRUE=
+  GNU_LINKER_SCRIPT_FALSE='#'
 else
-  LINUX_LINKER_SCRIPT_TRUE='#'
-  LINUX_LINKER_SCRIPT_FALSE=
+  GNU_LINKER_SCRIPT_TRUE='#'
+  GNU_LINKER_SCRIPT_FALSE=
 fi
 
 
@@ -11755,7 +11757,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11758 "configure"
+#line 11760 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11861,7 +11863,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11864 "configure"
+#line 11866 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15379,8 +15381,8 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
   as_fn_error "conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${LINUX_LINKER_SCRIPT_TRUE}" && test -z "${LINUX_LINKER_SCRIPT_FALSE}"; then
-  as_fn_error "conditional \"LINUX_LINKER_SCRIPT\" was never defined.
+if test -z "${GNU_LINKER_SCRIPT_TRUE}" && test -z "${GNU_LINKER_SCRIPT_FALSE}"; then
+  as_fn_error "conditional \"GNU_LINKER_SCRIPT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${MAC_LINKER_SCRIPT_TRUE}" && test -z "${MAC_LINKER_SCRIPT_FALSE}"; then
diff --git libcilkrts/configure.ac libcilkrts/configure.ac
index afd09b8..9f47993 100644
--- libcilkrts/configure.ac
+++ libcilkrts/configure.ac
@@ -143,14 +143,16 @@ case "${target}" in
 esac
 AC_SUBST(config_dir)
 
-# We have linker scripts for appropriate operating systems
-linux_linker_script=no
+# We have linker scripts for appropriate toolchains.
+
+gnu_linker_script=no
 case "${host}" in
-    *-*-linux*)
-        linux_linker_script=yes
+    *-*-gnu* | *-*-linux*)
+	# Assume a GNU toolchain.
+        gnu_linker_script=yes
         ;;
 esac
-AM_CONDITIONAL(LINUX_LINKER_SCRIPT, test "$linux_linker_script" = "yes")
+AM_CONDITIONAL(GNU_LINKER_SCRIPT, test "$gnu_linker_script" = "yes")
 
 mac_linker_script=no
 case "${host}" in
diff --git libcilkrts/runtime/linux-symbols.ver libcilkrts/runtime/gnu-symbols.ver
similarity index 100%
rename from libcilkrts/runtime/linux-symbols.ver
rename to libcilkrts/runtime/gnu-symbols.ver


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140929/f836dd02/attachment.sig>


More information about the Gcc-patches mailing list