summaryrefslogtreecommitdiff
path: root/Toolchain
diff options
context:
space:
mode:
authorGunnar Beutner <gunnar@beutner.name>2021-04-12 13:28:33 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-12 22:37:34 +0200
commite95cb252be0187a46a1ee1809329b598d666053e (patch)
tree7eb0752843f5b96a14184e2fab121d682d2293ab /Toolchain
parent3f4e90f32bf563ff8e58a2b6cd6d84464c003113 (diff)
downloadserenity-e95cb252be0187a46a1ee1809329b598d666053e.zip
Toolchain: Install system headers before building GCC
GCC determines whether the system's <limits.h> header is usable and installs a different version of its own <limits.h> header depending on whether the system header file exists. If the system header is missing GCC's <limits.h> header does not include the system header via #include_next. For this to work we need to install LibC's headers before attempting to build GCC. Also, re-running BuildIt.sh "hides" this problem because at that point the sysroot directory also already has a <limits.h> header file from the previous build.
Diffstat (limited to 'Toolchain')
-rwxr-xr-xToolchain/BuildIt.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
index c8f0cb5024..4f245a1ce0 100755
--- a/Toolchain/BuildIt.sh
+++ b/Toolchain/BuildIt.sh
@@ -239,15 +239,6 @@ pushd "$DIR/Build/$ARCH"
--enable-lto \
${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
- echo "XXX build gcc and libgcc"
- "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
- if [ "$(uname -s)" = "OpenBSD" ]; then
- ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
- fi
- "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
- echo "XXX install gcc and libgcc"
- "$MAKE" install-gcc install-target-libgcc || exit 1
-
echo "XXX serenity libc and libm headers"
mkdir -p "$BUILD"
pushd "$BUILD"
@@ -261,6 +252,15 @@ pushd "$DIR/Build/$ARCH"
unset SRC_ROOT
popd
+ echo "XXX build gcc and libgcc"
+ "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
+ if [ "$(uname -s)" = "OpenBSD" ]; then
+ ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
+ fi
+ "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
+ echo "XXX install gcc and libgcc"
+ "$MAKE" install-gcc install-target-libgcc || exit 1
+
echo "XXX build libstdc++"
"$MAKE" -j "$MAKEJOBS" all-target-libstdc++-v3 || exit 1
echo "XXX install libstdc++"