summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2024-02-23 16:47:49 +0100
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2024-03-30 10:14:18 +0000
commitcccada28f71f97e7d61d6e50b797c9fa694e5c11 (patch)
tree013dcebc9707659d876b590214d01342a28c4641 /util
parent97ed403650c3fdbf47c14ca71d4c0b0d55a25a44 (diff)
util/crossgcc: Also build LLVM LD
When doing LTO the clang linker frontend needs to use LLD or gold. Build LLD as that is the configuration that is best tested. Change-Id: I3242585f8b5c3426fc6568d3dc47300164d56e3a Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80732 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Diffstat (limited to 'util')
-rwxr-xr-xutil/crossgcc/buildgcc19
-rw-r--r--util/crossgcc/sum/libunwind-17.0.6.src.tar.xz.cksum1
-rw-r--r--util/crossgcc/sum/lld-17.0.6.src.tar.xz.cksum1
3 files changed, 16 insertions, 5 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 9470fe3662..0a0462e2f6 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -54,11 +54,13 @@ GCC_ARCHIVE="gcc-${GCC_VERSION}.tar.xz"
BINUTILS_ARCHIVE="binutils-${BINUTILS_VERSION}.tar.xz"
IASL_ARCHIVE="${IASL_VERSION}.tar.gz"
# CLANG toolchain FILE locations
+LLD_ARCHIVE="lld-${CLANG_VERSION}.src.tar.xz"
LLVM_ARCHIVE="llvm-${CLANG_VERSION}.src.tar.xz"
CLANG_ARCHIVE="clang-${CLANG_VERSION}.src.tar.xz"
CRT_ARCHIVE="compiler-rt-${CLANG_VERSION}.src.tar.xz"
CTE_ARCHIVE="clang-tools-extra-${CLANG_VERSION}.src.tar.xz"
LLVMCMAKE_ARCHIVE="cmake-${CLANG_VERSION}.src.tar.xz"
+LIBUNWIND_ARCHIVE="libunwind-${CLANG_VERSION}.src.tar.xz"
CMAKE_ARCHIVE="cmake-${CMAKE_VERSION}.tar.gz"
NASM_ARCHIVE="nasm-${NASM_VERSION}.tar.bz2"
@@ -79,13 +81,16 @@ CLANG_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-$
CRT_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"
CTE_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"
LLVMCMAKE_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"
+LLD_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"
+LIBUNWIND_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"
CMAKE_BASE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}"
NASM_BASE_URL="https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}"
ALL_ARCHIVES="$GMP_BASE_URL/$GMP_ARCHIVE $MPFR_BASE_URL/$MPFR_ARCHIVE $MPC_BASE_URL/$MPC_ARCHIVE \
$GCC_BASE_URL/$GCC_ARCHIVE $BINUTILS_BASE_URL/$BINUTILS_ARCHIVE $IASL_BASE_URL/$IASL_ARCHIVE \
- $LLVM_BASE_URL/$LLVM_ARCHIVE $CLANG_BASE_URL/$CLANG_ARCHIVE $LLVMCMAKE_BASE_URL/$LLVMCMAKE_ARCHIVE \
- $CRT_BASE_URL/$CRT_ARCHIVE $CTE_BASE_URL/$CTE_ARCHIVE $CMAKE_BASE_URL/$CMAKE_ARCHIVE $NASM_BASE_URL/$NASM_ARCHIVE"
+ $LLD_BASE_URL/$LLD_ARCHIVE $LLVM_BASE_URL/$LLVM_ARCHIVE $CLANG_BASE_URL/$CLANG_ARCHIVE \
+ $LLVMCMAKE_BASE_URL/$LLVMCMAKE_ARCHIVE $CRT_BASE_URL/$CRT_ARCHIVE $CTE_BASE_URL/$CTE_ARCHIVE \
+ $LIBUNWIND_BASE_URL/$LIBUNWIND_ARCHIVE $CMAKE_BASE_URL/$CMAKE_ARCHIVE $NASM_BASE_URL/$NASM_ARCHIVE"
# GCC toolchain directories
GMP_DIR="gmp-${GMP_VERSION}"
@@ -97,11 +102,13 @@ GCC_DIR="gcc-${GCC_VERSION}"
BINUTILS_DIR="binutils-${BINUTILS_VERSION}"
IASL_DIR="acpica-${IASL_VERSION}"
# CLANG toolchain directories
+LLD_DIR="lld-${CLANG_VERSION}.src"
LLVM_DIR="llvm-${CLANG_VERSION}.src"
CLANG_DIR="clang-${CLANG_VERSION}.src"
CRT_DIR="compiler-rt-${CLANG_VERSION}.src"
CTE_DIR="clang-tools-extra-${CLANG_VERSION}.src"
LLVMCMAKE_DIR="cmake-${CLANG_VERSION}.src"
+LIBUNWIND_DIR="libunwind-${CLANG_VERSION}.src"
CMAKE_DIR="cmake-${CMAKE_VERSION}"
NASM_DIR="nasm-${NASM_VERSION}"
@@ -866,16 +873,18 @@ build_IASL() {
build_LLVM() {
+ ln -nsf "$LLD_DIR" ../lld
ln -nsf "$LLVM_DIR" ../llvm
ln -nsf "$CLANG_DIR" ../clang
ln -nsf "$CTE_DIR" ../clang-tools-extra
ln -nsf "$CRT_DIR" ../compiler-rt
ln -nsf "$LLVMCMAKE_DIR" ../cmake
+ ln -nsf "$LIBUNWIND_DIR" ../libunwind
$CMAKE -G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX="$DESTDIR$TARGETDIR" \
-DCLANG_VENDOR="coreboot toolchain v$CROSSGCC_VERSION - " \
- -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt" \
+ -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;lld" \
-DLLVM_INCLUDE_BENCHMARKS="OFF" \
-DLLVM_INCLUDE_TESTS="OFF" \
-DLLVM_INCLUDE_EXAMPLES="OFF" \
@@ -886,7 +895,7 @@ build_LLVM() {
$MAKE $JOBS || touch .failed
$MAKE install || touch .failed
- rm -f ../llvm ../clang ../clang-tools-extra ../compiler-rt ../cmake
+ rm -f ../llvm ../clang ../clang-tools-extra ../compiler-rt ../cmake ../lld ../libunwind
cp -a ../$CLANG_DIR/tools/scan-build/* "$DESTDIR$TARGETDIR/bin"
cp -a ../$CLANG_DIR/tools/scan-view/* "$DESTDIR$TARGETDIR/bin"
@@ -1023,7 +1032,7 @@ case "$PACKAGE" in
CLANG|clang)
NAME="LLVM clang"
LLVM_VERSION=${CLANG_VERSION}
- PACKAGES="CMAKE LLVM CLANG CRT CTE LLVMCMAKE"
+ PACKAGES="CMAKE LLVM CLANG CRT CTE LLVMCMAKE LLD LIBUNWIND"
CMAKE=${DESTDIR}${TARGETDIR}/bin/cmake
;;
IASL|iasl)
diff --git a/util/crossgcc/sum/libunwind-17.0.6.src.tar.xz.cksum b/util/crossgcc/sum/libunwind-17.0.6.src.tar.xz.cksum
new file mode 100644
index 0000000000..e54b57432e
--- /dev/null
+++ b/util/crossgcc/sum/libunwind-17.0.6.src.tar.xz.cksum
@@ -0,0 +1 @@
+336b82602ec25a02bb987f44bd5ed990cb4c7f4a tarballs/libunwind-17.0.6.src.tar.xz
diff --git a/util/crossgcc/sum/lld-17.0.6.src.tar.xz.cksum b/util/crossgcc/sum/lld-17.0.6.src.tar.xz.cksum
new file mode 100644
index 0000000000..0979dbd513
--- /dev/null
+++ b/util/crossgcc/sum/lld-17.0.6.src.tar.xz.cksum
@@ -0,0 +1 @@
+abe5d45ebea2b9994a5e6ed31268a2114f4fa14f tarballs/lld-17.0.6.src.tar.xz