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

Toolchain+Ports: Enable threads for gcc

This enables POSIX threads for GCC and makes the -pthread
argument available.
This commit is contained in:
Gunnar Beutner 2021-04-18 08:34:26 +02:00 committed by Andreas Kling
parent 7400e3d8fc
commit 75d41657d5
5 changed files with 101 additions and 19 deletions

View file

@ -239,14 +239,14 @@ pushd "$DIR/Build/$ARCH"
buildstep "binutils/install" "$MAKE" install || exit 1
popd
echo "XXX serenity libc and libm headers"
echo "XXX serenity libc, libm and libpthread headers"
mkdir -p "$BUILD"
pushd "$BUILD"
mkdir -p Root/usr/include/
SRC_ROOT=$($REALPATH "$DIR"/..)
FILES=$(find "$SRC_ROOT"/Userland/Libraries/LibC "$SRC_ROOT"/Userland/Libraries/LibM -name '*.h' -print)
FILES=$(find "$SRC_ROOT"/Userland/Libraries/LibC "$SRC_ROOT"/Userland/Libraries/LibM "$SRC_ROOT"/Userland/Libraries/LibPthread -name '*.h' -print)
for header in $FILES; do
target=$(echo "$header" | sed -e "s@$SRC_ROOT/Userland/Libraries/LibC@@" -e "s@$SRC_ROOT/Userland/Libraries/LibM@@")
target=$(echo "$header" | sed -e "s@$SRC_ROOT/Userland/Libraries/LibC@@" -e "s@$SRC_ROOT/Userland/Libraries/LibM@@" -e "s@$SRC_ROOT/Userland/Libraries/LibPthread@@")
buildstep "system_headers" $INSTALL -D "$header" "Root/usr/include/$target"
done
unset SRC_ROOT
@ -289,6 +289,7 @@ pushd "$DIR/Build/$ARCH"
--enable-languages=c,c++ \
--enable-default-pie \
--enable-lto \
--enable-threads=posix \
${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
if [ "$STAGE" = "Userland" ]; then