aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-09-20 11:57:28 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-10-03 15:43:48 +0100
commitf1b51f68f8ac6c63e352dda8599aed01634212de (patch)
tree18496da44408ad8f7e0fb72263e2edf7523eb61e /libstdc++-v3/include
parent77d0627c244f7520bf74ec9cf2a8b69c32b6d30d (diff)
downloadgcc-f1b51f68f8ac6c63e352dda8599aed01634212de.zip
gcc-f1b51f68f8ac6c63e352dda8599aed01634212de.tar.gz
gcc-f1b51f68f8ac6c63e352dda8599aed01634212de.tar.bz2
libstdc++: Make _GLIBCXX_HOSTED respect -ffreestanding [PR103626]
This allows the library to switch to freestanding mode when compiling with the -ffreestanding flag. This means you don't need a separate libstdc++ build configured with --disable-hosted-libstdcxx in order to compile for a freestanding environment. The testsuite support files cannot be compiled for freestanding, so add -fno-freestanding to override any -ffreestanding in the test flags. libstdc++-v3/ChangeLog: PR libstdc++/103626 * acinclude.m4 (GLIBCXX_ENABLE_HOSTED): Define _GLIBCXX_HOSTED to __STDC_HOSTED__ for non-freestanding installations. * configure: Regenerate. * include/Makefile.am (${host_builddir}/c++config.h): Adjust grep pattern. * include/Makefile.in: Regenerate. * testsuite/lib/libstdc++.exp (v3-build_support): Use -fno-freestanding. * testsuite/libstdc++-abi/abi.exp: Likewise.
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/Makefile.am2
-rw-r--r--libstdc++-v3/include/Makefile.in2
2 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 3eeb407..3472e84 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1326,7 +1326,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
${CONFIG_HEADER} > /dev/null 2>&1 \
&& ldbl_alt128_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT 1,' ;\
verbose_assert='s,g,g,' ; \
- grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_HOSTED[ ][ ]*1[ ]*$$" \
+ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_HOSTED[ ][ ]*__STDC_HOSTED__[ ]*$$" \
${CONFIG_HEADER} > /dev/null 2>&1 \
&& grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_VERBOSE[ ][ ]*1[ ]*$$" \
${CONFIG_HEADER} > /dev/null 2>&1 \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index e24563c..39ef34f 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1820,7 +1820,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
${CONFIG_HEADER} > /dev/null 2>&1 \
&& ldbl_alt128_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT 1,' ;\
verbose_assert='s,g,g,' ; \
- grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_HOSTED[ ][ ]*1[ ]*$$" \
+ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_HOSTED[ ][ ]*__STDC_HOSTED__[ ]*$$" \
${CONFIG_HEADER} > /dev/null 2>&1 \
&& grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_VERBOSE[ ][ ]*1[ ]*$$" \
${CONFIG_HEADER} > /dev/null 2>&1 \