From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id 1068B3858D1E for ; Fri, 30 Dec 2022 11:00:28 +0000 (GMT) Received: (qmail 50148 invoked from network); 30 Dec 2022 11:00:23 -0000 X-APM-Out-ID: 16723980235014 X-APM-Authkey: 257869/1(257869/1) 7 Received: from unknown (HELO smtpclient.apple) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 30 Dec 2022 11:00:23 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [PATCH 4/n] modula-2, driver: Handle static-libstd++ for targets without static/dynamic From: Iain Sandoe In-Reply-To: <20221230105821.61331-1-iain@sandoe.co.uk> Date: Fri, 30 Dec 2022 11:00:23 +0000 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <20221230105821.61331-1-iain@sandoe.co.uk> To: Gaius Mulley X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Oops pressed =E2=80=98send' too soon - this is part of the series for = Darwin: There are several modula-2 issues on Darwin, some blocking bootstrap on one or more system versions. This has been tested on powerpc/i688-darwin9 .. x86_64-darwin10,17,21 = and the prototype aarch64-darwin branch on darwin21. OK for trunk? thanks Iain > On 30 Dec 2022, at 10:58, Iain Sandoe wrote: >=20 > The follows the pattern used in C++ and D drivers to pass = -static-libstdc++ > onto the target driver to allow spec substitution of static libraries. >=20 > NOTE: The general handling of Bstatic/dynamic and the possible use of = static > libgm2 libraries is unimplemented in this driver so far. It seems = likely > that the driver construction could be greatly simplified if the = modula-2 > runtimes were combined into fewer (hopefully, one) libraries. >=20 > Signed-off-by: Iain Sandoe >=20 > gcc/m2/ChangeLog: >=20 > * gm2spec.cc (lang_specific_driver): Pass -static-libstdc++ on = to > the target driver if the linker does not support = Bstatic/dynamic. > --- > gcc/m2/gm2spec.cc | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc > index 680dd3602ef..b9a5c4e79bb 100644 > --- a/gcc/m2/gm2spec.cc > +++ b/gcc/m2/gm2spec.cc > @@ -767,7 +767,12 @@ lang_specific_driver (struct cl_decoded_option = **in_decoded_options, >=20 > case OPT_static_libstdc__: > library =3D library >=3D 0 ? 2 : library; > +#ifdef HAVE_LD_STATIC_DYNAMIC > + /* Remove -static-libstdc++ from the command only if target = supports > + LD_STATIC_DYNAMIC. When not supported, it is left in so = that a > + back-end target can use outfile substitution. */ > args[i] |=3D SKIPOPT; > +#endif > break; >=20 > case OPT_stdlib_: > --=20 > 2.37.1 (Apple Git-137.1) >=20