From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id F16463858D28; Thu, 5 Jan 2023 12:48:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F16463858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672922891; bh=PGgjUTJV1QLWrxZiUoKPue4h4UruGBru9AEUb8Eo1eM=; h=From:To:Subject:Date:From; b=C3/NK+6rLAMKexDH58r8xMqEUVOJJJmSgEOCIAkvstjeem8CeHIsInz/CAaxDzpa1 h1BgRcj1lO7uK6JNbGhqJnwwh+JzZE54A/neX6Nvl7k2HwoPt2j4b9VnUaHMMxNpCW DKztXvYi2Y3tKQ89F5YOLB3l3beVUTLSxDcB5nBc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5007] modula-2, driver: Handle static-libstd++ for targets without static/dynamic X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: 29c3218618ef6177dc33871b26c8fbd9b21eabe1 X-Git-Newrev: 2421470867f198c3aa57e0a7ab0d473aac4cdd38 Message-Id: <20230105124811.F16463858D28@sourceware.org> Date: Thu, 5 Jan 2023 12:48:11 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2421470867f198c3aa57e0a7ab0d473aac4cdd38 commit r13-5007-g2421470867f198c3aa57e0a7ab0d473aac4cdd38 Author: Iain Sandoe Date: Thu Dec 22 19:00:13 2022 +0000 modula-2, driver: Handle static-libstd++ for targets without static/dynamic 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 handling of Bstatic/dynamic and the possible use of static libgm2 libraries is unimplemented in this driver so far. 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. Diff: --- 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_: