public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] libstdc++: detect mold linker.
       [not found] <e3418294-e27a-cf67-3f31-f2d4873a8557@suse.cz>
@ 2022-01-21 16:54 ` Jonathan Wakely
  2022-01-24 11:11   ` [PATCH][V2] Add mold detection for libs Martin Liška
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2022-01-21 16:54 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, libstdc++

On Fri, 21 Jan 2022 at 16:11, Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> This adds linker detection for mold in libstdc++-v3.
>
> Ready to be installed?

Yes, OK (but please CC the libstdc++ list, not just me).



> Thanks,
> Martin
>
> libstdc++-v3/ChangeLog:
>
>         * acinclude.m4: Detect features for ld.mold linker.
>         * configure: Regenerate.
> ---
>   libstdc++-v3/acinclude.m4 |  8 +++++-
>   libstdc++-v3/configure    | 52 +++++++++++++++++++++++++++++++--------
>   2 files changed, 49 insertions(+), 11 deletions(-)
>
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index d996477254c..1a7d7a96050 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -172,6 +172,7 @@ dnl  LD (as a side effect of testing)
>   dnl Sets:
>   dnl  with_gnu_ld
>   dnl  glibcxx_ld_is_gold (set to "no" or "yes")
> +dnl  glibcxx_ld_is_mold (set to "no" or "yes")
>   dnl  glibcxx_gnu_ld_version (possibly)
>   dnl
>   dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
> @@ -204,11 +205,14 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       AC_MSG_CHECKING([for ld version])
>       changequote(,)
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -220,7 +224,7 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -3796,6 +3800,8 @@ changequote([,])dnl
>       enable_symvers=no
>     elif test $glibcxx_ld_is_gold = yes ; then
>       : All versions of gold support symbol versioning.
> +  elif test $glibcxx_ld_is_mold = yes ; then
> +    : All versions of mold support symbol versioning.
>     elif test $glibcxx_gnu_ld_version -lt $glibcxx_min_gnu_ld_version ; then
>       # The right tools, the right setup, but too old.  Fallbacks?
>       AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
> diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
> index 4c20c669144..0b551b864ce 100755
> --- a/libstdc++-v3/configure
> +++ b/libstdc++-v3/configure
> @@ -22157,12 +22157,15 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -22175,7 +22178,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -29371,12 +29374,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -29389,7 +29395,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -35303,12 +35309,15 @@ done
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -35321,7 +35330,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -47234,12 +47243,15 @@ done
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -47252,7 +47264,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -47519,12 +47531,15 @@ done
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -47537,7 +47552,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -47995,12 +48010,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -48013,7 +48031,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -54383,12 +54401,15 @@ _ACEOF
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -54401,7 +54422,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -60531,12 +60552,15 @@ $as_echo "#define HAVE_TLS 1" >>confdefs.h
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -60549,7 +60573,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -60741,12 +60765,15 @@ done
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -60759,7 +60786,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -60970,12 +60997,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
>     # Start by getting the version number.  I think the libtool test already
>     # does some of this, but throws away the result.
>     glibcxx_ld_is_gold=no
> +  glibcxx_ld_is_mold=no
>     if test x"$with_gnu_ld" = x"yes"; then
>       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
>   $as_echo_n "checking for ld version... " >&6; }
>
>       if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
>         glibcxx_ld_is_gold=yes
> +    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
> +      glibcxx_ld_is_mold=yes
>       fi
>       ldver=`$LD --version 2>/dev/null |
>            sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
> @@ -60988,7 +61018,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
>
>     # Set --gc-sections.
>     glibcxx_have_gc_sections=no
> -  if test "$glibcxx_ld_is_gold" = "yes"; then
> +  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
>       if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
>         glibcxx_have_gc_sections=yes
>       fi
> @@ -74929,6 +74959,8 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
>       enable_symvers=no
>     elif test $glibcxx_ld_is_gold = yes ; then
>       : All versions of gold support symbol versioning.
> +  elif test $glibcxx_ld_is_mold = yes ; then
> +    : All versions of mold support symbol versioning.
>     elif test $glibcxx_gnu_ld_version -lt $glibcxx_min_gnu_ld_version ; then
>       # The right tools, the right setup, but too old.  Fallbacks?
>       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $glibcxx_gnu_ld_version is too old for" >&5
> --
> 2.34.1
>

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

* [PATCH][V2] Add mold detection for libs.
  2022-01-21 16:54 ` [PATCH] libstdc++: detect mold linker Jonathan Wakely
@ 2022-01-24 11:11   ` Martin Liška
  2022-01-28 18:17     ` Jeff Law
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Liška @ 2022-01-24 11:11 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

On 1/21/22 17:54, Jonathan Wakely wrote:
> Yes, OK (but please CC the libstdc++ list, not just me).

Hello.

Sorry for that. Anyway, I would like to install the extended version of the patch
that touches all libraries.

Ready to be installed?
Thanks,
Martin

[-- Attachment #2: 0001-Add-mold-detection-for-libs.patch --]
[-- Type: text/x-patch, Size: 23747 bytes --]

From 8f7f46f8fd2b777c1632c0bbf346d5988b32d56c Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 21 Jan 2022 17:10:07 +0100
Subject: [PATCH] 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.
---
 libatomic/acinclude.m4    |  6 +++++
 libatomic/configure       |  5 ++++
 libgomp/acinclude.m4      |  6 +++++
 libgomp/configure         |  7 +++++-
 libitm/acinclude.m4       |  6 +++++
 libitm/configure          | 23 +++++++----------
 libstdc++-v3/acinclude.m4 |  8 +++++-
 libstdc++-v3/configure    | 52 +++++++++++++++++++++++++++++++--------
 8 files changed, 87 insertions(+), 26 deletions(-)

diff --git a/libatomic/acinclude.m4 b/libatomic/acinclude.m4
index 3703a435003..f35ab5b60a5 100644
--- a/libatomic/acinclude.m4
+++ b/libatomic/acinclude.m4
@@ -299,6 +299,7 @@ dnl  LD (as a side effect of testing)
 dnl Sets:
 dnl  with_gnu_ld
 dnl  libat_ld_is_gold (possibly)
+dnl  libat_ld_is_mold (possibly)
 dnl  libat_gnu_ld_version (possibly)
 dnl
 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
@@ -331,8 +332,11 @@ AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   libat_ld_is_gold=no
+  libat_ld_is_mold=no
   if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
     libat_ld_is_gold=yes
+  elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+    libat_ld_is_mold=yes
   fi
   changequote(,)
   ldver=`$LD --version 2>/dev/null |
@@ -488,6 +492,8 @@ if test $enable_symvers != no && test $libat_shared_libgcc = yes; then
       enable_symvers=gnu
     elif test $libat_ld_is_gold = yes ; then
       enable_symvers=gnu
+    elif test $libat_ld_is_mold = yes ; then
+      enable_symvers=gnu
     else
       # The right tools, the right setup, but too old.  Fallbacks?
       AC_MSG_WARN(=== Linker version $libat_gnu_ld_version is too old for)
diff --git a/libatomic/configure b/libatomic/configure
index fb920c9a687..34434d21764 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -15197,8 +15197,11 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   libat_ld_is_gold=no
+  libat_ld_is_mold=no
   if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
     libat_ld_is_gold=yes
+  elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+    libat_ld_is_mold=yes
   fi
 
   ldver=`$LD --version 2>/dev/null |
@@ -15401,6 +15404,8 @@ if test $enable_symvers != no && test $libat_shared_libgcc = yes; then
       enable_symvers=gnu
     elif test $libat_ld_is_gold = yes ; then
       enable_symvers=gnu
+    elif test $libat_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 $libat_gnu_ld_version is too old for" >&5
diff --git a/libgomp/acinclude.m4 b/libgomp/acinclude.m4
index dbf54d06db9..b8154eba99c 100644
--- a/libgomp/acinclude.m4
+++ b/libgomp/acinclude.m4
@@ -117,6 +117,7 @@ dnl  LD (as a side effect of testing)
 dnl Sets:
 dnl  with_gnu_ld
 dnl  libgomp_ld_is_gold (possibly)
+dnl  libgomp_ld_is_mold (possibly)
 dnl  libgomp_gnu_ld_version (possibly)
 dnl
 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
@@ -149,8 +150,11 @@ AC_DEFUN([LIBGOMP_CHECK_LINKER_FEATURES], [
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   libgomp_ld_is_gold=no
+  libgomp_ld_is_mold=no
   if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
     libgomp_ld_is_gold=yes
+  elif $LD --version 2>/dev/null | grep 'mold'> /dev/null 2>&1; then
+    libat_ld_is_mold=yes
   fi
   changequote(,)
   ldver=`$LD --version 2>/dev/null |
@@ -306,6 +310,8 @@ if test $enable_symvers != no && test $libgomp_shared_libgcc = yes; then
       enable_symvers=gnu
     elif test $libgomp_ld_is_gold = yes ; then
       enable_symvers=gnu
+    elif test $libgomp_ld_is_mold = yes ; then
+      enable_symvers=gnu
     else
       # The right tools, the right setup, but too old.  Fallbacks?
       AC_MSG_WARN(=== Linker version $libgomp_gnu_ld_version is too old for)
diff --git a/libgomp/configure b/libgomp/configure
index 4bc9b381c5c..37390ce5d66 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -15037,7 +15037,7 @@ _ACEOF
 
 # Plugins for offload execution, configure.ac fragment.  -*- mode: autoconf -*-
 #
-# Copyright (C) 2014-2021 Free Software Foundation, Inc.
+# Copyright (C) 2014-2022 Free Software Foundation, Inc.
 #
 # Contributed by Mentor Embedded.
 #
@@ -16231,8 +16231,11 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   libgomp_ld_is_gold=no
+  libgomp_ld_is_mold=no
   if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
     libgomp_ld_is_gold=yes
+  elif $LD --version 2>/dev/null | grep 'mold'> /dev/null 2>&1; then
+    libat_ld_is_mold=yes
   fi
 
   ldver=`$LD --version 2>/dev/null |
@@ -16435,6 +16438,8 @@ if test $enable_symvers != no && test $libgomp_shared_libgcc = yes; then
       enable_symvers=gnu
     elif test $libgomp_ld_is_gold = yes ; then
       enable_symvers=gnu
+    elif test $libgomp_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 $libgomp_gnu_ld_version is too old for" >&5
diff --git a/libitm/acinclude.m4 b/libitm/acinclude.m4
index 8efbee90a32..9fd12e6ee7d 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 b8f1e2360d0..966bf40537d 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
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index d996477254c..1a7d7a96050 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -172,6 +172,7 @@ dnl  LD (as a side effect of testing)
 dnl Sets:
 dnl  with_gnu_ld
 dnl  glibcxx_ld_is_gold (set to "no" or "yes")
+dnl  glibcxx_ld_is_mold (set to "no" or "yes")
 dnl  glibcxx_gnu_ld_version (possibly)
 dnl
 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
@@ -204,11 +205,14 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     AC_MSG_CHECKING([for ld version])
     changequote(,)
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -220,7 +224,7 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -3796,6 +3800,8 @@ changequote([,])dnl
     enable_symvers=no
   elif test $glibcxx_ld_is_gold = yes ; then
     : All versions of gold support symbol versioning.
+  elif test $glibcxx_ld_is_mold = yes ; then
+    : All versions of mold support symbol versioning.
   elif test $glibcxx_gnu_ld_version -lt $glibcxx_min_gnu_ld_version ; then
     # The right tools, the right setup, but too old.  Fallbacks?
     AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 4c20c669144..0b551b864ce 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -22157,12 +22157,15 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -22175,7 +22178,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -29371,12 +29374,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -29389,7 +29395,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -35303,12 +35309,15 @@ done
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -35321,7 +35330,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -47234,12 +47243,15 @@ done
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -47252,7 +47264,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -47519,12 +47531,15 @@ done
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -47537,7 +47552,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -47995,12 +48010,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -48013,7 +48031,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -54383,12 +54401,15 @@ _ACEOF
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -54401,7 +54422,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -60531,12 +60552,15 @@ $as_echo "#define HAVE_TLS 1" >>confdefs.h
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -60549,7 +60573,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -60741,12 +60765,15 @@ done
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -60759,7 +60786,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -60970,12 +60997,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   glibcxx_ld_is_gold=no
+  glibcxx_ld_is_mold=no
   if test x"$with_gnu_ld" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
 $as_echo_n "checking for ld version... " >&6; }
 
     if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
       glibcxx_ld_is_gold=yes
+    elif $LD --version 2>/dev/null | grep 'mold' >/dev/null 2>&1; then
+      glibcxx_ld_is_mold=yes
     fi
     ldver=`$LD --version 2>/dev/null |
 	   sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
@@ -60988,7 +61018,7 @@ $as_echo "$glibcxx_gnu_ld_version" >&6; }
 
   # Set --gc-sections.
   glibcxx_have_gc_sections=no
-  if test "$glibcxx_ld_is_gold" = "yes"; then
+  if test "$glibcxx_ld_is_gold" = "yes" || test "$glibcxx_ld_is_mold" = "yes" ; then
     if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
       glibcxx_have_gc_sections=yes
     fi
@@ -74929,6 +74959,8 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
     enable_symvers=no
   elif test $glibcxx_ld_is_gold = yes ; then
     : All versions of gold support symbol versioning.
+  elif test $glibcxx_ld_is_mold = yes ; then
+    : All versions of mold support symbol versioning.
   elif test $glibcxx_gnu_ld_version -lt $glibcxx_min_gnu_ld_version ; then
     # The right tools, the right setup, but too old.  Fallbacks?
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $glibcxx_gnu_ld_version is too old for" >&5
-- 
2.34.1


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

* Re: [PATCH][V2] Add mold detection for libs.
  2022-01-24 11:11   ` [PATCH][V2] Add mold detection for libs Martin Liška
@ 2022-01-28 18:17     ` Jeff Law
  2022-01-28 22:01       ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Law @ 2022-01-28 18:17 UTC (permalink / raw)
  To: Martin Liška, Jonathan Wakely; +Cc: libstdc++, gcc-patches



On 1/24/2022 4:11 AM, Martin Liška wrote:
> On 1/21/22 17:54, Jonathan Wakely wrote:
>> Yes, OK (but please CC the libstdc++ list, not just me).
>
> Hello.
>
> Sorry for that. Anyway, I would like to install the extended version 
> of the patch
> that touches all libraries.
>
> Ready to be installed?
It looks to me like Jon ack'd in his original reply.  "Yes, OK ..."

jeff


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

* Re: [PATCH][V2] Add mold detection for libs.
  2022-01-28 18:17     ` Jeff Law
@ 2022-01-28 22:01       ` Jonathan Wakely
  2022-01-31  8:46         ` Martin Liška
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2022-01-28 22:01 UTC (permalink / raw)
  To: Jeff Law; +Cc: Martin Liška, libstdc++, gcc-patches

On Fri, 28 Jan 2022 at 18:17, Jeff Law wrote:
>
>
>
> On 1/24/2022 4:11 AM, Martin Liška wrote:
> > On 1/21/22 17:54, Jonathan Wakely wrote:
> >> Yes, OK (but please CC the libstdc++ list, not just me).
> >
> > Hello.
> >
> > Sorry for that. Anyway, I would like to install the extended version
> > of the patch
> > that touches all libraries.
> >
> > Ready to be installed?
> It looks to me like Jon ack'd in his original reply.  "Yes, OK ..."

Yes the libstdc++ part is still OK. I can't approve the equivalent
changes for the other libs.

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

* Re: [PATCH][V2] Add mold detection for libs.
  2022-01-28 22:01       ` Jonathan Wakely
@ 2022-01-31  8:46         ` Martin Liška
  2022-02-01 16:17           ` Jeff Law
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Liška @ 2022-01-31  8:46 UTC (permalink / raw)
  To: Jonathan Wakely, Jeff Law; +Cc: libstdc++, gcc-patches

On 1/28/22 23:01, Jonathan Wakely wrote:
> On Fri, 28 Jan 2022 at 18:17, Jeff Law wrote:
>>
>>
>>
>> On 1/24/2022 4:11 AM, Martin Liška wrote:
>>> On 1/21/22 17:54, Jonathan Wakely wrote:
>>>> Yes, OK (but please CC the libstdc++ list, not just me).
>>>
>>> Hello.
>>>
>>> Sorry for that. Anyway, I would like to install the extended version
>>> of the patch
>>> that touches all libraries.
>>>
>>> Ready to be installed?
>> It looks to me like Jon ack'd in his original reply.  "Yes, OK ..."
> 
> Yes the libstdc++ part is still OK. I can't approve the equivalent
> changes for the other libs.

Hi.

I understand Jeff's OK as an approval also for other libs.

I'm going to install it.

Martin

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

* Re: [PATCH][V2] Add mold detection for libs.
  2022-01-31  8:46         ` Martin Liška
@ 2022-02-01 16:17           ` Jeff Law
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Law @ 2022-02-01 16:17 UTC (permalink / raw)
  To: Martin Liška, Jonathan Wakely; +Cc: libstdc++, gcc-patches



On 1/31/2022 1:46 AM, Martin Liška wrote:
> On 1/28/22 23:01, Jonathan Wakely wrote:
>> On Fri, 28 Jan 2022 at 18:17, Jeff Law wrote:
>>>
>>>
>>>
>>> On 1/24/2022 4:11 AM, Martin Liška wrote:
>>>> On 1/21/22 17:54, Jonathan Wakely wrote:
>>>>> Yes, OK (but please CC the libstdc++ list, not just me).
>>>>
>>>> Hello.
>>>>
>>>> Sorry for that. Anyway, I would like to install the extended version
>>>> of the patch
>>>> that touches all libraries.
>>>>
>>>> Ready to be installed?
>>> It looks to me like Jon ack'd in his original reply.  "Yes, OK ..."
>>
>> Yes the libstdc++ part is still OK. I can't approve the equivalent
>> changes for the other libs.
>
> Hi.
>
> I understand Jeff's OK as an approval also for other libs.
Just to be explicit.  It is ;-)

jeff

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

end of thread, other threads:[~2022-02-01 16:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <e3418294-e27a-cf67-3f31-f2d4873a8557@suse.cz>
2022-01-21 16:54 ` [PATCH] libstdc++: detect mold linker Jonathan Wakely
2022-01-24 11:11   ` [PATCH][V2] Add mold detection for libs Martin Liška
2022-01-28 18:17     ` Jeff Law
2022-01-28 22:01       ` Jonathan Wakely
2022-01-31  8:46         ` Martin Liška
2022-02-01 16:17           ` Jeff Law

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