mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 00:19:27 +00:00
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.
This commit is contained in:
parent
aff594f1e7
commit
4361a50225
|
@ -29,7 +29,7 @@
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <AK/StringView.h>
|
#include <AK/StringView.h>
|
||||||
|
|
||||||
#ifndef BUILDING_SERENITY_TOOLCHAIN
|
#ifndef __serenity__
|
||||||
# include <cxxabi.h>
|
# include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -37,9 +37,10 @@ namespace AK {
|
||||||
|
|
||||||
inline String demangle(const StringView& name)
|
inline String demangle(const StringView& name)
|
||||||
{
|
{
|
||||||
#ifdef BUILDING_SERENITY_TOOLCHAIN
|
#ifdef __serenity__
|
||||||
return name;
|
return name;
|
||||||
#else
|
#else
|
||||||
|
// FIXME: Implement __cxa_demangle in serenity
|
||||||
int status = 0;
|
int status = 0;
|
||||||
auto* demangled_name = abi::__cxa_demangle(name.to_string().characters(), nullptr, nullptr, &status);
|
auto* demangled_name = abi::__cxa_demangle(name.to_string().characters(), nullptr, nullptr, &status);
|
||||||
auto string = String(status == 0 ? demangled_name : name);
|
auto string = String(status == 0 ? demangled_name : name);
|
||||||
|
|
|
@ -228,7 +228,7 @@ pushd "$DIR/Build/"
|
||||||
echo "XXX serenity libc and libm"
|
echo "XXX serenity libc and libm"
|
||||||
mkdir -p "$BUILD"
|
mkdir -p "$BUILD"
|
||||||
pushd "$BUILD"
|
pushd "$BUILD"
|
||||||
CXXFLAGS="-DBUILDING_SERENITY_TOOLCHAIN" cmake ..
|
cmake ..
|
||||||
"$MAKE" LibC
|
"$MAKE" LibC
|
||||||
install -D Libraries/LibC/libc.a Libraries/LibM/libm.a Root/usr/lib/
|
install -D Libraries/LibC/libc.a Libraries/LibM/libm.a Root/usr/lib/
|
||||||
SRC_ROOT=$(realpath "$DIR"/..)
|
SRC_ROOT=$(realpath "$DIR"/..)
|
||||||
|
|
Loading…
Reference in a new issue