Message ID | 20221230105821.61331-1-iain@sandoe.co.uk |
---|---|
State | Committed |
Commit | 2421470867f198c3aa57e0a7ab0d473aac4cdd38 |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 816EE3858414 for <patchwork@sourceware.org>; Fri, 30 Dec 2022 10:58:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 816EE3858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672397931; bh=sxcOQLhhrbCSfqN9GAqCQxGN9RUmAfA39esFGMGzd+4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=sWWZYzrGjSYsxauST6yicAg2sowbsvMqjfKHX6BkYCHTIQ39TvCL+ZWyhy8hCOjpN VmdkMoMh6vJmWmI3nejsy7QIQ57IYg7X4oZxviLNT45SaIG+H/GFff/FRcqHHO2DdO TXZ3d62gZkX0InINGwsmMtGwORJdOjHmthpjsiAA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id F3E4E3858D1E for <gcc-patches@gcc.gnu.org>; Fri, 30 Dec 2022 10:58:23 +0000 (GMT) Received: by mail-wr1-x42e.google.com with SMTP id z16so3121430wrw.1 for <gcc-patches@gcc.gnu.org>; Fri, 30 Dec 2022 02:58:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sxcOQLhhrbCSfqN9GAqCQxGN9RUmAfA39esFGMGzd+4=; b=xaMaz2Y3zqYlmqVk0j8L0BAEcKOHfBvheBi+/PVTW+195MrozwCTXlnxbS34TXxoLm uBQRT+RsFBiQn2gazA/CGhZdmXc/85XJl2EjxQJgrSy6CiuVX1Wos2Bm3YcHfnFitGJq CwJFC/zK1/bKmpjQIsSyRK0k9dcqudZyJYi8T3cNCs8K/QM2RsGibXaNvrzbuv3Gu8Yy cgIAvt58ijY+Z2xWz0Sy8zk52pe6C7d1yerlnMLcPTOKBF+jBns4A+JDjCcneydskNx6 mcnUY2Abzl4sU8peFUvg0U24eAzi78tlpW4B5KmTYrxxkVa7OxTBthTbewwuhzW5NOnr n9wQ== X-Gm-Message-State: AFqh2koZG1FJRR4LC5pjRFIvYmOo3IzL/BjD4F+eVsbEQ1aqDUtDx3Ah iRfJWPHVCNT45ngBJD182dYOc3pdgAE= X-Google-Smtp-Source: AMrXdXvfMinebRX0Wvm3RfGrpHp64dWH0wZJ/+zQ2MSGdrhkSV/3SnGOUoouF69OYZ1FxU5rnVpy5g== X-Received: by 2002:adf:f888:0:b0:275:6e76:c936 with SMTP id u8-20020adff888000000b002756e76c936mr14352886wrp.49.1672397902730; Fri, 30 Dec 2022 02:58:22 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id x15-20020a5d490f000000b00236883f2f5csm19932115wrq.94.2022.12.30.02.58.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 30 Dec 2022 02:58:22 -0800 (PST) X-Google-Original-From: Iain Sandoe <iain@sandoe.co.uk> To: gcc-patches@gcc.gnu.org Subject: [PATCH 4/n] modula-2, driver: Handle static-libstd++ for targets without static/dynamic Date: Fri, 30 Dec 2022 10:58:21 +0000 Message-Id: <20221230105821.61331-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Iain Sandoe via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe <iains.gcc@gmail.com>, gaiusmod2@gmail.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[4/n] modula-2, driver: Handle static-libstd++ for targets without static/dynamic
|
|
Commit Message
Iain Sandoe
Dec. 30, 2022, 10:58 a.m. UTC
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.
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.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/m2/ChangeLog:
* 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(+)
Comments
Oops pressed ‘send' 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 <iains.gcc@gmail.com> wrote: > > 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. > > 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. > > Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> > > gcc/m2/ChangeLog: > > * 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(+) > > 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, > > case OPT_static_libstdc__: > library = library >= 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] |= SKIPOPT; > +#endif > break; > > case OPT_stdlib_: > -- > 2.37.1 (Apple Git-137.1) >
Iain Sandoe <iain@sandoe.co.uk> writes: > Oops pressed ‘send' 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 sure, LGTM regards, Gaius >> On 30 Dec 2022, at 10:58, Iain Sandoe <iains.gcc@gmail.com> wrote: >> >> 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. >> >> 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. >> >> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> >> >> gcc/m2/ChangeLog: >> >> * 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(+) >> >> 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, >> >> case OPT_static_libstdc__: >> library = library >= 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] |= SKIPOPT; >> +#endif >> break; >> >> case OPT_stdlib_: >> -- >> 2.37.1 (Apple Git-137.1) >>
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, case OPT_static_libstdc__: library = library >= 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] |= SKIPOPT; +#endif break; case OPT_stdlib_: