From 4361a502255e409f04c9325ef73f3cd10f9cafdb Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 16 May 2020 14:05:35 -0600 Subject: [PATCH] AK: Don't demangle in serenity :( In order to remove libstdc++ completely, we need to give up on their implementation of abi::__cxa_demangle. The demangler logic will actually have to be quite complex, and included in both the kernel and userspace. A definite fixme for the future, to parse the mangled names into real deal names. --- AK/Demangle.h | 5 +++-- Toolchain/BuildIt.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AK/Demangle.h b/AK/Demangle.h index 42dc1cdae4..b377556e4b 100644 --- a/AK/Demangle.h +++ b/AK/Demangle.h @@ -29,7 +29,7 @@ #include #include -#ifndef BUILDING_SERENITY_TOOLCHAIN +#ifndef __serenity__ # include #endif @@ -37,9 +37,10 @@ namespace AK { inline String demangle(const StringView& name) { -#ifdef BUILDING_SERENITY_TOOLCHAIN +#ifdef __serenity__ return name; #else + // FIXME: Implement __cxa_demangle in serenity int status = 0; auto* demangled_name = abi::__cxa_demangle(name.to_string().characters(), nullptr, nullptr, &status); auto string = String(status == 0 ? demangled_name : name); diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh index d55dfd58ae..ab499897c4 100755 --- a/Toolchain/BuildIt.sh +++ b/Toolchain/BuildIt.sh @@ -228,7 +228,7 @@ pushd "$DIR/Build/" echo "XXX serenity libc and libm" mkdir -p "$BUILD" pushd "$BUILD" - CXXFLAGS="-DBUILDING_SERENITY_TOOLCHAIN" cmake .. + cmake .. "$MAKE" LibC install -D Libraries/LibC/libc.a Libraries/LibM/libm.a Root/usr/lib/ SRC_ROOT=$(realpath "$DIR"/..)