summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLone_Wolf2021-04-04 21:03:50 +0200
committerLone_Wolf2021-04-04 21:03:50 +0200
commitc3d6461c35bcc0670ac014ca0ab75a2b9a4f4673 (patch)
treeca777a3dcc6682966c174a77085c6d197f2badc5
parent4243b8e512bfa13cfc6fd3b5f23ca54dfa8c7caf (diff)
downloadaur-c3d6461c35bcc0670ac014ca0ab75a2b9a4f4673.tar.gz
revert upstream commit 43ceb74eb1a5801662419fb66a6bf0d5414f1ec5 as it breaks build, see also https://bugs.llvm.org/show_bug.cgi?id=49818
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD19
-rw-r--r--llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch54
3 files changed, 74 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2b840ddfb865..ff73d46bd368 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
pkgbase = llvm-minimal-git
- pkgver = 12.0.0_r374074.1c98f984105e
+ pkgver = 13.0.0_r384580.292726b6443c
pkgrel = 1
url = https://llvm.org/
arch = x86_64
@@ -16,15 +16,18 @@ pkgbase = llvm-minimal-git
makedepends = python-setuptools
options = staticlibs
source = llvm-project::git+https://github.com/llvm/llvm-project.git
- source = llvm-config.h
+ source = local://llvm-config.h
+ source = local://llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch
md5sums = SKIP
md5sums = 295c343dcd457dc534662f011d7cff1a
+ md5sums = 5c9db72a8239005aaae0b2790c1df84f
sha512sums = SKIP
sha512sums = 75e743dea28b280943b3cc7f8bbb871b57d110a7f2b9da2e6845c1c36bf170dd883fca54e463f5f49e0c3effe07fbd0db0f8cf5a12a2469d3f792af21a73fcdd
+ sha512sums = ffc3d1bc65c3b28ecf2b593ffbdb1bc426dd8291219b2d2e219ab458d704687293246f4a31459b1ddb50e18482884a36815a47234bb02f59fb4280cf2223d8b1
pkgname = llvm-minimal-git
pkgdesc = Collection of modular and reusable compiler and toolchain technologies
- depends = llvm-libs-minimal-git=12.0.0_r374074.1c98f984105e-1
+ depends = llvm-libs-minimal-git=13.0.0_r384580.292726b6443c-1
depends = perl
optdepends = python: for using lit (LLVM Integrated Tester)
optdepends = python-setuptools: for using lit
diff --git a/PKGBUILD b/PKGBUILD
index 38aafb01b837..353bb215642f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,7 @@
pkgbase=llvm-minimal-git
pkgname=('llvm-minimal-git' 'llvm-libs-minimal-git')
-pkgver=12.0.0_r374074.1c98f984105e
+pkgver=13.0.0_r384580.292726b6443c
pkgrel=1
arch=('x86_64')
url="https://llvm.org/"
@@ -24,11 +24,15 @@ license=('custom:Apache 2.0 with LLVM Exception')
makedepends=('git' 'cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2'
'libxcrypt' 'python' 'python-setuptools')
source=("llvm-project::git+https://github.com/llvm/llvm-project.git"
- 'llvm-config.h')
+ 'local://llvm-config.h'
+ 'local://llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch')
+
md5sums=('SKIP'
- '295c343dcd457dc534662f011d7cff1a')
+ '295c343dcd457dc534662f011d7cff1a'
+ '5c9db72a8239005aaae0b2790c1df84f')
sha512sums=('SKIP'
- '75e743dea28b280943b3cc7f8bbb871b57d110a7f2b9da2e6845c1c36bf170dd883fca54e463f5f49e0c3effe07fbd0db0f8cf5a12a2469d3f792af21a73fcdd')
+ '75e743dea28b280943b3cc7f8bbb871b57d110a7f2b9da2e6845c1c36bf170dd883fca54e463f5f49e0c3effe07fbd0db0f8cf5a12a2469d3f792af21a73fcdd'
+ 'ffc3d1bc65c3b28ecf2b593ffbdb1bc426dd8291219b2d2e219ab458d704687293246f4a31459b1ddb50e18482884a36815a47234bb02f59fb4280cf2223d8b1')
options=('staticlibs')
# NINJAFLAGS is an env var used to pass commandline options to ninja
# NOTE: It's your responbility to validate the value of $NINJAFLAGS. If unsure, don't set it.
@@ -47,6 +51,11 @@ pkgver() {
echo "${_pkgver}"
}
+prepare() {
+ cd llvm-project
+ patch --reverse --strip=1 --input="${srcdir}/llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch"
+}
+
build() {
export CFLAGS+=" ${CPPFLAGS}"
@@ -80,7 +89,7 @@ build() {
-D LLVM_ENABLE_BINDINGS=OFF \
-D LLVM_ENABLE_PROJECTS="compiler-rt;clang-tools-extra;clang" \
-Wno-dev
-
+
ninja -C _build $NINJAFLAGS
}
diff --git a/llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch b/llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch
new file mode 100644
index 000000000000..6e6797276359
--- /dev/null
+++ b/llvm-shlib_Create_object_libraries_for_each_component_and_link_against_them.patch
@@ -0,0 +1,54 @@
+From 43ceb74eb1a5801662419fb66a6bf0d5414f1ec5 Mon Sep 17 00:00:00 2001
+From: Tom Stellard <tstellar@redhat.com>
+Date: Wed, 31 Mar 2021 21:35:04 -0700
+Subject: [PATCH] llvm-shlib: Create object libraries for each component and
+ link against them
+
+This makes it possible to build libLLVM.so without first creating a
+static library for each component. In the case where only libLLVM.so is
+built (i.e. ninja LLVM) this eliminates 150 linker jobs.
+
+Reviewed By: stellaraccident
+
+Differential Revision: https://reviews.llvm.org/D95727
+---
+ llvm/cmake/modules/AddLLVM.cmake | 3 ++-
+ llvm/tools/llvm-shlib/CMakeLists.txt | 4 ++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
+index 2f055c7799624..c7a50b7a393ef 100644
+--- a/llvm/cmake/modules/AddLLVM.cmake
++++ b/llvm/cmake/modules/AddLLVM.cmake
+@@ -488,6 +488,7 @@ function(llvm_add_library name)
+ add_dependencies(${obj_name} ${link_lib})
+ endif()
+ endforeach()
++ target_link_libraries(${obj_name} ${ARG_LINK_LIBS})
+ endif()
+ endif()
+
+@@ -746,7 +747,7 @@ function(add_llvm_component_library name)
+ "COMPONENT_NAME;ADD_TO_COMPONENT"
+ ""
+ ${ARGN})
+- add_llvm_library(${name} COMPONENT_LIB ${ARG_UNPARSED_ARGUMENTS})
++ add_llvm_library(${name} COMPONENT_LIB OBJECT ${ARG_UNPARSED_ARGUMENTS})
+ string(REGEX REPLACE "^LLVM" "" component_name ${name})
+ set_property(TARGET ${name} PROPERTY LLVM_COMPONENT_NAME ${component_name})
+
+diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
+index b0ee19049e6fa..728995ad8b299 100644
+--- a/llvm/tools/llvm-shlib/CMakeLists.txt
++++ b/llvm/tools/llvm-shlib/CMakeLists.txt
+@@ -33,6 +33,10 @@ if(LLVM_BUILD_LLVM_DYLIB)
+ add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
+
+ list(REMOVE_DUPLICATES LIB_NAMES)
++
++ # Link against the object libraries instead of static libraries.
++ list(TRANSFORM LIB_NAMES PREPEND "obj.")
++
+ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")