From patchwork Fri Dec 30 10:58:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 37641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2833669wrt; Fri, 30 Dec 2022 02:59:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXsJ9uV/YT8nijO9lBHhFtEZiiqWOjYdTqUI0QiFpqXnGcL8Dj1EmhUXlY1urrMtL8axsl6K X-Received: by 2002:a17:907:7f24:b0:7c1:6091:e76 with SMTP id qf36-20020a1709077f2400b007c160910e76mr36456025ejc.53.1672397947384; Fri, 30 Dec 2022 02:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672397947; cv=none; d=google.com; s=arc-20160816; b=I57zd0+yALBOJ5VdUT/2ce4Yo/osDDh0iqOTW6S617fLIUCnICJdHsG3LLMzVjEX4o xGPDCLszD8apizPvj8gCYA6UZvXjdvThoG6p6dMrd6cjqb0ScovuB36phwPSv6qiu30h 9FxELZRBrgbm4ly4luiyEzLY4UXmnxu5AWPYBv+nAbxATKtrl7BkpQh1H1vMlER3G814 dwpCp/455ZhxV1WYvhPkKUmo2WEBHJiM2wBtLo/JEXYgOXuuB0PUILjWEg+3bm7B4inM FxAi2OJPB4s40ubYVxiIds7juA8+dvUKPxlJ/FF48Y/zuyIZs4gWA2TfQm/DOJAjXmFR 3lBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :delivered-to:dkim-signature:dkim-filter; bh=sxcOQLhhrbCSfqN9GAqCQxGN9RUmAfA39esFGMGzd+4=; b=XpwdvfuMlggAqhKE2SA7rkNoEliLWmBG4Vv21RoSz4V1BLjgODImisZm7F778vAQX4 N8bIsWoRN0WnTF3uPMt2zFP6LEyX/hbrF+UvbjPi8EpYGMm0NjO5EZud+Jp/ih2SS6cr 9x9qnO8CgG0emJhNC9LWkNiKh9ZLXrAcFS1wm+tAIYQedAh7gfCreD2uEUDY4H085JfV RPRocECiKDFU3H55+vrnM+yTyzCeAvg2gQIdYlDiLqubRSePGfSr/FgTZiqa6YekLF+5 aZ7loEbk0izw6lxszKGH+dpgYoPW71+BcLSmhwd+XMkO1uM+DQtFWRZXXKP1WAwTflHD +N/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ngixGwpW; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id un2-20020a170907cb8200b007c500a254e3si13956163ejc.941.2022.12.30.02.59.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Dec 2022 02:59:07 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ngixGwpW; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32FCB3858426 for ; Fri, 30 Dec 2022 10:59:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32FCB3858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672397946; 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=ngixGwpW2IANIAVSIy20vfdbZ0HW8pAcnp077KF6Dy76gVG5Yb6wRpdRhv8lgvaF+ QzrhD4hmFfE2x2gbc23jSsLA6hFS5igLQJnrPTfDZitTLt/5umpzqeSXr7dOAHLF8U v1XtJHk8Dtuham4B3wE8Zopx81a26iEiv8qnxpMs= 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 ; Fri, 30 Dec 2022 10:58:23 +0000 (GMT) Received: by mail-wr1-x42e.google.com with SMTP id z16so3121430wrw.1 for ; 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-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 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe , gaiusmod2@gmail.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753636349730554100?= X-GMAIL-MSGID: =?utf-8?q?1753636349730554100?= 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 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_: