mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
Kernel+Toolchain: Remove the kernel-specific toolchain
This is no longer necessary now that the kernel doesn't use libsupc++ anymore.
This commit is contained in:
parent
67f0c0d5f0
commit
d86275d271
3 changed files with 40 additions and 63 deletions
|
@ -355,6 +355,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -ffreestanding -fbuiltin")
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
||||
if (NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib -nostdinc -nostdinc++")
|
||||
endif()
|
||||
|
@ -388,13 +389,13 @@ add_library(kernel_heap STATIC ${KERNEL_HEAP_SOURCES})
|
|||
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
|
||||
include_directories(/usr/local/include/c++/${GCC_VERSION}/)
|
||||
else()
|
||||
if (NOT EXISTS ${TOOLCHAIN_ROOT}/Kernel/${SERENITY_ARCH}-pc-serenity/include/c++/${GCC_VERSION}/)
|
||||
if (NOT EXISTS ${TOOLCHAIN_ROOT}/${SERENITY_ARCH}-pc-serenity/include/c++/${GCC_VERSION}/)
|
||||
message(FATAL_ERROR "Toolchain version ${GCC_VERSION} appears to be missing! Please run: Meta/serenity.sh rebuild-toolchain")
|
||||
endif()
|
||||
include_directories(${TOOLCHAIN_ROOT}/Kernel/${SERENITY_ARCH}-pc-serenity/include/c++/${GCC_VERSION}/)
|
||||
include_directories(${TOOLCHAIN_ROOT}/Kernel/${SERENITY_ARCH}-pc-serenity/include/c++/${GCC_VERSION}/${SERENITY_ARCH}-pc-serenity/)
|
||||
link_directories(${TOOLCHAIN_ROOT}/Kernel/${SERENITY_ARCH}-pc-serenity/lib)
|
||||
link_directories(${TOOLCHAIN_ROOT}/Kernel/lib/gcc/${SERENITY_ARCH}-pc-serenity/${GCC_VERSION}/)
|
||||
include_directories(${TOOLCHAIN_ROOT}/${SERENITY_ARCH}-pc-serenity/include/c++/${GCC_VERSION}/)
|
||||
include_directories(${TOOLCHAIN_ROOT}/${SERENITY_ARCH}-pc-serenity/include/c++/${GCC_VERSION}/${SERENITY_ARCH}-pc-serenity/)
|
||||
link_directories(${TOOLCHAIN_ROOT}/${SERENITY_ARCH}-pc-serenity/lib)
|
||||
link_directories(${TOOLCHAIN_ROOT}/lib/gcc/${SERENITY_ARCH}-pc-serenity/${GCC_VERSION}/)
|
||||
endif()
|
||||
|
||||
if ("${SERENITY_ARCH}" STREQUAL "i686")
|
||||
|
|
|
@ -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
|
||||
rm -rf gcc
|
||||
mkdir -p gcc
|
||||
|
||||
pushd gcc
|
||||
TEMPTARGET="$BUILD/Temp"
|
||||
rm -rf "$TEMPTARGET"
|
||||
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 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
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue