aboutsummaryrefslogtreecommitdiffstats
path: root/community/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'community/lldb')
-rw-r--r--community/lldb/APKBUILD113
-rw-r--r--community/lldb/atomic.patch21
-rw-r--r--community/lldb/fix-embedded_interpreter.patch2
3 files changed, 95 insertions, 41 deletions
diff --git a/community/lldb/APKBUILD b/community/lldb/APKBUILD
index 9d6d1a88889..2e4714fb425 100644
--- a/community/lldb/APKBUILD
+++ b/community/lldb/APKBUILD
@@ -1,77 +1,110 @@
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>
-# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
+# Contributor: Rasmus Thomsen <oss@cogitri.dev>
+# Maintainer:
pkgname=lldb
# Note: Update together with llvm.
-pkgver=10.0.1
+pkgver=17.0.6
pkgrel=0
-_vermajor=${pkgver%%.*}
+_llvmver=${pkgver%%.*}
pkgdesc="Next generation, high-performance debugger"
-arch="aarch64 armv7 s390x x86_64"
+# riscv64: https://github.com/llvm/llvm-project/issues/55383
+arch="all !riscv64"
url="https://llvm.org/"
license="Apache-2.0"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
- clang-dev>=$_vermajor
- clang-static>=$_vermajor
+ clang-dev>=$_llvmver
+ clang-static>=$_llvmver
cmake
doxygen
+ gtest-dev
libedit-dev
libffi-dev
libxml2-dev
linux-headers
- llvm-dev>=$_vermajor
- llvm-static>=$_vermajor
+ llvm$_llvmver-dev
+ llvm$_llvmver-gtest
+ llvm$_llvmver-static
ncurses-dev
- ninja
+ py3-sphinx
python3-dev
+ samurai
swig
+ xz
"
-subpackages="$pkgname-dev py3-$pkgname:py3"
-source="https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/lldb-$pkgver.src.tar.xz
+subpackages="$pkgname-dev $pkgname-doc py3-$pkgname-pyc py3-$pkgname:py3"
+source="https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver//_/-}/lldb-${pkgver//_/}.src.tar.xz
+ https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver//_/-}/cmake-${pkgver//_/}.src.tar.xz
+ atomic.patch
fix-embedded_interpreter.patch
"
-builddir="$srcdir/$pkgname-$pkgver.src"
+builddir="$srcdir/$pkgname-${pkgver//_/}.src"
+options="!check" # FIXME: enable tests
+
+prepare() {
+ default_prepare
+ mv "$srcdir"/cmake-${pkgver//_/}.src "$srcdir"/cmake
+}
build() {
- mkdir -p "$builddir"/build
- cd "$builddir"/build
+ export CC=clang
+ export CXX=clang++
- CC=clang CXX=clang++ cmake .. -G Ninja -Wno-dev \
- -DCMAKE_BUILD_TYPE=MinSizeRel \
- -DCMAKE_C_FLAGS_MINSIZEREL_INIT="$CFLAGS" \
- -DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="$CXXFLAGS" \
- -DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT="$LDFLAGS" \
+ case "$CARCH" in
+ arm*)
+ # binutils bugs
+ ;;
+ *)
+ export CFLAGS="$CFLAGS -flto"
+ export CXXFLAGS="$CXXFLAGS -flto"
+ ;;
+ esac
+
+ cmake -B build -G Ninja -Wno-dev \
+ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DLLDB_BUILT_STANDALONE=ON \
+ -DLLDB_INCLUDE_TESTS="$(want_check && echo ON || echo OFF)" \
+ -DLLVM_ENABLE_SPHINX=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
- -DLLDB_DISABLE_LIBEDIT=ON \
- -DLLDB_TEST_C_COMPILER=clang \
- -DLLDB_TEST_CXX_COMPILER=clang++ \
- -DPYTHON_EXECUTABLE=/usr/bin/python3
- ninja
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+
+ cmake --build build --target all docs-lldb-man
+}
+
+check() {
+ ninja -C build check-lldb
}
package() {
- cd "$builddir"/build
+ # backtracing/debugging pretty much anything is going to need libc debug symbols
+ # not everything, but the common case needs this, and it's a small dep in comparison
+ depends="musl-dbg"
- DESTDIR="$pkgdir" ninja install
+ DESTDIR="$pkgdir" cmake --install build
+ install -Dm644 build/docs/man/lldb.1 -t "$pkgdir"/usr/share/man/man1
+ python3 -m compileall -fq "$pkgdir"/usr/lib/python3*
+}
+
+dev() {
+ default_dev
+
+ # move back main symlink, because py3-lldb links to it
+ mv "$subpkgdir"/usr/lib/liblldb.so "$pkgdir"/usr/lib/
}
py3() {
pkgdesc="Python3 module for LLDB"
- depends="$pkgname python3 py3-six"
+ depends="$pkgname=$pkgver-r$pkgrel python3"
replaces="py-lldb"
- local sitedir=$(python3 -c "import site; print(site.getsitepackages()[0])")
-
- mkdir -p "$subpkgdir"/$sitedir
-
- mv "$pkgdir"/"$sitedir"/* "$subpkgdir"/"$sitedir"
- rm -rf "$pkgdir"/"$sitedir"
-
- # Remove bundled module.
- rm "$subpkgdir"/"$sitedir"/six.py
-
- python3 -m compileall -fq "$subpkgdir"/"$sitedir"
+ amove usr/lib/python3.*
}
-sha512sums="d7155cd6a7e2244cbf1f6114d790fdf2e667fd6285e2fc3a08a8f49c8e08f32827d7fa83d741ea0b54b788bd13c0c7498cf312a2cd3e86e049606869341b482e lldb-10.0.1.src.tar.xz
-3c611fa5d45b6cb3f2925a31deeb8a34c295277aedcd55c22851d373897acd376fa92f4ef953c96a25c8dae4c93b6a88de0918550672141d324a3813d8283d48 fix-embedded_interpreter.patch"
+sha512sums="
+80b327c89b160b1dcdbea1946a7c69514e797056629c0a7501c77e7557d6bb3a7ae6ecdd0d760d072b1f7c3f5b136838f76c8d75522cd84622a03b1b25ba6e6c lldb-17.0.6.src.tar.xz
+b2c5e404ca36542d44e1a7f2801bbcecbcf5f1e8c63b793bb2308228483406bdfe002720aadb913c0228cd2bbe5998465eaadc4a49fad6a5eb6ff907fa5fd45a cmake-17.0.6.src.tar.xz
+6493c9bbcaf3f99ffbb56967147716bc93aa13b6c525214abc22723162bf42d6c25663ed1e2e11f432a8c1b246a528149e240eae027ce752bc20cc928ed57272 atomic.patch
+fcd3f06b5f901d635bfe8edffa3951d5af402738ee55b13a98c992725eb35db17b7a3ca566eb94d48cd699be899f7402ae41da0d2f1ed4611afc5858a0eec561 fix-embedded_interpreter.patch
+"
diff --git a/community/lldb/atomic.patch b/community/lldb/atomic.patch
new file mode 100644
index 00000000000..436cb207643
--- /dev/null
+++ b/community/lldb/atomic.patch
@@ -0,0 +1,21 @@
+the check for having atomics checks only load, but apparently store needs
+-latomic while load doesn't
+
+diff --git a/source/Utility/CMakeLists.txt b/source/Utility/CMakeLists.txt
+index cc0bf5f..26bf8b0 100644
+--- a/source/Utility/CMakeLists.txt
++++ b/source/Utility/CMakeLists.txt
+@@ -19,9 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+ list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4)
+ endif ()
+
+-if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
+- list(APPEND LLDB_SYSTEM_LIBS atomic)
+-endif()
++# if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
++# list(APPEND LLDB_SYSTEM_LIBS atomic)
++# endif()
++list(APPEND LLDB_SYSTEM_LIBS atomic)
+
+ add_lldb_library(lldbUtility
+ ArchSpec.cpp
diff --git a/community/lldb/fix-embedded_interpreter.patch b/community/lldb/fix-embedded_interpreter.patch
index 599e30a440b..86fc5a68b4f 100644
--- a/community/lldb/fix-embedded_interpreter.patch
+++ b/community/lldb/fix-embedded_interpreter.patch
@@ -6,7 +6,7 @@ This is based on Fedora package.
--- a/source/Interpreter/embedded_interpreter.py
+++ b/source/Interpreter/embedded_interpreter.py
@@ -1,4 +1,6 @@
- import sys
+ import sys
+sys.path.insert(1, '%{python_sitearch}/lldb')
+
if sys.version_info[0] < 3: