From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=sxcOQLhhrbCSfqN9GAqCQxGN9RUmAfA39esFGMGzd+4=; b=bhybCHUSvQh93XNq3xyipgQUD9KsKybjSPJzCIliQLMKrhKL2p25Ve4DXWtJkhftmW TJKyyOUrZe8Os2isQiUR61oQnadpGbYjdg/c3cwgeBnlawTpiOChIGrakN2wN4NseO1I jefHmC49s0FZXJdc159DDA83GKA5zPDwCa8+BhLuuGYkdLX6yNO9a5ZLSUhCfzXWFvZ1 /8dDIdQa/Y9YmnKp/WaHT91q/UHUA6aqCxXB/CsgY6XzdxUeHi42eOJwNLhbe1grtAss 60iDHioLCnOm/ubp4ojQllZMZpt6xtZfLkjY3Iox5Nt/k3ilsjD/QeNq0KZ+ObnCM9cr DE4w== 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) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Cc: gaiusmod2@gmail.com 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) Reply-To: iain@sandoe.co.uk 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 List-Id: 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_: -- 2.37.1 (Apple Git-137.1)