1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

Toolchain: Enable -fexceptions and build a separate libstdc++ for the kernel

This enables building usermode programs with exception handling. It also
builds a libstdc++ without exception support for the kernel.

This is necessary because the libstdc++ that gets built is different
when exceptions are enabled. Using the same library binary would
require extensive stubs for exception-related functionality in the
kernel.
This commit is contained in:
Gunnar Beutner 2021-04-16 20:42:18 +02:00 committed by Andreas Kling
parent ebca6aabc0
commit d7978a3317
4 changed files with 121 additions and 55 deletions

View file

@ -352,8 +352,10 @@ file(GENERATE OUTPUT linker.ld INPUT linker.ld)
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
include_directories(/usr/local/include/c++/10.2.0/)
else()
include_directories(../Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.3.0/)
include_directories(../Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.3.0/${SERENITY_ARCH}-pc-serenity/)
include_directories(../Toolchain/Local/${SERENITY_ARCH}/Kernel/${SERENITY_ARCH}-pc-serenity/include/c++/10.3.0/)
include_directories(../Toolchain/Local/${SERENITY_ARCH}/Kernel/${SERENITY_ARCH}-pc-serenity/include/c++/10.3.0/${SERENITY_ARCH}-pc-serenity/)
link_directories(../Toolchain/Local/${SERENITY_ARCH}/Kernel/${SERENITY_ARCH}-pc-serenity/lib)
link_directories(../Toolchain/Local/${SERENITY_ARCH}/Kernel/lib/gcc/${SERENITY_ARCH}-pc-serenity/10.3.0/)
endif()
add_executable(Kernel ${SOURCES})