]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 5 Oct 2021 18:54:30 +0000 (19:54 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 13 Oct 2021 09:02:04 +0000 (10:02 +0100)
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 <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.

(cherry picked from commit e24760533b62bb7068e63eb8da49dbca2837d38d)

gcc/d/d-spec.cc

index 5adc662c6f2509ce75507c3c704c38989773206a..b12d28f10478b6ab32f1d0f42ff502d777eb197f 100644 (file)
@@ -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;