summaryrefslogtreecommitdiffstats
path: root/configure.ac
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.ac
parentre PR tree-optimization/91403 (GCC fails with ICE.) (diff)
downloadgcc-aac9103b0e13e49cc4e88abc857d4d043ce20bd4.tar.gz
gcc-aac9103b0e13e49cc4e88abc857d4d043ce20bd4.tar.bz2
gcc-aac9103b0e13e49cc4e88abc857d4d043ce20bd4.tar.xz
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.ac')
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index dcc89fbdde1..1fe97c001cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1640,6 +1640,19 @@ AC_ARG_WITH(stage1-libs,
1640[stage1_libs=]) 1640[stage1_libs=])
1641AC_SUBST(stage1_libs) 1641AC_SUBST(stage1_libs)
1642 1642
1643# Whether or not to use -static-libstdc++ and -static-libgcc. The
1644# default is yes if gcc is being built; no otherwise. The reason for
1645# this default is that gdb is sometimes linked against GNU Source
1646# Highlight, which is a shared library that uses C++ exceptions. In
1647# this case, -static-libstdc++ will cause crashes.
1648AC_ARG_WITH(static-standard-libraries,
1649[AS_HELP_STRING([--with-static-standard-libraries],
1650 [use -static-libstdc++ and -static-libgcc (default=auto)])],
1651[], [with_static_standard_libraries=auto])
1652if test "$with_static_standard_libraries" = auto; then
1653 with_static_standard_libraries=$have_compiler
1654fi
1655
1643# Linker flags to use for stage1 or when not bootstrapping. 1656# Linker flags to use for stage1 or when not bootstrapping.
1644AC_ARG_WITH(stage1-ldflags, 1657AC_ARG_WITH(stage1-ldflags,
1645[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])], 1658[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
@@ -1652,7 +1665,8 @@ AC_ARG_WITH(stage1-ldflags,
1652 # In stage 1, default to linking libstdc++ and libgcc statically with GCC 1665 # In stage 1, default to linking libstdc++ and libgcc statically with GCC
1653 # if supported. But if the user explicitly specified the libraries to use, 1666 # if supported. But if the user explicitly specified the libraries to use,
1654 # trust that they are doing what they want. 1667 # trust that they are doing what they want.
1655 if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then 1668 if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
1669 -a "$have_static_libs" = yes; then
1656 stage1_ldflags="-static-libstdc++ -static-libgcc" 1670 stage1_ldflags="-static-libstdc++ -static-libgcc"
1657 fi]) 1671 fi])
1658AC_SUBST(stage1_ldflags) 1672AC_SUBST(stage1_ldflags)