public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic.
@ 2021-10-05 19:57 Iain Sandoe
  2021-10-06 13:10 ` ibuclaw
  0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2021-10-05 19:57 UTC (permalink / raw)
  To: 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 <iain@sandoe.co.uk>

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;
-- 
2.24.3 (Apple Git-128)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pushed] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic.
  2021-10-05 19:57 [pushed] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic Iain Sandoe
@ 2021-10-06 13:10 ` ibuclaw
  0 siblings, 0 replies; 2+ messages in thread
From: ibuclaw @ 2021-10-06 13:10 UTC (permalink / raw)
  To: iain, Iain Sandoe, gcc-patches

> On 05/10/2021 21:57 Iain Sandoe <iains.gcc@gmail.com> wrote:
> 
>  
> 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

Thanks, it will apply cleanly on the other branches, so feel free to backport.

Iain.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-06 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 19:57 [pushed] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic Iain Sandoe
2021-10-06 13:10 ` ibuclaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).