summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-08-19 15:47:30 +0000
committerTom Tromey <tromey@gcc.gnu.org>2019-08-19 15:47:30 +0000
commitaac9103b0e13e49cc4e88abc857d4d043ce20bd4 (patch)
tree1028bf8d37dd79dc12f8142bbe022398bae633fd /configure
parent3bbc329b2498e895048ab46e83ce43c2d55cfa27 (diff)
Add --with-static-standard-libraries to the top level
gdb should normally not be linked with -static-libstdc++. Currently this has not caused problems, but it's incompatible with catching an exception thrown from a shared library -- and a subsequent patch changes gdb to do just this. This patch adds a new --with-static-standard-libraries flag to the top-level configure. It defaults to "auto", which means enabled if gcc is being built, and disabled otherwise. ChangeLog 2019-08-19 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Add --with-static-standard-libraries. From-SVN: r274673
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 23 insertions, 1 deletions
diff --git a/configure b/configure
index 63b1e33f41c..c3ec920df13 100755
--- a/configure
+++ b/configure
@@ -806,6 +806,7 @@ with_gmp
with_gmp_include
with_gmp_lib
with_stage1_libs
+with_static_standard_libraries
with_stage1_ldflags
with_boot_libs
with_boot_ldflags
@@ -1579,6 +1580,9 @@ Optional Packages:
--with-gmp-include=PATH specify directory for installed GMP include files
--with-gmp-lib=PATH specify directory for the installed GMP library
--with-stage1-libs=LIBS libraries for stage1
+ --with-static-standard-libraries
+ use -static-libstdc++ and -static-libgcc
+ (default=auto)
--with-stage1-ldflags=FLAGS
linker flags for stage1
--with-boot-libs=LIBS libraries for stage2 and later
@@ -5877,6 +5881,23 @@ fi
+# Whether or not to use -static-libstdc++ and -static-libgcc. The
+# default is yes if gcc is being built; no otherwise. The reason for
+# this default is that gdb is sometimes linked against GNU Source
+# Highlight, which is a shared library that uses C++ exceptions. In
+# this case, -static-libstdc++ will cause crashes.
+
+# Check whether --with-static-standard-libraries was given.
+if test "${with_static_standard_libraries+set}" = set; then :
+ withval=$with_static_standard_libraries;
+else
+ with_static_standard_libraries=auto
+fi
+
+if test "$with_static_standard_libraries" = auto; then
+ with_static_standard_libraries=$have_compiler
+fi
+
# Linker flags to use for stage1 or when not bootstrapping.
# Check whether --with-stage1-ldflags was given.
@@ -5891,7 +5912,8 @@ else
# In stage 1, default to linking libstdc++ and libgcc statically with GCC
# if supported. But if the user explicitly specified the libraries to use,
# trust that they are doing what they want.
- if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
+ if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
+ -a "$have_static_libs" = yes; then
stage1_ldflags="-static-libstdc++ -static-libgcc"
fi
fi