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 22:59:31 +0100	[thread overview]
Message-ID: <20240209215931.9C79124BA2@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: 22323 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/6] 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/6] 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}"

From 9309b6d70acfd42153a8badc74f1b19319277039 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 9 Feb 2024 13:46:27 -0500
Subject: [PATCH 3/6] fixup set vars to empty

---
 srcpkgs/llvm17/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index d7dce2fe72c0d..7de3dcde71b32 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,7 +103,7 @@ 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"

From 40b974f89a2afbf41d50809ed048d263ac52933d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 9 Feb 2024 15:55:07 -0500
Subject: [PATCH 4/6] fixup clang config file system

---
 srcpkgs/llvm17/template | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 7de3dcde71b32..316b5b1c5c9b8 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -24,6 +24,7 @@ configure_args="
  -DLLVM_BUILD_LLVM_DYLIB=YES
  -DLLVM_LINK_LLVM_DYLIB=YES
  -DCLANG_LINK_CLANG_DYLIB=YES
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR=/etc/clang17
  -DLLVM_ENABLE_RTTI=YES
  -DLLVM_ENABLE_FFI=YES
  -DLLVM_BINUTILS_INCDIR=/usr/include
@@ -35,7 +36,6 @@ hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
  python3-recommonmark python3-sphinx-automodapi git python3-sphinx-markdown-tables python3-yaml pkg-config "
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel "
-depends="libllvm17>=${version}_${revision}"
 short_desc="LLVM Compiler Infrastructure Project - Version 17"
 maintainer="Daniel Martinez <danielmartinez@cock.li>"
 license="Apache-2.0"
@@ -45,8 +45,9 @@ checksum=58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813
 lib32disabled=yes
 python_version=3
 
-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"
+build_options="clang clang_tools_extra lld mlir libclc polly lldb flang bolt openmp runtimes"
+build_options_default="clang clang_tools_extra lld mlir libclc polly lldb runtimes"
+desc_option_runtimes="Enable libcxx{,abi}, libunwind and compiler-rt"
 
 case "$XBPS_TARGET_MACHINE" in
 	x86_64*|aarch64*) build_options_default+=" flang bolt openmp ";;
@@ -61,9 +62,10 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
 fi
 
-subpackages+="  libllvm17 llvm17-doc llvm17-devel "
+subpackages="libllvm17 llvm17-doc llvm17-devel"
+_enabled_projects=
+_enabled_runtimes=
 
-_enabled_projects=""
 if [ "$build_option_clang" ]; then
 	_enabled_projects+="clang;"
 	subpackages+=" clang17 clang17-headers clang17-devel libclang17 libclang-cpp17 clang-analyzer17 "
@@ -103,16 +105,13 @@ if [ "$build_option_openmp" ]; then
 	subpackages+=" libomp libomp-devel "
 fi
 
-_enabled_runtimes=
-if [ 1 ]; then
+if [ "$build_option_runtimes" ]; 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

From b07a653f5e408001e1fb89f0b13c25b6276798cc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 9 Feb 2024 16:32:26 -0500
Subject: [PATCH 5/6] fixup openmp

---
 srcpkgs/llvm17/template | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 316b5b1c5c9b8..4843822aeb628 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -100,10 +100,6 @@ if [ "$build_option_flang" ]; then
 	_enabled_projects+="flang;"
 	subpackages+=" flang17 flang17-devel "
 fi
-if [ "$build_option_openmp" ]; then
-	_enabled_projects+="openmp;"
-	subpackages+=" libomp libomp-devel "
-fi
 
 if [ "$build_option_runtimes" ]; then
 	subpackages+=" llvm-libunwind llvm-libunwind-devel "
@@ -116,11 +112,20 @@ if [ "$build_option_runtimes" ]; then
 	_enabled_runtimes+="${_enabled_runtimes:+;}compiler-rt"
 fi
 
+if [ "$build_option_openmp" ]; then
+	if [ "$CROSS_BUILD" ]; then
+		_enabled_projects+="openmp;"
+	else
+		_enabled_runtimes+="${_enabled_runtimes:+;}openmp"
+	fi
+	subpackages+=" libomp libomp-devel "
+fi
+
 configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
 configure_args+=" -DLLVM_ENABLE_RUNTIMES=${_enabled_runtimes}"
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" llvm17-cross-tools "
+	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"
@@ -236,6 +241,7 @@ post_build() {
 	ninja ${makejobs} -C ${wrksrc}/${build_wrksrc}/runtimes-doc docs-libcxx-html docs-libunwind-html
 
 	if [ -z "$CROSS_BUILD" ]; then
+		# Binaries ONLY used during the process of building llvm, and aren't usually installed
 		vmkdir usr/bin
 		vcopy build/bin/lldb-tblgen usr/bin
 		vcopy build/bin/clang-tidy-confusable-chars-gen usr/bin
@@ -574,7 +580,6 @@ libomp-devel_package() {
 		vmove "usr/lib/libarcher*.so"
 		vmove "usr/lib/libomp*.so"
 		vmove usr/lib/cmake/openmp
-		vmove usr/share/man/man1/llvmopenmp.1
 		if [ -z "$CROSS_BUILD" ]; then
 			vmove "usr/lib/libomptarget*.bc"
 			vmove "usr/lib/libarcher*.a"
@@ -692,6 +697,7 @@ llvm17-devel_package() {
 	}
 }
 
+# These binaries are ONLY used when building llvm, they aren't normally installed
 llvm17-cross-tools_package() {
 	short_desc+=" - build tools for cross compiling LLVM"
 	depends="lldb17-devel>=${version}_${revision} llvm17-devel>=${version}_${revision}"

From 25b45f5f0681d7e05229a09db56144940604bcbc Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 9 Feb 2024 16:59:18 -0500
Subject: [PATCH 6/6] fixup add llvm17-config

---
 srcpkgs/llvm17-config   |  1 +
 srcpkgs/llvm17/template | 30 +++++++++++++++++++++---------
 2 files changed, 22 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/llvm17-config

diff --git a/srcpkgs/llvm17-config b/srcpkgs/llvm17-config
new file mode 120000
index 0000000000000..96970d5c02c13
--- /dev/null
+++ b/srcpkgs/llvm17-config
@@ -0,0 +1 @@
+llvm17
\ No newline at end of file
diff --git a/srcpkgs/llvm17/template b/srcpkgs/llvm17/template
index 4843822aeb628..525a656ef0f45 100644
--- a/srcpkgs/llvm17/template
+++ b/srcpkgs/llvm17/template
@@ -62,7 +62,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
 fi
 
-subpackages="libllvm17 llvm17-doc llvm17-devel"
+subpackages="libllvm17 llvm17-config llvm17-doc llvm17-devel"
 _enabled_projects=
 _enabled_runtimes=
 
@@ -334,7 +334,8 @@ clang17-headers_package() {
 clang17-devel_package() {
 	lib32disabled=yes
 	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-		clang17-${version}_${revision} clang-analyzer17-${version}_${revision}"
+		clang17-${version}_${revision} clang-analyzer17-${version}_${revision}
+		llvm17-config-${version}_${revision}"
 	if [ "$build_option_clang_tools_extra" ]; then
 		depends+=" clang-tools-extra17-${version}_${revision}"
 	fi
@@ -491,7 +492,7 @@ lld17-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - linker - development files"
 	homepage="https://lld.llvm.org"
-	depends="lld17>=${version}_${revision}"
+	depends="lld17>=${version}_${revision} llvm17-config-${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/lld
 		vmove usr/lib/cmake/lld
@@ -513,6 +514,7 @@ mlir17-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - multi-level IR compiler framework - development files"
 	homepage="https://mlir.llvm.org/"
+	depends="mlir17>=${version}_${revision} llvm17-config-${version}_${revision}"
 	pkg_install() {
 		vmove usr/bin/mlir-cpu-runner
 		vmove usr/bin/mlir-linalg-ods-yaml-gen
@@ -549,7 +551,7 @@ flang17-devel_package() {
 	lib32disabled=yes
 	short_desc+=" - Fortran language frontend - development files"
 	homepage="https://flang.llvm.org/"
-	depends="flang17>=${version}_${revision}"
+	depends="flang17>=${version}_${revision} llvm17-config>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/bin/bbc
 		vmove usr/bin/f18-parse-demo
@@ -573,7 +575,7 @@ libomp_package() {
 
 libomp-devel_package() {
 	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
+	depends="libomp>=${version}_${revision} llvm17-config>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/bin/llvm-omp-device-info
 		vmove usr/bin/llvm-omp-kernel-replay
@@ -597,7 +599,7 @@ llvm-libunwind_package() {
 
 llvm-libunwind-devel_package() {
 	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
+	depends="llvm-libunwind>=${version}_${revision} llvm17-config>=${version}_${revision}"
 	conflicts="libunwind-devel>=0"
 	pkg_install() {
 		vmove usr/include/mach-o
@@ -620,7 +622,7 @@ libcxxabi_package() {
 
 libcxxabi-devel_package() {
 	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
+	depends="libcxxabi>=${version}_${revision} llvm17-config>=${version}_${revision}"
 	pkg_install() {
 		vmove "usr/include/*cxxabi*"
 		vmove "usr/lib/libc++abi.so"
@@ -637,7 +639,7 @@ libcxx_package() {
 
 libcxx-devel_package() {
 	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
+	depends="libcxx>=${version}_${revision} llvm17-config>=${version}_${revision}"
 	pkg_install() {
 		vmove usr/include/c++
 		vmove "usr/lib/libc++.so"
@@ -666,6 +668,16 @@ libllvm17_package() {
 	}
 }
 
+llvm17-config_package() {
+	short_desc+=" - config tool and cmake files"
+	depends="llvm17>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin/llvm-config
+		vmove usr/lib/cmake/llvm
+
+	}
+}
+
 llvm17-doc_package() {
 	short_desc+=" - documentation"
 	pkg_install() {
@@ -675,7 +687,7 @@ llvm17-doc_package() {
 
 llvm17-devel_package() {
 	short_desc+=" - development files"
-	depends="llvm17>=${version}_${revision}"
+	depends="llvm17-config>=${version}_${revision}"
 	if [ "$build_option_openmp" ]; then
 		depends+=" libomp-devel>=${version}_${revision} "
 	fi

  parent reply	other threads:[~2024-02-09 21:59 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
2024-02-09 18:48 ` Calandracas606
2024-02-09 20:55 ` Calandracas606
2024-02-09 21:59 ` Calandracas606 [this message]
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=20240209215931.9C79124BA2@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).