From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 4D82D385802D; Tue, 5 Oct 2021 19:55:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D82D385802D 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 r12-4197] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: d4c470c376b4cb82c9a0b7e8a4b88c44d5e4289d X-Git-Newrev: e24760533b62bb7068e63eb8da49dbca2837d38d Message-Id: <20211005195502.4D82D385802D@sourceware.org> Date: Tue, 5 Oct 2021 19:55:02 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2021 19:55:02 -0000 https://gcc.gnu.org/g:e24760533b62bb7068e63eb8da49dbca2837d38d commit r12-4197-ge24760533b62bb7068e63eb8da49dbca2837d38d Author: Iain Sandoe Date: Tue Oct 5 19:54:30 2021 +0100 Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic. 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. 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. Diff: --- 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;