From unknown Tue Jun 17 01:46:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54788: libtool -export-symbols-regex broken on Solaris against GNU ld Resent-From: Frederic Berat Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Fri, 08 Apr 2022 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54788 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 54788@debbugs.gnu.org X-Debbugs-Original-To: bug-libtool@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164942250518516 (code B ref -1); Fri, 08 Apr 2022 12:56:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Apr 2022 12:55:05 +0000 Received: from localhost ([127.0.0.1]:34125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nco8k-0004oT-J3 for submit@debbugs.gnu.org; Fri, 08 Apr 2022 08:55:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:46030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncj5K-0000f9-2i for submit@debbugs.gnu.org; Fri, 08 Apr 2022 03:31:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncj5I-0004pH-0N for bug-libtool@gnu.org; Fri, 08 Apr 2022 03:31:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncj5D-0007jK-TA for bug-libtool@gnu.org; Fri, 08 Apr 2022 03:31:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649403061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=nSKyxYp6Vx9JEdztT8dAnlQUMdKCIvRGhmKMUpY+kPk=; b=LMV1CAAW7TYj+Os0N0X+yu91BphwWYt5q0mAGMrUYpDuBJv9sEhdxXad8vMxXFjfjXN5mQ 7DTU5xgNy42ZY9rx4olijJTj2LxRKQ7xXA232jA2QMZmDXMLtrPwKmWA7CqYVDg4E0/TWk lLaau4nBeGmKEMboAwP+ze11UlcJtK0= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-9-dTmAZg9mMk6mxgKJTpqIRA-1; Fri, 08 Apr 2022 03:29:36 -0400 X-MC-Unique: dTmAZg9mMk6mxgKJTpqIRA-1 Received: by mail-ot1-f69.google.com with SMTP id w7-20020a9d6747000000b005b25c9036fdso4042615otm.5 for ; Fri, 08 Apr 2022 00:29:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=nSKyxYp6Vx9JEdztT8dAnlQUMdKCIvRGhmKMUpY+kPk=; b=GoHepYLfZwZxg5eJ9ObA2t7SQaGwkOSy98ve4f8/CqprZUtz8Ux77vik6zNnVsl5Ku dTwqQgiD/ncafIvrsUlXlHcniz52+aOmB6+gnsNNFPGnaPWp8BAFsRDMbMEGF3y4wISk Fz1EGjZM3esB4FJF708woaz/jNSLoLgBCo5X7z85UBMAUX2OPQHdwDt/CKIzYDM+X0Ro 0d2SLgChv5FntJZiuNkar0dgCSINuESWiy057G2IbS1yq8rveq0/+uVRjCRRFEHN8dCb VqKICSkojmBfU5K4IiWfG2zLBTKGP3KfTv7s7AAOKylECngR8MX4jDQ14sFiDo0phQh6 6r7g== X-Gm-Message-State: AOAM530Bscj/r59Hlj9XPFbpkEgtks/PNg0HefPSWtEutDJpoNPZFw8T BVGRx3ek94C07E2lxkSs+rg/xXguQ6XchhVmd9iUi69rMhWmn6hoCQYvzykQHLTAf7Lj/8u0TN+ vwBFpjoqcZ/+wsBal8US1JyLCot9f X-Received: by 2002:a05:6808:300a:b0:2f9:4722:fffc with SMTP id ay10-20020a056808300a00b002f94722fffcmr7401556oib.31.1649402975377; Fri, 08 Apr 2022 00:29:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC9ED746xLv+Rsx6Uc0ErYGaXs4XI7BlWjOvkedikVJqLODMQyh0fUV/mIVM/8kTesyz0xFdepLuGE71qA6zo= X-Received: by 2002:a05:6808:300a:b0:2f9:4722:fffc with SMTP id ay10-20020a056808300a00b002f94722fffcmr7401549oib.31.1649402975113; Fri, 08 Apr 2022 00:29:35 -0700 (PDT) MIME-Version: 1.0 From: Frederic Berat Date: Fri, 8 Apr 2022 09:29:24 +0200 Message-ID: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=fberat@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000006c6ba305dc1f8e6b" Received-SPF: pass client-ip=170.10.133.124; envelope-from=fberat@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Mailman-Approved-At: Fri, 08 Apr 2022 08:55:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --0000000000006c6ba305dc1f8e6b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, The following problem has been found by the GCC team: As mentioned in https://gcc.gnu.org/PR102426 , libtool -export-symbols-regex implementation on *-solaris* blindly assumes that Sun ld is used and uses -Wl,-M option: if test "$GCC" =3D yes; then wlarc=3D'${wl}' _LT_TAGVAR(archive_cmds, $1)=3D'$CC -shared ${wl}-z ${wl}text ${wl}= -h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)=3D'echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else in libtool.m4. But when GCC is configured to use GNU ld, that is wrong, for the if test "$with_gnu_ld" =3D yes case it needs to use (if supports_anon_versioning) -Wl,-version-script like e.g. on Linux. Fr=C3=A9d=C3=A9ric B=C3=A9rat Red Hat - Platform Tools https://www.redhat.com --0000000000006c6ba305dc1f8e6b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

The following problem has been found by the = GCC team:

As mentioned in h= ttps://gcc.gnu.org/PR102426 , libtool -export-symbols-regex implementat= ion on *-solaris* blindly assumes that Sun ld is used and uses -Wl,-M optio= n:

=C2=A0 =C2=A0 =C2=A0 if test "$GCC&q= uot; =3D yes; then
<= /span>
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 wlarc=3D'${wl}'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 _LT_TAGVAR(archi= ve_cmds, $1)=3D'$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $= lib $libobjs $deplibs $compiler_flags'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 _= LT_TAGVAR(archive_expsym_cmds, $1)=3D'echo "{ global:" > $= lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $l= ib.exp~echo "local: *; };" >> $lib.exp~
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${= wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp&#= 39;
=C2=A0 =C2=A0 =C2=A0 else


in libtool.m= 4.

But when GCC is configured to use GNU ld, that = is wrong, for the
if test "$with_gnu_ld" =3D yes case it nee= ds to use (if supports_anon_versioning)
-Wl,-version-script like e.= g. on Linux.

Fr= =C3=A9d=C3=A9ric B=C3=A9rat

Red Hat -=C2=A0 Platfo= rm Tools
=C2=A0
--0000000000006c6ba305dc1f8e6b--