Skip to content

Commit

Permalink
libcxx: Enable static libunwind, cleanup
Browse files Browse the repository at this point in the history
Previously using `static-libgcc` with Clang would fail with an error that `libunwind.a` couldn't be found. This is because we have a static libgcc build, but not a corresponding static libunwind. Ensure that we build said static libunwind.

Signed-off-by: Reilly Brogan <[email protected]>
  • Loading branch information
ReillyBrogan committed Jan 10, 2025
1 parent 7766a6d commit ede4d48
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
Binary file modified l/libcxx/manifest.x86_64.bin
Binary file not shown.
10 changes: 4 additions & 6 deletions l/libcxx/manifest.x86_64.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"libcxx": {
"build-depends": [
"binary(python3)",
"clang-32bit",
"gcc-32bit-devel",
"libcxx-32bit-devel",
"pkgconfig(libxcrypt)",
Expand All @@ -30,15 +29,14 @@
"libcxx-32bit": {
"build-depends": [
"binary(python3)",
"clang-32bit",
"gcc-32bit-devel",
"libcxx-32bit-devel",
"pkgconfig(libxcrypt)",
"pkgconfig32(libxcrypt)"
],
"depends": [
"libcxx",
"soname(libc.so.6(x86))"
"soname(libc.so.6(386))"
],
"files": [
"/usr/lib32/libc++.so.1",
Expand All @@ -58,7 +56,6 @@
"libcxx-32bit-devel": {
"build-depends": [
"binary(python3)",
"clang-32bit",
"gcc-32bit-devel",
"libcxx-32bit-devel",
"pkgconfig(libxcrypt)",
Expand All @@ -73,6 +70,7 @@
"/usr/lib32/libc++abi.a",
"/usr/lib32/libc++abi.so",
"/usr/lib32/libc++experimental.a",
"/usr/lib32/libunwind.a",
"/usr/lib32/libunwind.so",
"/usr/lib32/pkgconfig/libunwind.pc"
],
Expand All @@ -84,7 +82,6 @@
"libcxx-devel": {
"build-depends": [
"binary(python3)",
"clang-32bit",
"gcc-32bit-devel",
"libcxx-32bit-devel",
"pkgconfig(libxcrypt)",
Expand Down Expand Up @@ -1123,6 +1120,7 @@
"/usr/lib/libc++abi.a",
"/usr/lib/libc++abi.so",
"/usr/lib/libc++experimental.a",
"/usr/lib/libunwind.a",
"/usr/lib/libunwind.so",
"/usr/lib/pkgconfig/libunwind.pc"
],
Expand All @@ -1133,6 +1131,6 @@
}
},
"source-name": "libcxx",
"source-release": "9",
"source-release": "10",
"source-version": "18.1.8"
}
41 changes: 24 additions & 17 deletions l/libcxx/stone.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name : libcxx
version : 18.1.8
release : 9
release : 10
summary : Modern C++ standard library
license :
- Apache-2.0 WITH LLVM-exception
Expand All @@ -15,29 +15,29 @@ upstreams :
- https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/llvm-project-18.1.8.src.tar.xz: 0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a
builddeps :
- binary(python3)
- clang-32bit
- gcc-32bit-devel
- libcxx-32bit-devel
- pkgconfig(libxcrypt)
- pkgconfig32(libxcrypt)
- gcc-32bit-devel
- libcxx-32bit-devel
emul32 : yes
tuning :
- lto: full
setup : |
export CFLAGS="$CFLAGS -ffat-lto-objects"
export CXXFLAGS="$CXXFLAGS -ffat-lto-objects"
export LDFLAGS="$LDFLAGS -ffat-lto-objects"
# Context on CMAKE_ vars: https://reviews.llvm.org/D112155#3353869
%cmake -S runtimes \
-DCMAKE_ASM_COMPILER_TARGET=%(build_platform) \
-DCMAKE_CXX_COMPILER_TARGET=%(build_platform) \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_DEFAULT_TARGET_TRIPLE=%(build_platform) \
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
-DLLVM_LIBDIR_SUFFIX=%(libsuffix) \
-DLLVM_USE_SANITIZER=OFF \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_LIBGCC_EXPLICIT_OPT_IN=ON \
-DCOMPILER_RT_USE_LIBCXX=ON \
-DLIBCXX_ENABLE_ASSERTIONS=OFF \
-DLIBCXX_ENABLE_PARALLEL_ALGORITHMS=OFF \
-DLIBCXX_ENABLE_SHARED=ON \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
-DLIBCXX_ENABLE_STATIC=OFF \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
-DLIBCXX_HAS_ATOMIC_LIB=ON \
-DLIBCXX_INSTALL_SUPPORT_HEADERS=ON \
-DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=ON \
Expand All @@ -52,17 +52,24 @@ setup : |
-DLIBUNWIND_INSTALL_HEADERS=ON \
-DLIBUNWIND_INSTALL_LIBRARY=ON \
-DLIBUNWIND_ENABLE_SHARED=ON \
-DLIBUNWIND_ENABLE_STATIC=OFF \
-DLIBUNWIND_ENABLE_STATIC=ON \
-DLIBUNWIND_INSTALL_LIBRARY=ON \
-DLIBUNWIND_USE_COMPILER_RT=ON \
-DLIBUNWIND_LIBDIR_SUFFIX=%(libsuffix) \
-DLIBUNWIND_USE_COMPILER_RT=ON \
-DLLVM_DEFAULT_TARGET_TRIPLE=%(build_platform) \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_LIBDIR_SUFFIX=%(libsuffix) \
-DLLVM_LIBGCC_EXPLICIT_OPT_IN=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DCMAKE_CXX_COMPILER_TARGET=%(build_platform) \
-DCMAKE_ASM_COMPILER_TARGET=%(build_platform)
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF" \
-DLLVM_USE_SANITIZER=OFF \
$cmake_extra_args
build : |
%cmake_build cxx cxxabi unwind
install : |
DESTDIR="%(installroot)" %cmake_build install-cxx install-cxxabi install-unwind
%cmake_install
# Set some support symlinks
echo "INPUT(libc++.so.1)" > "%(installroot)/%(libdir)/libc++abi.so"
Expand Down

0 comments on commit ede4d48

Please sign in to comment.