diff --git a/CMakeLists.txt b/CMakeLists.txt index 9597154ac3..4984c52f91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,12 @@ add_custom_target(toolchain USES_TERMINAL ) +add_custom_target(libstdc++ + COMMAND ${CMAKE_COMMAND} -E env LIBSTDCPP="1" ${CMAKE_SOURCE_DIR}/toolchain/build.sh + DEPENDS libc-install + USES_TERMINAL +) + add_custom_target(image COMMAND ${CMAKE_COMMAND} -E env SYSROOT="${BANAN_SYSROOT}" DISK_IMAGE_PATH="${DISK_IMAGE_PATH}" ${CMAKE_SOURCE_DIR}/image.sh DEPENDS kernel-install diff --git a/toolchain/build.sh b/toolchain/build.sh index 6cdae7da50..5524bb22ff 100755 --- a/toolchain/build.sh +++ b/toolchain/build.sh @@ -6,6 +6,13 @@ GCC_VERSION="gcc-12.2.0" cd $(dirname "$0") +if [[ -n $LIBSTDCPP ]]; then + cd build/${GCC_VERSION}/ + make -j $(nproc) all-target-libstdc++-v3 + make install-target-libstdc++-v3 + exit 0 +fi + if [[ -z $SYSROOT ]]; then echo "You must set the SYSROOT environment variable" >&2 exit 1 diff --git a/userspace/CMakeLists.txt b/userspace/CMakeLists.txt index e4a65c6984..0138f20e0b 100644 --- a/userspace/CMakeLists.txt +++ b/userspace/CMakeLists.txt @@ -17,7 +17,6 @@ add_custom_target(userspace) add_custom_target(userspace-install DEPENDS userspace) foreach(USERSPACE_PROJECT ${USERSPACE_PROJECTS}) - target_link_options(${USERSPACE_PROJECT} PUBLIC -nodefaultlibs) add_dependencies(userspace ${USERSPACE_PROJECT}) add_dependencies(userspace-install ${USERSPACE_PROJECT}-install) endforeach()