From: Calandracas606 <Calandracas606@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Llvm17 fix compiler-rt, add liblldb17
Date: Mon, 26 Feb 2024 22:14:41 +0100 [thread overview]
Message-ID: <20240226211441.1BD952889D@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48679@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
There is an updated pull request by Calandracas606 against master on the void-packages repository
https://github.com/Calandracas606/void-packages llvm17-fix-compiler-cross
https://github.com/void-linux/void-packages/pull/48679
Llvm17 fix compiler-rt, add liblldb17
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64 (cross)
[ci skip]
A patch file from https://github.com/void-linux/void-packages/pull/48679.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-fix-compiler-cross-48679.patch --]
[-- Type: text/x-diff, Size: 9976 bytes --]
From 3abb07409eb6c05747f35bc83049a0b9dcdf0fd9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Mon, 12 Feb 2024 16:47:24 -0500
Subject: [PATCH 1/3] llvm17: cross compile compiler-rt properly, add liblldb17
---
common/shlibs | 2 +-
srcpkgs/compiler-rt17 | 1 +
srcpkgs/liblldb17 | 1 +
srcpkgs/llvm17/template | 90 ++++++++++++++++++++++++-----------------
srcpkgs/llvm17/update | 2 +-
5 files changed, 58 insertions(+), 38 deletions(-)
create mode 120000 srcpkgs/compiler-rt17
create mode 120000 srcpkgs/liblldb17
diff --git a/common/shlibs b/common/shlibs
index 363b157bd5fc9c..ad0068090b7a90 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,7 +982,7 @@ libuchardet.so.0 uchardet-0.0.6_1
libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
libyajl.so.2 yajl-2.0.1_1
libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.17 lldb17-17.0.6_1
+liblldb.so.17 liblldb17-17.0.6_3
liblldb.so.15 lldb15-15.0.7_4
libclang.so.17 libclang17-17.0.6_1
libclang.so.15 libclang15-15.0.7_4
diff --git a/srcpkgs/compiler-rt17 b/srcpkgs/compiler-rt17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/compiler-rt17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/liblldb17 b/srcpkgs/liblldb17
new file mode 120000
index 00000000000000..96970d5c02c13a
--- /dev/null
+++ b/srcpkgs/liblldb17
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index de5603085382c1..c2e5736f5ac449 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -1,11 +1,10 @@
# Template file for 'llvm17'
pkgname=llvm17
version=17.0.6
-revision=2
+revision=3
build_wrksrc=llvm
build_style=cmake
_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
-pycompile_dirs="usr/share/scan-view"
configure_args="
-DCMAKE_BUILD_TYPE=Release -Wno-dev
-DENABLE_LINKER_BUILD_ID=YES
@@ -45,11 +44,17 @@ checksum=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
lib32disabled=yes
python_version=3
-build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt"
-build_options_default="clang clang_tools_extra lld mlir libclc polly lldb"
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb openmp"
+if [ "$XBPS_TARGET_WORDSIZE" = "64" ]; then
+ build_options_default+=" flang bolt"
+fi
+
+# build fails because compiler_rt generates armv7 instructions when target is armv6
case "$XBPS_TARGET_MACHINE" in
- x86_64*|aarch64*) build_options_default+=" flang bolt ";;
+ armv6*) ;;
+ *) configure_args+=" -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" ;;
esac
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -58,8 +63,9 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
fi
subpackages="libllvm17 llvm17-doc llvm17-devel"
-_enabled_projects=
-_enabled_runtimes=
+
+# use $(:) to silence xlint
+_enabled_projects=$(:)
if [ "$build_option_clang" ]; then
_enabled_projects+="clang;"
@@ -78,7 +84,7 @@ if [ "$build_option_polly" ]; then
fi
if [ "$build_option_lldb" ]; then
_enabled_projects+="lldb;"
- subpackages+=" lldb17 lldb17-devel "
+ subpackages+=" lldb17 lldb17-devel liblldb17 "
fi
if [ "$build_option_lld" ]; then
_enabled_projects+="lld;"
@@ -96,42 +102,37 @@ if [ "$build_option_flang" ]; then
subpackages+=" flang17 flang17-devel "
fi
+subpackages+=" compiler-rt17 "
+_enabled_runtimes="compiler-rt"
+
# enable if runtime subpackages link to this version of llvm
if true; then
subpackages+=" llvm-libunwind llvm-libunwind-devel "
- _enabled_runtimes+="${_enabled_runtimes:+;}libunwind"
+ _enabled_runtimes+=";libunwind"
subpackages+=" libcxx libcxx-devel libcxxabi libcxxabi-devel "
- _enabled_runtimes+="${_enabled_runtimes:+;}libcxxabi;libcxx"
+ _enabled_runtimes+=";libcxxabi;libcxx"
- subpackages+=" compiler-rt "
- _enabled_runtimes+="${_enabled_runtimes:+;}compiler-rt"
- case "$XBPS_TARGET_MACHINE" in
- x86_64*|aarch64*)
- # openmp fails when built as runtime if cross-compiled
- if [ "$CROSS_BUILD" ]; then
- _enabled_projects+="openmp;"
- else
- _enabled_runtimes+="${_enabled_runtimes:+;}openmp"
- fi
- subpackages+=" libomp libomp-devel "
- ;;
- esac
+ if [ "$build_option_openmp" ]; then
+ # openmp fails when built as runtime if cross-compiled
+ if [ "$CROSS_BUILD" ]; then
+ _enabled_projects+="openmp;"
+ else
+ _enabled_runtimes+=";openmp"
+ fi
+ subpackages+=" libomp libomp-devel "
+ fi
- configure_args+=" -DLLVM_ENABLE_RUNTIMES=${_enabled_runtimes}"
fi
+configure_args+=" -DLLVM_ENABLE_RUNTIMES=${_enabled_runtimes}"
configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" llvm17-cross-tools"
- # Seems to require a full host llvm/clang build
- configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
- configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
fi
-
# For OCaml bindings and lldb lua scripting
if [ -z "$CROSS_BUILD" ]; then
subpackages+=" llvm17-cross-tools"
@@ -312,6 +313,8 @@ clang17_package() {
vmove usr/bin/diagtool
vmove usr/bin/amdgpu-arch
vmove usr/bin/nvptx-arch
+ vmove usr/bin/hmaptool
+ vmove usr/bin/git-clang-format
vmove usr/share/man/man1/clang.1
vmove usr/share/man/man1/diagtool.1
if [ "$build_option_polly" ]; then
@@ -348,8 +351,6 @@ clang17-devel_package() {
vmove "usr/lib/libclang*.a"
vmove "usr/lib/libclang*.so"
vmove usr/share/clang
- vmove usr/bin/hmaptool
- vmove usr/bin/git-clang-format
if [ "$build_option_clang_tools_extra" ]; then
vmove usr/include/clang-tidy
vmove usr/lib/libfindAllSymbols.a
@@ -382,6 +383,7 @@ clang-analyzer17_package() {
depends="clang17>=${version}_${revision} python3 perl"
short_desc+=" - A source code analysis framework"
homepage="https://clang-analyzer.llvm.org/"
+ pycompile_dirs="usr/share/scan-view"
pkg_install() {
vmove usr/share/scan-view
vmove usr/share/scan-build
@@ -456,7 +458,6 @@ lldb17_package() {
vmove usr/bin/lldb-instr
vmove usr/bin/lldb-server
vmove usr/bin/lldb-vscode
- vmove "usr/lib/liblldb*.so.*"
vmove "usr/lib/python${py3_ver}/site-packages/lldb"
if [ -z "$CROSS_BUILD" ]; then
vmove /usr/lib/lua/5.3/lldb.so
@@ -474,6 +475,14 @@ lldb17-devel_package() {
}
}
+liblldb17_package() {
+ lib32disabled=yes
+ short_desc+=" - LLDB debugger - runtime library"
+ pkg_install() {
+ vmove "usr/lib/liblldb*.so.*"
+ }
+}
+
lld17_package() {
lib32disabled=yes
short_desc+=" - linker"
@@ -576,17 +585,26 @@ libomp-devel_package() {
short_desc+=" - Clang OpenMP support library - development files"
depends="libomp>=${version}_${revision} llvm17>=${version}_${revision}"
pkg_install() {
- vmove usr/bin/llvm-omp-device-info
- vmove usr/bin/llvm-omp-kernel-replay
- vmove "usr/lib/libarcher*.so"
+ if [ -f "${DESTDIR}/usr/bin/llvm-omp-device-info" ]; then
+ vmove usr/bin/llvm-omp-device-info
+ fi
+ if [ -f "${DESTDIR}/usr/bin/llvm-omp-kernel-replay" ]; then
+ vmove usr/bin/llvm-omp-kernel-replay
+ fi
+ if [ -f "${DESTDIR}/usr/lib/libarcher.so" ]; then
+ vmove "usr/lib/libarcher*.so"
+ fi
+ if [ -f "${DESTDIR}/usr/lib/libarcher_static.a" ]; then
+ vmove "usr/lib/libarcher*.a"
+ fi
vmove "usr/lib/libomp*.so"
vmove usr/lib/cmake/openmp
if [ -f "${DESTDIR}/usr/share/man/man1/llvmopenmp.1" ]; then
vmove usr/share/man/man1/llvmopenmp.1
fi
+
if [ -z "$CROSS_BUILD" ]; then
vmove "usr/lib/libomptarget*.bc"
- vmove "usr/lib/libarcher*.a"
vmove "usr/lib/libomp*.a"
fi
}
@@ -654,7 +672,7 @@ libcxx-devel_package() {
}
}
-compiler-rt_package() {
+compiler-rt17_package() {
short_desc+=" - runtime libraries"
homepage="https://compiler-rt.llvm.org/"
pkg_install() {
diff --git a/srcpkgs/llvm17/update b/srcpkgs/llvm17/update
index e95cf26b3586b7..cc8edb6c005acb 100644
--- a/srcpkgs/llvm17/update
+++ b/srcpkgs/llvm17/update
@@ -1,3 +1,3 @@
site="https://github.com/llvm/llvm-project/releases"
-pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+pattern="llvmorg-\K(17)\.(\d+)\.+\d+(-rc\d+)?"
ignore="*-rc*"
From e959b16d6a44ad79922a02119b130381ff382598 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Mon, 12 Feb 2024 16:47:51 -0500
Subject: [PATCH 2/3] llvm: add compiler-rt meta-package
---
srcpkgs/compiler-rt | 2 +-
srcpkgs/llvm/template | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/compiler-rt b/srcpkgs/compiler-rt
index 96970d5c02c13a..0d68131b9b3088 120000
--- a/srcpkgs/compiler-rt
+++ b/srcpkgs/compiler-rt
@@ -1 +1 @@
-llvm17
\ No newline at end of file
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index b27a80da2fee1e..bfa7da4ab48684 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,7 +1,7 @@
# Template file for 'llvm'
pkgname=llvm
version=17
-revision=2
+revision=3
build_style=meta
depends="llvm${version}"
short_desc="LLVM meta package"
@@ -57,3 +57,9 @@ libllvm_package() {
depends="libllvm${version}>=0"
short_desc+=" - transitional meta package"
}
+
+compiler-rt_package() {
+ build_style=meta
+ depends="compiler-rt${version}>=0"
+ short_desc+=" - transitional meta package"
+}
From af466bc71a50e15bc08303e1aac76e8b0934be0c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Wed, 14 Feb 2024 11:41:33 -0500
Subject: [PATCH 3/3] llvm15: fix update file
---
srcpkgs/llvm15/update | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
index e95cf26b3586b7..baa6a6b6acf9a7 100644
--- a/srcpkgs/llvm15/update
+++ b/srcpkgs/llvm15/update
@@ -1,3 +1,3 @@
site="https://github.com/llvm/llvm-project/releases"
-pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+pattern="llvmorg-\K(15)\.(\d+)\.+\d+(-rc\d+)?"
ignore="*-rc*"
next prev parent reply other threads:[~2024-02-26 21:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 21:51 [PR PATCH] Llvm17 fix compiler cross Calandracas606
2024-02-12 21:59 ` [PR PATCH] [Updated] Llvm17 fix compiler-rt, add liblldb17 Calandracas606
2024-02-12 22:47 ` [PR REVIEW] " classabbyamp
2024-02-13 3:05 ` [PR PATCH] [Updated] " Calandracas606
2024-02-13 11:26 ` [PR REVIEW] " leahneukirchen
2024-02-14 16:44 ` [PR PATCH] [Updated] " Calandracas606
2024-02-26 16:57 ` Calandracas606
2024-02-26 17:07 ` Calandracas606
2024-02-26 19:33 ` Calandracas606
2024-02-26 21:14 ` Calandracas606 [this message]
2024-02-26 21:57 ` [PR REVIEW] " Johnnynator
2024-02-26 23:47 ` Calandracas606
2024-02-27 20:25 ` Johnnynator
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240226211441.1BD952889D@inbox.vuxu.org \
--to=calandracas606@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).