From patchwork Tue Oct 5 19:57:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 45909 Return-Path: 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 B16C8385AC30 for ; Tue, 5 Oct 2021 19:58:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B16C8385AC30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633463885; bh=RoDKX+kyglF6zxQHWsdCL/BCB+5+yp2n+TXL6zR7xzI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ISUchiqImClkSscxipSffvHMJvHFCglJ+1jKaDDiCNgIN9i9Ee+R2YK7yJia6c3YD M3Rs4GXlg4tUBSOb4UUTQD8VJRcWyo+2ruDWoC8hH75E4EplgzxzWXcwO66LPqBTTL lh1CUz+1WhDk/fMypOZyZypfhQU28VpAAI8z2+R8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 783B3385AC22 for ; Tue, 5 Oct 2021 19:57:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 783B3385AC22 Received: by mail-wr1-x42b.google.com with SMTP id o20so1285290wro.3 for ; Tue, 05 Oct 2021 12:57:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=RoDKX+kyglF6zxQHWsdCL/BCB+5+yp2n+TXL6zR7xzI=; b=zJ4jFGaXA4fmWZJ6HtEflEMz7FoU22QPpuhrFlFuQIv3/VaYviEBceCJjaKy72o+R1 uWRJaufsPTWc3rV8N9iy/9Par/3pPZqDYL286lD68XrPZuUEdkpCjmGhSckDh8NuTgWd EzBK/fBSDtED4kAtGIUUyOtYdWbUbtJEq5o/rnnuoG2YMlHsgurwqLFfTaXn4/kNfi4w rN3T+E76K4VnsFs13JuJ5KTnAMs4UblLiEMCc/XvUqXYD5+a6+Ut/bSqCNbJDeTnepgn ta1Kp/l3dqAYWvjBYhCCSlpvCv7s1ifzJNVpM/gDl2sbHKJEzPHKEYGdCczTZ/hDoeZs 0HgA== X-Gm-Message-State: AOAM532cbZMavbfpDegg+mEAVw214xYInaigwQd450wkb5D8x5J24xIv 6PTgAMLaQeSG3wBMYFgPT1VJKyA8rapJoQ== X-Google-Smtp-Source: ABdhPJxFZY6YIkVUc9K3JsvR1sY0ydTSeqsMGbRmJWErV9ck1eaHXBVc3DingjhPdhfI3vY21wKehQ== X-Received: by 2002:adf:a350:: with SMTP id d16mr24464501wrb.136.1633463855571; Tue, 05 Oct 2021 12:57:35 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id y6sm7733684wro.63.2021.10.05.12.57.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Oct 2021 12:57:35 -0700 (PDT) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic. Date: Tue, 5 Oct 2021 20:57:28 +0100 Message-Id: <20211005195728.44175-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This fixes a bootstrap fail because saw_static_libcxx was unused for targets without support for -Bstatic/dynamic. The fix applied pushes the -static-libstdc++ back onto the command line, which allows a target to substitute a static version of the c++ standard library using specs. tested on x86_64-darwin, pushed as bootstrap fix (it, or an alternate will also be needed on open branches), thanks Iain Signed-off-by: Iain Sandoe gcc/d/ChangeLog: * d-spec.cc (lang_specific_driver): Push the -static-libstdc++ option back onto the command line for targets without support for -Bstatic/dynamic. --- gcc/d/d-spec.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/d/d-spec.cc b/gcc/d/d-spec.cc index 5adc662c6f2..b12d28f1047 100644 --- a/gcc/d/d-spec.cc +++ b/gcc/d/d-spec.cc @@ -468,6 +468,12 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER, &new_decoded_options[j++]); } +#else + /* Push the -static-libstdc++ option back onto the command so that + a target without LD_STATIC_DYNAMIC can use outfile substitution. */ + if (saw_static_libcxx && !static_link) + generate_option (OPT_static_libstdc__, NULL, 1, CL_DRIVER, + &new_decoded_options[j++]); #endif if (saw_libcxx) new_decoded_options[j++] = *saw_libcxx;