Enable hosted libstdc++ for i586 & riscv64gc with workaround

This commit is contained in:
Wildan M 2026-02-22 14:30:57 +07:00
parent 7c1132a728
commit dcc12a361a
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
2 changed files with 7 additions and 6 deletions

View File

@ -228,7 +228,7 @@ else
cp -r "$(PREFIX)/libtool-install/". "$@.partial"
@#TODO: how to make this not conflict with libc?
rm -f "$@.partial/lib/gcc/$(GNU_TARGET)/13.2.0/include/limits.h"
# libgcc and bare features of libstdcxx
# libgcc and freestanding libstdcxx
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
$(MAKE) -C "$(ROOT)/$(GCC_TARGET)/build" all-target-libgcc all-target-libstdc++-v3 && \
$(MAKE) -C "$(ROOT)/$(GCC_TARGET)/build" install-target-libgcc install-target-libstdc++-v3 DESTDIR="$(ROOT)/$@-build.partial/usr"
@ -239,15 +239,11 @@ else
@#TODO: generates wrong lib path for libtool
rm -f "$@.partial"/$(GNU_TARGET)/lib/libstdc++.la
rm -f "$@.partial"/$(GNU_TARGET)/lib/libsupc++.la
# fully featured libstdcxx, not supported for targets only supporting static linking
ifneq ($(TARGET),riscv64gc-unknown-redox)
ifneq ($(TARGET),i586-unknown-redox)
# hosted libstdcxx
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
export $(PREFIX_CONFIG) "COOKBOOK_HOST_SYSROOT=$(ROOT)/$@.partial" COOKBOOK_CROSS_TARGET=$(HOST_TARGET) && \
rm -rf "$(LIBSTDCXX_TARGET)/stage" && ./target/release/repo cook libstdcxx-v3
cp -r "$(LIBSTDCXX_TARGET)/stage/usr/". "$@.partial/$(GNU_TARGET)"
endif
endif
rm -rf "$@-build.partial"
touch "$@.partial"
mv "$@.partial" "$@"

View File

@ -11,6 +11,11 @@ COOKBOOK_CONFIGURE_FLAGS+=(
--enable-libstdcxx-threads
)
# TODO: Investigate why mutex is not available in riscv64
if [ "${TARGET}" = "riscv64gc-unknown-redox" ]; then
COOKBOOK_CONFIGURE_FLAGS+=( --without-libstdcxx-zoneinfo )
fi
CPPINCLUDE="${COOKBOOK_HOST_SYSROOT}/$TARGET/include/c++/13.2.0"
export CPPFLAGS+=" -I${CPPINCLUDE} -I${CPPINCLUDE}/$TARGET/bits"
COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/libstdc++-v3/configure"