summaryrefslogtreecommitdiff
path: root/Toolchain
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-07-06 12:36:18 +0200
committerGunnar Beutner <gunnar@beutner.name>2021-07-06 19:08:22 +0200
commitd86275d27156bbcb1922e9fc33f1573234e59528 (patch)
treeba37bfa173ec5830563779efa8eb62d6f1974487 /Toolchain
parent67f0c0d5f07479eee9294535211a31b3a52449c5 (diff)
downloadserenity-d86275d27156bbcb1922e9fc33f1573234e59528.zip
Kernel+Toolchain: Remove the kernel-specific toolchain
This is no longer necessary now that the kernel doesn't use libsupc++ anymore.
Diffstat (limited to 'Toolchain')
-rwxr-xr-xToolchain/BuildIt.sh92
-rw-r--r--Toolchain/Patches/gcc.patch4
2 files changed, 36 insertions, 60 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
index 76c9e056ce..351f1d46cd 100755
--- a/Toolchain/BuildIt.sh
+++ b/Toolchain/BuildIt.sh
@@ -304,65 +304,41 @@ pushd "$DIR/Build/$ARCH"
cp "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h" "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-kernel.h"
fi
- for STAGE in Userland Kernel; do
- rm -rf gcc
- mkdir -p gcc
-
- pushd gcc
- TEMPTARGET="$BUILD/Temp"
- rm -rf "$TEMPTARGET"
-
- echo "XXX configure gcc and libgcc"
- if [ "$STAGE" = "Userland" ]; then
- REALTARGET="$PREFIX"
- else
- REALTARGET="$PREFIX/Kernel"
- fi
-
- cp "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-kernel.h" "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h"
- if [ "$STAGE" = "Userland" ]; then
- sed -i='' 's@-fno-exceptions @@' "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h"
- fi
-
- buildstep "gcc/configure/${STAGE,,}" "$DIR/Tarballs/gcc-$GCC_VERSION/configure" --prefix="$PREFIX" \
- --target="$TARGET" \
- --with-sysroot="$SYSROOT" \
- --disable-nls \
- --with-newlib \
- --enable-shared \
- --enable-languages=c,c++ \
- --enable-default-pie \
- --enable-lto \
- --enable-threads=posix \
- ${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
-
- if [ "$STAGE" = "Userland" ]; then
- echo "XXX build gcc and libgcc"
- buildstep "gcc/build" "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
- if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
- ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
- fi
- buildstep "libgcc/build" "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
- echo "XXX install gcc and libgcc"
- buildstep "gcc+libgcc/install" "$MAKE" DESTDIR="$TEMPTARGET" install-gcc install-target-libgcc || exit 1
- fi
-
- echo "XXX build libstdc++"
- buildstep "libstdc++/build/${STAGE,,}" "$MAKE" -j "$MAKEJOBS" all-target-libstdc++-v3 || exit 1
- echo "XXX install libstdc++"
- buildstep "libstdc++/install/${STAGE,,}" "$MAKE" DESTDIR="$TEMPTARGET" install-target-libstdc++-v3 || exit 1
-
- mkdir -p "$REALTARGET"
- cp -a "$TEMPTARGET"/"$PREFIX"/* "$REALTARGET/"
- rm -rf "$TEMPTARGET"
- popd
-
- if [ "$STAGE" = "Userland" ]; then
- if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
- cd "$DIR/Local/${ARCH}/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
- fi
+ rm -rf gcc
+ mkdir -p gcc
+
+ pushd gcc
+ echo "XXX configure gcc and libgcc"
+ buildstep "gcc/configure" "$DIR/Tarballs/gcc-$GCC_VERSION/configure" --prefix="$PREFIX" \
+ --target="$TARGET" \
+ --with-sysroot="$SYSROOT" \
+ --disable-nls \
+ --with-newlib \
+ --enable-shared \
+ --enable-languages=c,c++ \
+ --enable-default-pie \
+ --enable-lto \
+ --enable-threads=posix \
+ ${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
+
+ echo "XXX build gcc and libgcc"
+ buildstep "gcc/build" "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
+ if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
+ ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
fi
- done
+ buildstep "libgcc/build" "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
+ echo "XXX install gcc and libgcc"
+ buildstep "gcc+libgcc/install" "$MAKE" install-gcc install-target-libgcc || exit 1
+
+ echo "XXX build libstdc++"
+ buildstep "libstdc++/build" "$MAKE" -j "$MAKEJOBS" all-target-libstdc++-v3 || exit 1
+ echo "XXX install libstdc++"
+ buildstep "libstdc++/install" "$MAKE" install-target-libstdc++-v3 || exit 1
+ popd
+
+ if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
+ cd "$DIR/Local/${ARCH}/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
+ fi
popd
diff --git a/Toolchain/Patches/gcc.patch b/Toolchain/Patches/gcc.patch
index d6eef6e996..89f1fa125f 100644
--- a/Toolchain/Patches/gcc.patch
+++ b/Toolchain/Patches/gcc.patch
@@ -129,10 +129,10 @@ diff -Naur gcc-11.1.0-RC-20210420/gcc/config/serenity.h gcc-11.1.0-RC-20210420.s
+#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:%{!nodefaultlibs:-lgcc_s} -dynamic-linker /usr/lib/Loader.so}}"
+
+#undef CC1_SPEC
-+#define CC1_SPEC "-fno-exceptions -ftls-model=initial-exec %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}} -fno-semantic-interposition"
++#define CC1_SPEC "-ftls-model=initial-exec %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}} -fno-semantic-interposition"
+
+#undef CC1PLUS_SPEC
-+#define CC1PLUS_SPEC "-fno-exceptions -ftls-model=initial-exec"
++#define CC1PLUS_SPEC "-ftls-model=initial-exec"
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"