@ivanmlerner,
I don't see any errors in building this package in a clean chroot environment. Can you share some details about your environment and the commands you're using to build this?
Git Clone URL: | https://aur.archlinux.org/llvm-git.git (read-only, click to copy) |
---|---|
Package Base: | llvm-git |
Description: | LLVM development version. includes clang and many other tools |
Upstream URL: | https://llvm.org/ |
Keywords: | clang git lld lldb llvm polly |
Licenses: | custom:Apache 2.0 with LLVM Exception |
Conflicts: | clang, compiler-rt, lld, lldb, llvm, polly |
Provides: | aur-llvm-git, clang, clang-git, compiler-rt, compiler-rt-git, lld, lld-git, lldb, lldb-git, llvm, polly, polly-git |
Submitter: | yurikoles |
Maintainer: | rjahanbakhshi |
Last Packager: | rjahanbakhshi |
Votes: | 116 |
Popularity: | 0.019577 |
First Submitted: | 2018-12-05 13:56 (UTC) |
Last Updated: | 2022-10-25 22:15 (UTC) |
@ivanmlerner,
I don't see any errors in building this package in a clean chroot environment. Can you share some details about your environment and the commands you're using to build this?
Hello, I am getting these errors when trying to build the package:
[7106/8254] Building CXX object tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArch.cpp.o
FAILED: tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArch.cpp.o
/usr/bin/c++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/**/llvm-git/src/_build/tools/clang/tools/amdgpu-arch -I/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch -I/home/**/llvm-git/src/llvm-project/clang/include -I/home/**/llvm-git/src/_build/tools/clang/include -I/home/**/llvm-git/src/_build/include -I/home/**/llvm-git/src/llvm-project/llvm/include -march=znver2 -mtune=znver2 -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -fno-exceptions -std=c++17 -MD -MT tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArch.cpp.o -MF tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArch.cpp.o.d -o tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArch.cpp.o -c /home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:84:8: error: ‘hsa_status_t’ does not name a type
84 | static hsa_status_t iterateAgentsCallback(hsa_agent_t Agent, void *Data) {
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp: In function ‘int main(int, char**)’:
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:112:3: error: ‘hsa_status_t’ was not declared in this scope
112 | hsa_status_t Status = hsa_init();
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:113:7: error: ‘Status’ was not declared in this scope
113 | if (Status != HSA_STATUS_SUCCESS) {
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:113:17: error: ‘HSA_STATUS_SUCCESS’ was not declared in this scope
113 | if (Status != HSA_STATUS_SUCCESS) {
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:118:3: error: ‘Status’ was not declared in this scope
118 | Status = hsa_iterate_agents(iterateAgentsCallback, &GPUs);
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:118:31: error: ‘iterateAgentsCallback’ was not declared in this scope
118 | Status = hsa_iterate_agents(iterateAgentsCallback, &GPUs);
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:118:12: error: ‘hsa_iterate_agents’ was not declared in this scope
118 | Status = hsa_iterate_agents(iterateAgentsCallback, &GPUs);
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:119:17: error: ‘HSA_STATUS_SUCCESS’ was not declared in this scope
119 | if (Status != HSA_STATUS_SUCCESS) {
/home/**/llvm-git/src/llvm-project/clang/tools/amdgpu-arch/AMDGPUArch.cpp:129:3: error: ‘hsa_shut_down’ was not declared in this scope
129 | hsa_shut_down();
BTW_IUseGentoo :
lldb is in makedepends array of the llvm-git PKGBUILD, so the build should indeed fail if it's not present .
The lldb package is in archlinux [extra] repo, just install it before building starts. (it can be removed again after building has finished)
I needed lldb
==> Missing dependencies:
-> lldb
==> ERROR: Could not resolve all dependencies.
error: failed to build 'llvm-git-16.0.0_r439853.1fe096ef59d1-1 (llvm-libs-git llvm-git)':
error: packages failed to build: llvm-git-16.0.0_r439853.1fe096ef59d1-1 (llvm-libs-git llvm-git)
Understood, you have thought about this and how you want to use it.
Atleast mesa trunk has used this method years ago, but stopped doing it because no other packages made use of it . I have no objections to adding $pkgver-$pkgrel values in llvm-git .
Keep in mind llvm-git follows upstream default branch, so will switch from 16 to 17 when upstream branches off stable 16 .
You may want to use something like 'llvm>=16' 'llvm<17'
to ensure users can switch to stable 16 once it arrives.
@Lone_Wolf I understand what you are saying about so names and versions and agree it would be nice if this package added provides for the sonames with version data so other packages could add that as a run time dependency with proper heads-up when a rebuild was needed. However I think you're wrong about my suggestion being a failure: there is no harm in adding the package version information to the provides like like I showed. It does not solve the same problem as providing the soname, but it does solve a different problem. It allows this package to be used as a makedepends with version information for packages that require to be built against a minimum version newer than what is in [community] at this point. It won't provide a run-time way to keep the soname version matched, but it does provide a build time dependency that is flexible enough to be supplied by this or another future update to the stable package(s).
alerque, doing it that way will fail at runtime as packages aren't linked to external libraries using package versions but through sonames .
the command find-libprovides from devtools package can help to make those visible.
$ find-libprovides --ignore-internal llvm-git-16.0.0_r443217.0b74cb42312b-1-x86_64.pkg.tar.zst
libclang.so=16-64
libclang-cpp.so=16-64
liblldb.so=16-64
liblldbIntelFeatures.so=16-64
$ find-libprovides --ignore-internal llvm-libs-git-16.0.0_r443217.0b74cb42312b-1-x86_64.pkg.tar.zst
libLTO.so=16-64
libRemarks.so=16-64
$ find-libprovides --ignore-internal llvm-ocaml-git-16.0.0_r443217.0b74cb42312b-1-x86_64.pkg.tar.zst
bsdtar: *.so*: Not found in archive
bsdtar: Error exit delayed from previous errors.
$
If you run the same command on other archlinux (binary) llvm pacakges, you'll get similar results.
If this package adds those sonames to provides, applications can depend on an exact version of the shared library, get a warning when sonames change and a rebuild is necessary.
This package provides llvm but it does not do so in a way that includes the version information. Hence it is not currently possible for other packages to use it as a build time dependency with a version requirement that would let them start using the stable version when a sufficient version is released and packaged in [community] like makedepends=('llvm>=16')
. This is negatively effecting builds like brave where we're unable to specify the dependencies correctly.
Here is a patch that should fix it which should apply cleanly with git am < file.patch
:
From 98428851968f085b019ed538c73d7fed997d6ba1 Mon Sep 17 00:00:00 2001
From: Caleb Maclennan <caleb@alerque.com>
Date: Sun, 27 Nov 2022 11:13:04 +0300
Subject: [PATCH] Provide version data with llvm provides
Signed-off-by: Caleb Maclennan <caleb@alerque.com>
---
.SRCINFO | 12 ++++++------
PKGBUILD | 13 +++++++------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/.SRCINFO b/.SRCINFO
index 6229cd1..91ac369 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
pkgbase = llvm-git
- pkgver = 16.0.0_r439853.1fe096ef59d1
+ pkgver = 16.0.0_r443015.49aca00d63e1
pkgrel = 1
url = https://llvm.org/
arch = x86_64
@@ -38,7 +38,7 @@ pkgbase = llvm-git
pkgname = llvm-git
pkgdesc = LLVM development version. includes clang and many other tools
- depends = llvm-libs-git=16.0.0_r439853.1fe096ef59d1-1
+ depends = llvm-libs-git=16.0.0_r443015.49aca00d63e1-1
depends = perl
optdepends = python: for scripts
provides = aur-llvm-git
@@ -47,7 +47,7 @@ pkgname = llvm-git
provides = lldb-git
provides = lld-git
provides = polly-git
- provides = llvm
+ provides = llvm=16.0.0_r443015.49aca00d63e1
provides = compiler-rt
provides = clang
provides = lldb
@@ -71,13 +71,13 @@ pkgname = llvm-libs-git
depends = z3
depends = lua53
provides = aur-llvm-libs-git
- provides = llvm-libs
+ provides = llvm-libs=16.0.0_r443015.49aca00d63e1
conflicts = llvm-libs
pkgname = llvm-ocaml-git
pkgdesc = OCaml bindings for LLVM
- depends = llvm-git=16.0.0_r439853.1fe096ef59d1-1
+ depends = llvm-git=16.0.0_r443015.49aca00d63e1-1
depends = ocaml
depends = ocaml-ctypes
- provides = llvm-ocaml
+ provides = llvm-ocaml=16.0.0_r443015.49aca00d63e1
conflicts = llvm-ocaml
diff --git a/PKGBUILD b/PKGBUILD
index 9bc813a..6bd941b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
# Maintainer: Reza Jahanbakhshi <reza.jahanbakhshi at gmail dot com
+# Contributor: Caleb Maclennan <caleb@alerque.com>
# Contributor: Lone_Wolf <lone_wolf@klaas-de-kat.nl>
# Contributor: yurikoles <root@yurikoles.com>
# Contributor: bearoso <bearoso@gmail.com>
@@ -16,12 +17,12 @@
pkgname=('llvm-git' 'llvm-libs-git' 'llvm-ocaml-git')
-pkgver=16.0.0_r439853.1fe096ef59d1
+pkgver=16.0.0_r443015.49aca00d63e1
pkgrel=1
arch=('x86_64')
url="https://llvm.org/"
license=('custom:Apache 2.0 with LLVM Exception')
-makedepends=('git' 'cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2'
+makedepends=('git' 'cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2'
'python-setuptools' 'lldb' 'ocaml' 'ocaml-ctypes' 'ocaml-findlib'
'python-sphinx' 'python-recommonmark' 'swig' 'python' 'python-six' 'lua53'
'ocl-icd' 'opencl-headers' 'z3' 'jsoncpp' 'ocaml-stdlib-shims')
@@ -108,7 +109,7 @@ package_llvm-git() {
depends=("llvm-libs-git=$pkgver-$pkgrel" 'perl')
optdepends=('python: for scripts')
provides=(aur-llvm-git compiler-rt-git clang-git lldb-git lld-git polly-git
- llvm compiler-rt clang lldb polly lld )
+ "llvm=$pkgver" compiler-rt clang lldb polly lld )
# A package always provides itself, so there's no need to provide llvm-git
conflicts=('llvm' 'compiler-rt' 'clang' 'lldb' 'polly' 'lld')
@@ -170,7 +171,7 @@ package_llvm-git() {
package_llvm-libs-git() {
pkgdesc="runtime libraries for llvm-git"
depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2' 'z3' 'lua53')
- provides=(aur-llvm-libs-git llvm-libs)
+ provides=(aur-llvm-libs-git "llvm-libs=$pkgver")
conflicts=('llvm-libs')
install -d "$pkgdir"/usr/lib
@@ -198,8 +199,8 @@ package_llvm-ocaml-git() {
pkgdesc="OCaml bindings for LLVM"
depends=("llvm-git=$pkgver-$pkgrel" "ocaml" 'ocaml-ctypes')
conflicts=('llvm-ocaml')
- provides=("llvm-ocaml")
-
+ provides=("llvm-ocaml=$pkgver")
+
install -d "$pkgdir"/{usr/lib,usr/share/doc/$pkgname}
cp -a "$srcdir"/ocaml.lib "$pkgdir"/usr/lib/ocaml
cp -a "$srcdir"/ocaml.doc "$pkgdir"/usr/share/doc/$pkgname/html
--
2.38.1
Hi, I needed to install python-setuptools
to clear this section. (I am using a clean chroot with only base-devel
installed.)
# Include lit for running lit-based tests in other projects
pushd llvm-project/llvm/utils/lit
python setup.py install --root="$pkgdir" -O1
popd
Therefore I think it needs to be a make dependency instead of an optional dependency, because it's required to clear the package_llvm-git
function by default. Unless the user is expected to intervene here, in which case I apologise for disruption.
Pinned Comments
Lone_Wolf commented on 2021-08-16 11:26 (UTC)
When you have this package installed applications that are built against repo-llvm/clang WILL fail unless they are rebuild against this package.
This includes QTCreator, kdevelop , mesa, intel-compute-runtime, gnome-builder to name a few.
Lone_Wolf commented on 2020-08-22 12:18 (UTC) (edited on 2021-02-06 12:51 (UTC) by Lone_Wolf)
Archlinux currently has 3 llvm git implementations
This package
llvm-minimal-git
packages created & maintained by Lordheavy, an arch developer
Lone_Wolf commented on 2019-04-12 20:41 (UTC) (edited on 2019-12-16 22:45 (UTC) by Lone_Wolf)
I've looked good at clang-trunk , llvm-svn, repo llvm/clang packages and think this package is now on route to become a worthy successor to llvm-svn .
llvm-libs-git holds the runtime libraries.
llvm-git
The Package now uses a new environment variable to make ninja behave, NINJAFLAGS. If you want to use it adjust the snippet below to your desired values and add it to makepkg.conf.
Incase you are satisfied with ninja defaults you don't need to do anything.
The check() function fails rather often, but I do suggest to build with them. If build fails due to test failure you can add --nocheck to skip the tests.