Github messages for voidlinux
 help / color / mirror / Atom feed
From: Calandracas606 <Calandracas606@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] llvm17: fixup and refactor
Date: Fri, 09 Feb 2024 19:30:23 +0100	[thread overview]
Message-ID: <20240209183023.417B62483B@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48625@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages llvm17-fixup
https://github.com/void-linux/void-packages/pull/48625

llvm17: fixup and refactor
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### 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

[ci skip]


A patch file from https://github.com/void-linux/void-packages/pull/48625.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm17-fixup-48625.patch --]
[-- Type: text/x-diff, Size: 11371 bytes --]

From d6368cbf5bd0b650c5e83bd3802a3108e4d531db Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 9 Feb 2024 09:20:48 -0500
Subject: [PATCH 1/2] llvm17: fixup and refactor

---
 srcpkgs/clang17-headers    |   1 +
 srcpkgs/compiler-rt        |   1 +
 srcpkgs/llvm17-cross-tools |   1 +
 srcpkgs/llvm17/template    | 126 ++++++++++++++++++++++++-------------
 4 files changed, 84 insertions(+), 45 deletions(-)
 create mode 120000 srcpkgs/clang17-headers
 create mode 120000 srcpkgs/compiler-rt
 create mode 120000 srcpkgs/llvm17-cross-tools

diff --git a/srcpkgs/clang17-headers b/srcpkgs/clang17-headers
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/clang17-headers
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/compiler-rt b/srcpkgs/compiler-rt
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/compiler-rt
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17-cross-tools b/srcpkgs/llvm17-cross-tools
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-cross-tools
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 7bc22ec50272e..743c9e58ecb99 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -1,7 +1,7 @@
 # Template file for 'llvm17'
 pkgname=llvm17
 version=17.0.6
-revision=1
+revision=2
 build_wrksrc=llvm
 build_style=cmake
 _ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
@@ -26,7 +26,6 @@ configure_args="
  -DCLANG_LINK_CLANG_DYLIB=YES
  -DLLVM_ENABLE_RTTI=YES
  -DLLVM_ENABLE_FFI=YES
- -DLLVM_ENABLE_RUNTIMES=all
  -DLLVM_BINUTILS_INCDIR=/usr/include
  -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
  -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
@@ -62,9 +61,12 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
 fi
 
+subpackages+="  libllvm17 llvm17-doc llvm17-devel "
+
+_enabled_projects=""
 if [ "$build_option_clang" ]; then
 	_enabled_projects+="clang;"
-	subpackages+=" clang17 clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
+	subpackages+=" clang17 clang17-headers clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
 fi
 if [ "$build_option_clang_tools_extra" ]; then
 	_enabled_projects+="clang-tools-extra;"
@@ -100,11 +102,26 @@ if [ "$build_option_openmp" ]; then
 	_enabled_projects+="openmp;"
 	subpackages+=" libomp libomp-devel "
 fi
-subpackages+=" llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel libcxxabi libcxxabi-devel libllvm17 llvm17-doc llvm17-devel "
+
+_enabled_runtimes=
+if [ 1 ]; then
+       subpackages+=" llvm-libunwind llvm-libunwind-devel "
+       _enabled_runtimes+="${_enabled_runtimes:+;}libunwind"
+fi
+if [ 1 ]; then
+       subpackages+=" libcxx libcxx-devel libcxxabi libcxxabi-devel "
+       _enabled_runtimes+="${_enabled_runtimes:+;}libcxxabi;libcxx"
+fi
+if [ 1 ]; then
+       subpackages+=" compiler-rt "
+       _enabled_runtimes+="${_enabled_runtimes:+;}compiler-rt"
+fi
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+configure_args+=" -DLLVM_ENABLE_RUNTIMES=${_enabled_runtimes}"
 
 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"
@@ -113,6 +130,7 @@ fi
 
 # For OCaml bindings and lldb lua scripting
 if [ -z "$CROSS_BUILD" ]; then
+	subpackages+=" llvm17-cross-tools"
 	# OCaml cross build is broken
 	hostmakedepends+=" ocaml ocaml-findlib "
 	# lldb cross build fails with lua
@@ -170,37 +188,16 @@ pre_configure() {
 	esac
 
 	if [ "$CROSS_BUILD" ]; then
-		msg_normal "Building host tblgen\n"
-		mkdir -p build/HOST
-		cd build/HOST
-		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
-			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
-
-		make ${makejobs} -C utils/TableGen
-		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
-
-		make ${makejobs} -C tools/clang/utils/TableGen
-		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-
-		make ${makejobs} -C tools/mlir/tools/mlir-pdll
-		configure_args+=" -DMLIR_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-tblgen"
-		configure_args+=" -DMLIR_PDLL_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/mlir-pdll"
-		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=${wrksrc}/llvm/build/HOST/bin/mlir-linalg-ods-yaml-gen"
-
-		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
-		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
-		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
-		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
-
-		make ${makejobs} -C tools/llvm-config
-		configure_args+=" -DLLVM_CONFIG_PATH=${wrksrc}/llvm/build/HOST/bin/llvm-config"
-
-		make ${makejobs} -C tools/lldb/utils/TableGen lldb-tblgen
-		configure_args+=" -DLLDB_TABLEGEN_EXE=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
-
-		cd ../..
+		configure_args+=" -DLLVM_NATIVE_TOOL_DIR=/usr/bin"
+		configure_args+=" -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=/usr/bin/clang-tblgen"
+		configure_args+=" -DMLIR_TABLEGEN=/usr/bin/mlir-tblgen"
+		configure_args+=" -DMLIR_PDLL_TABLEGEN=/usr/bin/mlir-pdll"
+		configure_args+=" -DMLIR_LINALG_ODS_YAML_GEN=/usr/bin/mlir-linalg-ods-yaml-gen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=/usr/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=/usr/bin/clang-pseudo-gen"
+		configure_args+=" -DLLVM_CONFIG_PATH=/usr/bin/llvm-config"
+		configure_args+=" -DLLDB_TABLEGEN_EXE=/usr/bin/lldb-tblgen"
 	fi
 
 	case "$XBPS_TARGET_MACHINE" in
@@ -238,6 +235,13 @@ post_build() {
 		-DSPHINX_WARNINGS_AS_ERRORS=OFF
 
 	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
+
+	if [ -z "$CROSS_BUILD" ]; then
+		vmkdir usr/bin
+		vcopy build/bin/lldb-tblgen usr/bin
+		vcopy build/bin/clang-tidy-confusable-chars-gen usr/bin
+		vcopy build/bin/clang-pseudo-gen usr/bin
+	fi
 }
 
 post_install() {
@@ -280,7 +284,7 @@ post_install() {
 clang17_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang17-${version}_${revision} "
+	 llvm17-${version}_${revision} "
 	short_desc+=" - C language family frontend"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
@@ -313,16 +317,27 @@ clang17_package() {
 	}
 }
 
+clang17-headers_package() {
+	lib32disabled=yes
+	short_desc+=" - C language family frontend - Headers"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/lib/clang/17/include
+	}
+}
+
 clang17-devel_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang17-${version}_${revision}"
+		clang17-${version}_${revision} clang-analyzer17-${version}_${revision}"
+	if [ "$build_option_clang_tools_extra" ]; then
+		depends+=" clang-tools-extra17-${version}_${revision}"
+	fi
 	short_desc+=" - C language family frontend - development Files"
 	homepage="https://clang.llvm.org/"
 	pkg_install() {
 		vmove usr/include/clang
 		vmove usr/include/clang-c
-		vmove usr/lib/clang
 		vmove usr/lib/libear
 		vmove usr/lib/cmake/clang
 		vmove "usr/lib/libclang*.a"
@@ -343,14 +358,16 @@ clang17-devel_package() {
 }
 
 libclang17_package() {
-	short_desc+=" - C frontend runtime library"
+	depends="clang17-headers-${version}_${revision}"
+	short_desc+=" - C frontend library"
 	pkg_install() {
 		vmove "usr/lib/libclang.so.*"
 	}
 }
 
 libclang-cpp17_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
+	depends="clang17-headers-${version}_${revision}"
+	short_desc+=" - C frontend library (C++ interface)"
 	pkg_install() {
 		vmove "usr/lib/libclang-cpp.so.*"
 	}
@@ -629,15 +646,24 @@ libcxx-devel_package() {
 	}
 }
 
+compiler-rt_package() {
+	short_desc+=" - runtime libraries"
+	homepage="https://compiler-rt.llvm.org/"
+	pkg_install() {
+		vmove usr/lib/clang/17/lib
+		vmove usr/lib/clang/17/bin
+	}
+}
+
 libllvm17_package() {
-	short_desc+=" - runtime library"
+	short_desc+=" - library"
 	pkg_install() {
 		vmove "usr/lib/libLLVM-*.so*"
 	}
 }
 
 llvm17-doc_package() {
-	short_desc+=" - documentation "
+	short_desc+=" - documentation"
 	pkg_install() {
 		vmove usr/share/doc
 	}
@@ -647,13 +673,13 @@ llvm17-devel_package() {
 	short_desc+=" - development files"
 	depends="llvm17>=${version}_${revision}"
 	if [ "$build_option_openmp" ]; then
-		depends+=" libomp-devel>={$version}_${revision} "
+		depends+=" libomp-devel>=${version}_${revision} "
 	fi
 	if [ "$build_option_mlir" ]; then
-		depends+=" mlir17-devel>={$version}_${revision} "
+		depends+=" mlir17-devel>=${version}_${revision} "
 	fi
 	if [ "$build_option_clang" ]; then
-		depends+=" clang17-devel>={$version}_${revision} "
+		depends+=" clang17-devel>=${version}_${revision} "
 	fi
 	pkg_install() {
 		vmove usr/lib/libLLVM.so
@@ -666,3 +692,13 @@ llvm17-devel_package() {
 
 	}
 }
+
+llvm17-cross-tools_package() {
+	short_desc+=" - build tools for cross compiling LLVM"
+	depends="lldb17-devel>=${version}_${revision} llvm17-devel>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/lldb-tblgen
+		vmove usr/bin/clang-tidy-confusable-chars-gen
+		vmove usr/bin/clang-pseudo-gen
+	}
+}

From e9ad79717f85ef34d757f2758a12e50c28e07a0a Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 9 Feb 2024 13:30:09 -0500
Subject: [PATCH 2/2] fixup

---
 srcpkgs/llvm17/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 743c9e58ecb99..d7dce2fe72c0d 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -63,7 +63,7 @@ fi
 
 subpackages+="  libllvm17 llvm17-doc llvm17-devel "
 
-_enabled_projects=""
+#_enabled_projects=""
 if [ "$build_option_clang" ]; then
 	_enabled_projects+="clang;"
 	subpackages+=" clang17 clang17-headers clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
@@ -103,18 +103,18 @@ if [ "$build_option_openmp" ]; then
 	subpackages+=" libomp libomp-devel "
 fi
 
-_enabled_runtimes=
+#_enabled_runtimes=
 if [ 1 ]; then
-       subpackages+=" llvm-libunwind llvm-libunwind-devel "
-       _enabled_runtimes+="${_enabled_runtimes:+;}libunwind"
+	subpackages+=" llvm-libunwind llvm-libunwind-devel "
+	_enabled_runtimes+="${_enabled_runtimes:+;}libunwind"
 fi
 if [ 1 ]; then
-       subpackages+=" libcxx libcxx-devel libcxxabi libcxxabi-devel "
-       _enabled_runtimes+="${_enabled_runtimes:+;}libcxxabi;libcxx"
+	subpackages+=" libcxx libcxx-devel libcxxabi libcxxabi-devel "
+	_enabled_runtimes+="${_enabled_runtimes:+;}libcxxabi;libcxx"
 fi
 if [ 1 ]; then
-       subpackages+=" compiler-rt "
-       _enabled_runtimes+="${_enabled_runtimes:+;}compiler-rt"
+	subpackages+=" compiler-rt "
+	_enabled_runtimes+="${_enabled_runtimes:+;}compiler-rt"
 fi
 
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"

  parent reply	other threads:[~2024-02-09 18:30 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 14:22 [PR PATCH] " Calandracas606
2024-02-09 14:24 ` [PR PATCH] [Updated] " Calandracas606
2024-02-09 14:25 ` Calandracas606
2024-02-09 14:46 ` Calandracas606
2024-02-09 14:58 ` Calandracas606
2024-02-09 16:37 ` Calandracas606
2024-02-09 18:01 ` Calandracas606
2024-02-09 18:27 ` Calandracas606
2024-02-09 18:30 ` Calandracas606 [this message]
2024-02-09 18:48 ` Calandracas606
2024-02-09 20:55 ` Calandracas606
2024-02-09 21:59 ` Calandracas606
2024-02-09 22:01 ` Calandracas606
2024-02-10  0:51 ` Calandracas606
2024-02-10  2:11 ` Calandracas606
2024-02-10  2:15 ` Calandracas606
2024-02-10  2:38 ` Calandracas606
2024-02-10  2:42 ` [PR PATCH] [Updated] " Calandracas606
2024-02-10  4:09 ` Calandracas606
2024-02-10  4:15 ` Calandracas606
2024-02-10  4:22 ` [PR REVIEW] " Calandracas606
2024-02-10  4:22 ` Calandracas606
2024-02-10  4:22 ` Calandracas606
2024-02-10  4:22 ` Calandracas606
2024-02-10  4:22 ` Calandracas606
2024-02-10 16:40 ` [PR PATCH] [Updated] " Calandracas606
2024-02-10 17:06 ` [PR REVIEW] " Sqvid
2024-02-10 17:07 ` Sqvid
2024-02-10 17:14 ` Duncaen
2024-02-10 17:14 ` Duncaen
2024-02-10 17:15 ` Calandracas606
2024-02-10 17:17 ` Duncaen
2024-02-10 17:27 ` Duncaen
2024-02-10 17:29 ` Duncaen
2024-02-10 17:30 ` Duncaen
2024-02-10 17:31 ` Sqvid
2024-02-10 17:33 ` Sqvid
2024-02-10 17:44 ` Sqvid
2024-02-10 17:58 ` Calandracas606
2024-02-10 18:02 ` Calandracas606
2024-02-10 18:06 ` Duncaen
2024-02-10 18:06 ` Duncaen
2024-02-10 18:08 ` Duncaen
2024-02-10 18:11 ` Duncaen
2024-02-10 18:12 ` Duncaen
2024-02-10 18:46 ` Calandracas606
2024-02-10 18:47 ` [PR PATCH] [Updated] " Calandracas606
2024-02-10 21:01 ` Calandracas606
2024-02-10 21:18 ` Calandracas606
2024-02-10 21:22 ` Calandracas606
2024-02-10 21:30 ` [PR PATCH] [Merged]: " Duncaen

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=20240209183023.417B62483B@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).