Skip to content

Commit

Permalink
Everywhere: Fully remove the separate LibPthread directory
Browse files Browse the repository at this point in the history
  • Loading branch information
timschumi authored and linusg committed Jul 19, 2022
1 parent dac361e commit 28061cf
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 16 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ include_directories(Userland/Libraries)
include_directories(Userland/Libraries/LibC)
include_directories(Userland/Libraries/LibCrypt)
include_directories(Userland/Libraries/LibM)
include_directories(Userland/Libraries/LibPthread)
include_directories(Userland/Libraries/LibSystem)
include_directories(Userland/Services)
include_directories(Userland)
Expand Down
1 change: 0 additions & 1 deletion Documentation/UsingQtCreator.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Userland/Services/
Userland/Libraries/
Userland/Libraries/LibC/
Userland/Libraries/LibM/
Userland/Libraries/LibPthread/
Userland/Libraries/LibSystem/
Toolchain/Local/i686/i686-pc-serenity/include/c++/12.1.0
Build/i686/
Expand Down
2 changes: 0 additions & 2 deletions Documentation/VSCodeConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ These extensions can be used as-is, but you need to point them to the custom Ser
"${workspaceFolder}/Userland/Libraries",
"${workspaceFolder}/Userland/Libraries/LibC",
"${workspaceFolder}/Userland/Libraries/LibM",
"${workspaceFolder}/Userland/Libraries/LibPthread",
"${workspaceFolder}/Userland/Services",
"${workspaceFolder}/Toolchain/Local/i686/i686-pc-serenity/include/c++/**"
],
Expand Down Expand Up @@ -77,7 +76,6 @@ These extensions can be used as-is, but you need to point them to the custom Ser
"${workspaceFolder}/Userland/Libraries",
"${workspaceFolder}/Userland/Libraries/LibC",
"${workspaceFolder}/Userland/Libraries/LibM",
"${workspaceFolder}/Userland/Libraries/LibPthread",
"${workspaceFolder}/Userland/Services",
"${workspaceFolder}/Toolchain/Local/i686/i686-pc-serenity/include/c++/**"
],
Expand Down
4 changes: 2 additions & 2 deletions Meta/Azure/Caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ steps:
- ${{ if eq(parameters.toolchain, 'clang') }}:
- task: Cache@2
inputs:
key: '"toolchain" | "x86_64" | Toolchain/BuildClang.sh | Toolchain/Patches/llvm/*.patch | Toolchain/CMake/*.cmake | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h'
key: '"toolchain" | "x86_64" | Toolchain/BuildClang.sh | Toolchain/Patches/llvm/*.patch | Toolchain/CMake/*.cmake | Userland/Libraries/LibC/**/*.h'
path: $(Build.SourcesDirectory)/Toolchain/Cache
displayName: 'Toolchain Prebuilt Cache'
- ${{ if eq(parameters.toolchain, 'gcc') }}:
- task: Cache@2
inputs:
key: '"toolchain" | "${{ parameters.arch }}" | Toolchain/BuildIt.sh | Toolchain/Patches/binutils.patch | Toolchain/Patches/gcc/*.patch | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h'
key: '"toolchain" | "${{ parameters.arch }}" | Toolchain/BuildIt.sh | Toolchain/Patches/binutils.patch | Toolchain/Patches/gcc/*.patch | Userland/Libraries/LibC/**/*.h'
path: $(Build.SourcesDirectory)/Toolchain/Cache
displayName: 'Toolchain Prebuilt Cache'

Expand Down
4 changes: 2 additions & 2 deletions Toolchain/BuildClang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ popd
# === COPY HEADERS ===

SRC_ROOT=$($REALPATH "$DIR"/..)
FILES=$(find "$SRC_ROOT"/Kernel/API "$SRC_ROOT"/Userland/Libraries/LibC "$SRC_ROOT"/Userland/Libraries/LibM "$SRC_ROOT"/Userland/Libraries/LibPthread "$SRC_ROOT"/Userland/Libraries/LibDl -name '*.h' -print)
FILES=$(find "$SRC_ROOT"/Kernel/API "$SRC_ROOT"/Userland/Libraries/LibC "$SRC_ROOT"/Userland/Libraries/LibM "$SRC_ROOT"/Userland/Libraries/LibDl -name '*.h' -print)

for arch in $ARCHS; do
mkdir -p "$BUILD/${arch}clang"
pushd "$BUILD/${arch}clang"
mkdir -p Root/usr/include/
for header in $FILES; do
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@@" -e "s@$SRC_ROOT/Userland/Libraries/LibDl@@" -e "s@$SRC_ROOT/Kernel/@Kernel/@")
target=$(echo "$header" | "$SED" -e "s@$SRC_ROOT/Userland/Libraries/LibC@@" -e "s@$SRC_ROOT/Userland/Libraries/LibM@@" -e "s@$SRC_ROOT/Userland/Libraries/LibDl@@" -e "s@$SRC_ROOT/Kernel/@Kernel/@")
buildstep "system_headers" "$INSTALL" -D "$header" "Root/usr/include/$target"
done
popd
Expand Down
4 changes: 1 addition & 3 deletions Toolchain/BuildIt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ pushd "$DIR/Build/$ARCH"
buildstep "binutils/install" "$MAKE" install || exit 1
popd

echo "XXX serenity libc, libdl, libm and libpthread headers"
echo "XXX serenity libc, libdl and libm headers"
mkdir -p "$BUILD"
pushd "$BUILD"
mkdir -p Root/usr/include/
Expand All @@ -375,15 +375,13 @@ pushd "$DIR/Build/$ARCH"
"$SRC_ROOT"/Userland/Libraries/LibC \
"$SRC_ROOT"/Userland/Libraries/LibDl \
"$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/AK/@AK/@" \
-e "s@$SRC_ROOT/Userland/Libraries/LibC@@" \
-e "s@$SRC_ROOT/Userland/Libraries/LibDl@@" \
-e "s@$SRC_ROOT/Userland/Libraries/LibM@@" \
-e "s@$SRC_ROOT/Userland/Libraries/LibPthread@@" \
-e "s@$SRC_ROOT/Kernel/@Kernel/@")
buildstep "system_headers" $INSTALL -D "$header" "Root/usr/include/$target"
done
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ add_subdirectory(LibMarkdown)
add_subdirectory(LibPCIDB)
add_subdirectory(LibPDF)
add_subdirectory(LibProtocol)
add_subdirectory(LibPthread)
add_subdirectory(LibRegex)
add_subdirectory(LibSanitizer)
add_subdirectory(LibSoftGPU)
Expand Down
5 changes: 5 additions & 0 deletions Userland/Libraries/LibC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,8 @@ target_link_libraries(LibC ssp system LibTimeZone)

# We mark LibCStatic as a dependency of LibC because this triggers the build of the LibCStatic target
add_dependencies(LibC LibM LibSystem LibCStatic)

# Provide a dummy target and a linker script for LibPthread that tells everything to link against LibC instead.
add_library(LibPthread INTERFACE)
target_link_libraries(LibPthread INTERFACE LibC)
file(WRITE "${CMAKE_STAGING_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libpthread.so" "INPUT(libc.so)")
4 changes: 0 additions & 4 deletions Userland/Libraries/LibPthread/CMakeLists.txt

This file was deleted.

0 comments on commit 28061cf

Please sign in to comment.