From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Jules Maselbas <jmaselbas@zdiv.net>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 7/7] ci: container: install LLVM/clang
Date: Wed, 26 Mar 2025 13:36:19 +0100 [thread overview]
Message-ID: <20250326123619.282897-8-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250326123619.282897-1-a.fatoum@pengutronix.de>
This will be used later for clang-analyzer and libfuzzer.
We intentionally use the LLVM project apt repositories for greater
flexibility in the versions we want to use, e.g. LLVM 20 is not yet
available on Debian Bookworm.
kernel.org also hosts more barebones LLVM toolchains, but we are
interested in more than that.
The LLVM layer added to the container sits at 1.04GiB, which is about
200MiB less than what we are using for the GCC toolchains.
It contains support for cross-compiling 47 different targets.
Cc: Jules Maselbas <jmaselbas@zdiv.net>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
test/Containerfile | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/test/Containerfile b/test/Containerfile
index e9b044c87ab7..20402c384b6f 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -58,6 +58,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV GCC_VERSION=14.2.0
+ENV LLVM_VERSION=20
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ lsb-release software-properties-common gnupg \
+ && wget https://apt.llvm.org/llvm.sh \
+ && chmod +x llvm.sh && ./llvm.sh ${LLVM_VERSION} \
+ && apt-get remove -y lsb-release software-properties-common gnupg \
+ && apt-get autoremove -y --purge \
+ && apt-get clean \
+ && rm -rf llvm.sh /var/lib/apt/lists/*
# Manually install the kernel.org Crosstool based toolchains
RUN korg_crosstool_dl() { wget -nv -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${1}/${2}/${1}-gcc-${2}-nolibc-${3}.tar.xz | tar -C /opt -xJ ; } && \
@@ -92,4 +102,9 @@ ENV CROSS_COMPILE_powerpc=/opt/gcc-${GCC_VERSION}-nolibc/powerpc-linux/bin/power
ENV CROSS_COMPILE_riscv=/opt/gcc-${GCC_VERSION}-nolibc/riscv64-linux/bin/riscv64-linux-
ENV CROSS_COMPILE_kvx=/opt/gcc-kalray-kvx-v5.0.0/bin/kvx-elf-
+ENV CROSS_COMPILE_llvm=-${LLVM_VERSION}
+# Workaround for https://github.com/llvm/llvm-project/issues/112458
+RUN ln -Ts /usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION}/lib/linux/ \
+ /usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION}/lib/x86_64-pc-linux-gnu
+
USER barebox:barebox
--
2.39.5
next prev parent reply other threads:[~2025-03-26 12:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 12:36 [PATCH 0/7] ci: container: include musl and LLVM Ahmad Fatoum
2025-03-26 12:36 ` [PATCH 1/7] Revert "ci: container: downgrade OpenRISC toolchain from 14.2.0 to 13.1.0" Ahmad Fatoum
2025-03-26 12:36 ` [PATCH 2/7] ci: container: download and delete kvx.tgz in the same layer Ahmad Fatoum
2025-03-26 12:36 ` [PATCH 3/7] ci: container: don't leave labgrid checkout in /tmp Ahmad Fatoum
2025-03-26 12:36 ` [PATCH 4/7] ci: container: don't install recommended packages Ahmad Fatoum
2025-03-26 12:36 ` [PATCH 5/7] ci: container: run apt-get clean after installation Ahmad Fatoum
2025-03-26 12:36 ` [PATCH 6/7] ci: container: add musl-tools Ahmad Fatoum
2025-03-26 12:36 ` Ahmad Fatoum [this message]
2025-03-27 9:21 ` [PATCH 0/7] ci: container: include musl and LLVM Sascha Hauer
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=20250326123619.282897-8-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jmaselbas@zdiv.net \
/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