diff options
author | David Malcolm <dmalcolm@redhat.com> | 2018-03-09 15:24:44 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2018-03-09 15:24:44 +0000 |
commit | deb3da39d6ec5b94f45679860ae48a7037939f9f (patch) | |
tree | be3e50e2422a1c4eff607d0c25b1b0133ae9dc03 /gcc | |
parent | 20003c3cc31bf4ef40a0e03b4f237698e3e1b0ec (diff) | |
download | gcc-deb3da39d6ec5b94f45679860ae48a7037939f9f.zip gcc-deb3da39d6ec5b94f45679860ae48a7037939f9f.tar.gz gcc-deb3da39d6ec5b94f45679860ae48a7037939f9f.tar.bz2 |
jit: use 'configure' to replace hard-coded linker options (PR jit/64089 and PR jit/84288)
gcc/ChangeLog:
PR jit/64089
PR jit/84288
* Makefile.in (LD_VERSION_SCRIPT_OPTION, LD_SONAME_OPTION): New.
* configure: Regenerate.
* configure.ac ("linker --version-script option"): New.
("linker soname option"): New.
gcc/jit/ChangeLog:
PR jit/64089
PR jit/84288
* Make-lang.in (COMMA): New.
(LIBGCCJIT_VERSION_SCRIPT_OPTION): New.
(LIBGCCJIT_SONAME_OPTION): New.
(jit): Move --version-script and -soname linker options to the
above.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r258388
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/Makefile.in | 4 | ||||
-rwxr-xr-x | gcc/configure | 49 | ||||
-rw-r--r-- | gcc/configure.ac | 38 | ||||
-rw-r--r-- | gcc/jit/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/jit/Make-lang.in | 17 |
6 files changed, 125 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b2f59b..6bc488c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2018-03-09 David Malcolm <dmalcolm@redhat.com> + Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR jit/64089 + PR jit/84288 + * Makefile.in (LD_VERSION_SCRIPT_OPTION, LD_SONAME_OPTION): New. + * configure: Regenerate. + * configure.ac ("linker --version-script option"): New. + ("linker soname option"): New. + 2018-03-09 Richard Biener <rguenther@suse.de> PR tree-optimization/84775 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c91499d..20bee04 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1116,6 +1116,10 @@ endif LANG_MAKEFRAGS = @all_lang_makefrags@ +# Used by gcc/jit/Make-lang.in +LD_VERSION_SCRIPT_OPTION = @ld_version_script_option@ +LD_SONAME_OPTION = @ld_soname_option@ + # Flags to pass to recursive makes. # CC is set by configure. # ??? The choices here will need some experimenting with. diff --git a/gcc/configure b/gcc/configure index b126287..c2d3f75 100755 --- a/gcc/configure +++ b/gcc/configure @@ -680,6 +680,8 @@ zlibdir HOST_LIBS enable_default_ssp thin_archive_support +ld_soname_option +ld_version_script_option libgcc_visibility gcc_cv_readelf gcc_cv_objdump @@ -18446,7 +18448,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18449 "configure" +#line 18451 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18552,7 +18554,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18555 "configure" +#line 18557 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -24453,6 +24455,48 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_static_dynamic" >&5 $as_echo "$gcc_cv_ld_static_dynamic" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --version-script option" >&5 +$as_echo_n "checking linker --version-script option... " >&6; } +gcc_cv_ld_version_script=no +ld_version_script_option='' +if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then + gcc_cv_ld_version_script=yes + ld_version_script_option='--version-script' +elif test x$gcc_cv_ld != x; then + case "$target" in + # Solaris 2 ld always supports -M. It also supports a subset of + # --version-script since Solaris 11.4, but requires + # -z gnu-version-script-compat to activate. + *-*-solaris2*) + gcc_cv_ld_version_script=yes + ld_version_script_option='-M' + ;; + esac +fi +# Don't AC_DEFINE result, only used in jit/Make-lang.in so far. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_version_script" >&5 +$as_echo "$gcc_cv_ld_version_script" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker soname option" >&5 +$as_echo_n "checking linker soname option... " >&6; } +gcc_cv_ld_soname=no +if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then + gcc_cv_ld_soname=yes + ld_soname_option='-soname' +elif test x$gcc_cv_ld != x; then + case "$target" in + *-*-darwin*) + gcc_cv_ld_soname=yes + ld_soname_option='-install_name' + ;; + esac +fi +# Don't AC_DEFINE result, only used in jit/Make-lang.in so far. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_soname" >&5 +$as_echo "$gcc_cv_ld_soname" >&6; } + + if test x"$demangler_in_ld" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --demangle support" >&5 $as_echo_n "checking linker --demangle support... " >&6; } @@ -27870,6 +27914,7 @@ if test $gcc_cv_as_dwarf2_debug_view = yes; then $as_echo "#define HAVE_AS_DWARF2_DEBUG_VIEW 1" >>confdefs.h fi + fi fi diff --git a/gcc/configure.ac b/gcc/configure.ac index 140c804..c3c76ac 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3655,6 +3655,44 @@ if test x"$gcc_cv_ld_static_dynamic" = xyes; then fi AC_MSG_RESULT($gcc_cv_ld_static_dynamic) +AC_MSG_CHECKING(linker --version-script option) +gcc_cv_ld_version_script=no +ld_version_script_option='' +if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then + gcc_cv_ld_version_script=yes + ld_version_script_option='--version-script' +elif test x$gcc_cv_ld != x; then + case "$target" in + # Solaris 2 ld always supports -M. It also supports a subset of + # --version-script since Solaris 11.4, but requires + # -z gnu-version-script-compat to activate. + *-*-solaris2*) + gcc_cv_ld_version_script=yes + ld_version_script_option='-M' + ;; + esac +fi +# Don't AC_DEFINE result, only used in jit/Make-lang.in so far. +AC_MSG_RESULT($gcc_cv_ld_version_script) +AC_SUBST(ld_version_script_option) + +AC_MSG_CHECKING(linker soname option) +gcc_cv_ld_soname=no +if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then + gcc_cv_ld_soname=yes + ld_soname_option='-soname' +elif test x$gcc_cv_ld != x; then + case "$target" in + *-*-darwin*) + gcc_cv_ld_soname=yes + ld_soname_option='-install_name' + ;; + esac +fi +# Don't AC_DEFINE result, only used in jit/Make-lang.in so far. +AC_MSG_RESULT($gcc_cv_ld_soname) +AC_SUBST(ld_soname_option) + if test x"$demangler_in_ld" = xyes; then AC_MSG_CHECKING(linker --demangle support) gcc_cv_ld_demangle=no diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog index 8bb0002..8ae54f9 100644 --- a/gcc/jit/ChangeLog +++ b/gcc/jit/ChangeLog @@ -1,3 +1,14 @@ +2018-03-09 David Malcolm <dmalcolm@redhat.com> + Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR jit/64089 + PR jit/84288 + * Make-lang.in (COMMA): New. + (LIBGCCJIT_VERSION_SCRIPT_OPTION): New. + (LIBGCCJIT_SONAME_OPTION): New. + (jit): Move --version-script and -soname linker options to the + above. + 2018-01-25 David Malcolm <dmalcolm@redhat.com> PR jit/81672 diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in index d4362a9..ba78f8e 100644 --- a/gcc/jit/Make-lang.in +++ b/gcc/jit/Make-lang.in @@ -51,6 +51,19 @@ LIBGCCJIT_FILENAME = \ LIBGCCJIT_LINKER_NAME_SYMLINK = $(LIBGCCJIT_LINKER_NAME) LIBGCCJIT_SONAME_SYMLINK = $(LIBGCCJIT_SONAME) +# Conditionalize the use of the LD_VERSION_SCRIPT_OPTION and +# LD_SONAME_OPTION depending if configure found them, using $(if) +# We have to define a COMMA here, otherwise the commas in the "true" +# result are treated as separators by the $(if). +COMMA := , +LIBGCCJIT_VERSION_SCRIPT_OPTION = \ + $(if $(LD_VERSION_SCRIPT_OPTION),\ + -Wl$(COMMA)$(LD_VERSION_SCRIPT_OPTION)$(COMMA)$(srcdir)/jit/libgccjit.map) + +LIBGCCJIT_SONAME_OPTION = \ + $(if $(LD_SONAME_OPTION), \ + -Wl$(COMMA)$(LD_SONAME_OPTION)$(COMMA)$(LIBGCCJIT_SONAME)) + jit: $(LIBGCCJIT_FILENAME) \ $(LIBGCCJIT_SYMLINK) \ $(LIBGCCJIT_LINKER_NAME_SYMLINK) \ @@ -85,8 +98,8 @@ $(LIBGCCJIT_FILENAME): $(jit_OBJS) \ $(jit_OBJS) libbackend.a libcommon-target.a libcommon.a \ $(CPPLIB) $(LIBDECNUMBER) $(LIBS) $(BACKENDLIBS) \ $(EXTRA_GCC_OBJS) \ - -Wl,--version-script=$(srcdir)/jit/libgccjit.map \ - -Wl,-soname,$(LIBGCCJIT_SONAME) + $(LIBGCCJIT_VERSION_SCRIPT_OPTION) \ + $(LIBGCCJIT_SONAME_OPTION) $(LIBGCCJIT_SONAME_SYMLINK): $(LIBGCCJIT_FILENAME) ln -sf $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SONAME_SYMLINK) |