From c99a6eb01536d18e700a3c6935714a0fa0c96340 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 21 Jan 2022 17:10:07 +0100 Subject: Add mold detection for libs. libatomic/ChangeLog: * acinclude.m4: Detect *_ld_is_mold and use it. * configure: Regenerate. libgomp/ChangeLog: * acinclude.m4: Detect *_ld_is_mold and use it. * configure: Regenerate. libitm/ChangeLog: * acinclude.m4: Detect *_ld_is_mold and use it. * configure: Regenerate. libstdc++-v3/ChangeLog: * acinclude.m4: Detect *_ld_is_mold and use it. * configure: Regenerate. --- libitm/acinclude.m4 | 6 ++++++ libitm/configure | 23 +++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'libitm') diff --git a/libitm/acinclude.m4 b/libitm/acinclude.m4 index 8efbee9..9fd12e6 100644 --- a/libitm/acinclude.m4 +++ b/libitm/acinclude.m4 @@ -210,6 +210,7 @@ dnl LD (as a side effect of testing) dnl Sets: dnl with_gnu_ld dnl libitm_ld_is_gold (possibly) +dnl libitm_ld_is_mold (possibly) dnl libitm_gnu_ld_version (possibly) dnl dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will @@ -242,8 +243,11 @@ AC_DEFUN([LIBITM_CHECK_LINKER_FEATURES], [ # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. libitm_ld_is_gold=no + libitm_ld_is_mold=no if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then libitm_ld_is_gold=yes + elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then + libitm_ld_is_mold=yes fi changequote(,) ldver=`$LD --version 2>/dev/null | @@ -399,6 +403,8 @@ if test $enable_symvers != no && test $libitm_shared_libgcc = yes; then enable_symvers=gnu elif test $libitm_ld_is_gold = yes ; then enable_symvers=gnu + elif test $libitm_ld_is_mold = yes ; then + enable_symvers=gnu else # The right tools, the right setup, but too old. Fallbacks? AC_MSG_WARN(=== Linker version $libitm_gnu_ld_version is too old for) diff --git a/libitm/configure b/libitm/configure index b8f1e23..966bf40 100755 --- a/libitm/configure +++ b/libitm/configure @@ -12056,7 +12056,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12069 "configure" +#line 12059 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12162,7 +12162,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12175 "configure" +#line 12165 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14901,16 +14901,6 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - haiku*) version_type=linux need_lib_prefix=no @@ -15032,7 +15022,7 @@ linux*oldld* | linux*aout* | linux*coff*) # project, but have not yet been accepted: they are GCC-local changes # for the time being. (See # https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) -linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -17085,8 +17075,11 @@ fi # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. libitm_ld_is_gold=no + libitm_ld_is_mold=no if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then libitm_ld_is_gold=yes + elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then + libitm_ld_is_mold=yes fi ldver=`$LD --version 2>/dev/null | @@ -17289,6 +17282,8 @@ if test $enable_symvers != no && test $libitm_shared_libgcc = yes; then enable_symvers=gnu elif test $libitm_ld_is_gold = yes ; then enable_symvers=gnu + elif test $libitm_ld_is_mold = yes ; then + enable_symvers=gnu else # The right tools, the right setup, but too old. Fallbacks? { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $libitm_gnu_ld_version is too old for" >&5 @@ -17882,7 +17877,7 @@ case "$host" in case "$enable_cet" in auto) # Check if target supports multi-byte NOPs - # and if assembler supports CET insn. + # and if compiler and assembler support CET insn. cet_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fcf-protection" cat confdefs.h - <<_ACEOF >conftest.$ac_ext -- cgit v1.1