+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
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.
HOST_LIBS
enable_default_ssp
thin_archive_support
+ld_soname_option
+ld_version_script_option
libgcc_visibility
gcc_cv_readelf
gcc_cv_objdump
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
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
{ $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; }
$as_echo "#define HAVE_AS_DWARF2_DEBUG_VIEW 1" >>confdefs.h
fi
+
fi
fi
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
+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
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) \
$(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)