From 0f0cb173d90d561f2632134dd7d5f674e7e45eb4 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Fri, 3 Oct 2025 23:28:42 +0100 Subject: [PATCH 1/6] ubuntu:22.04:x-riscv64: Fix for riscv64 cross compilation When cross building riscv64, we need to specify ARCH=riscv so that this can set to $(SRCARCH) and can find the asm headers correctly. Also install Clang and related libs. Signed-off-by: Leo Yan --- bin/dm | 2 +- ubuntu/22.04/x-riscv64/Dockerfile | 6 ++++++ ubuntu/22.04/x-riscv64/rx_and_build.sh | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/dm b/bin/dm index 3dcb449..a598b26 100755 --- a/bin/dm +++ b/bin/dm @@ -75,7 +75,7 @@ for img in ${images} ; do NO_CLANG=$(echo $envdm | grep -q NO_CLANG && echo "1") clang_version="" if [ -z "$NO_CLANG" ] ; then - clang_version=$(${PODMAN_RUN} --entrypoint=${CROSS_COMPILE}clang $img --version 2>/dev/null | head -1 | tr -d '\r\n') + clang_version=$(${PODMAN_RUN} --entrypoint=clang $img --version 2>/dev/null | head -1 | tr -d '\r\n') [ -z "$clang_version" ] || clang_version=$(echo -n ", $clang_version") fi timeline=$(grep "seconds time elapsed" ${output_stat}) ; seconds=$(echo ${timeline} | sed -r 's/([0-9]+\.[0-9]+).* second.*/\1/g') ; rm -f ${output_stat} diff --git a/ubuntu/22.04/x-riscv64/Dockerfile b/ubuntu/22.04/x-riscv64/Dockerfile index 1462aec..e0d54ce 100644 --- a/ubuntu/22.04/x-riscv64/Dockerfile +++ b/ubuntu/22.04/x-riscv64/Dockerfile @@ -12,6 +12,11 @@ ENV TARGET riscv64-linux-gnu RUN apt-get -y update && \ apt-get -y install make gcc-${TARGET} flex bison python3 && \ apt-get -y install wget bzip2 curl xz-utils cmake xmlto asciidoc && \ + apt-get -y install clang llvm libclang-dev llvm-dev libcap-dev \ + libunwind8-dev libssl-dev libslang2-dev python3-dev python3-setuptools \ + systemtap-sdt-dev libgtk2.0-dev liblzma-dev binutils-dev \ + libelf-dev libiberty-dev libdw-dev libaudit-dev libtraceevent-dev libbpf-dev \ + libperl-dev libnuma-dev libzstd-dev cmake xmlto asciidoc && \ export ELFUTILS_VER=0.187 && \ export ZLIB_VER=1.3.1 && \ export INSTALLDIR=/usr/${TARGET} && \ @@ -47,6 +52,7 @@ RUN apt-get -y update && \ chown -R toolsbuilder.toolsbuilder /tmp/build/ /git/ USER toolsbuilder COPY rx_and_build.sh / +ENV ARCH riscv ENV CROSS_COMPILE=${TARGET}- ENV EXTRA_MAKE_ARGS=NO_LIBTRACEEVENT=1 COPY .bash_profile /home/toolsbuilder/ diff --git a/ubuntu/22.04/x-riscv64/rx_and_build.sh b/ubuntu/22.04/x-riscv64/rx_and_build.sh index 7351125..164a03f 100755 --- a/ubuntu/22.04/x-riscv64/rx_and_build.sh +++ b/ubuntu/22.04/x-riscv64/rx_and_build.sh @@ -69,7 +69,7 @@ set -o xtrace set +o xtrace # Bail ou if we don't have clang, print the version for dm to harvest and put in the status line -${CROSS_COMPILE}clang -v || exit 0 +clang -v || exit 0 if [ -z "$BUILD_CMD" ] ; then build_perf_clang From c18899e0fc44740046ffb12344db18a861883eb4 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Sat, 4 Oct 2025 09:03:34 +0100 Subject: [PATCH 2/6] debian:experimental:x-arm64: Fix Clang build Install Clang/LLVM and host packages. Remove the prefix ${CROSS_COMPILE} from clang. Signed-off-by: Leo Yan --- debian/experimental/x-arm64/Dockerfile | 7 ++++++- debian/experimental/x-arm64/rx_and_build.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/experimental/x-arm64/Dockerfile b/debian/experimental/x-arm64/Dockerfile index 7da3b15..748a39f 100644 --- a/debian/experimental/x-arm64/Dockerfile +++ b/debian/experimental/x-arm64/Dockerfile @@ -20,7 +20,12 @@ FROM debian:experimental MAINTAINER Arnaldo Carvalho de Melo ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ - apt-get -y install apt-utils vim make flex bison curl bc findutils build-essential git cmake xmlto asciidoc python3-dev && \ + apt-get -y install apt-utils vim make flex bison curl bc findutils build-essential git cmake xmlto asciidoc python3-dev && \ + apt-get -y install clang llvm libclang-dev llvm-dev libcap-dev \ + libunwind8-dev libssl-dev libslang2-dev python3-dev python3-setuptools \ + systemtap-sdt-dev libgtk2.0-dev liblzma-dev binutils-dev \ + libelf-dev libiberty-dev libdw-dev libaudit-dev libtraceevent-dev libbpf-dev \ + libperl-dev libnuma-dev libzstd-dev cmake xmlto asciidoc && \ apt-get -y clean && \ rm -rf /usr/share/doc /usr/share/gtk-doc /usr/share/locale /usr/share/man ENV ARCH arm64 diff --git a/debian/experimental/x-arm64/rx_and_build.sh b/debian/experimental/x-arm64/rx_and_build.sh index 7351125..164a03f 100755 --- a/debian/experimental/x-arm64/rx_and_build.sh +++ b/debian/experimental/x-arm64/rx_and_build.sh @@ -69,7 +69,7 @@ set -o xtrace set +o xtrace # Bail ou if we don't have clang, print the version for dm to harvest and put in the status line -${CROSS_COMPILE}clang -v || exit 0 +clang -v || exit 0 if [ -z "$BUILD_CMD" ] ; then build_perf_clang From 38b4884128c0b8f75a7df399c388d6154dee616c Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Sat, 4 Oct 2025 09:04:29 +0100 Subject: [PATCH 3/6] debian:experimental:x-mips: Fix Clang build Install Clang/LLVM and host packages. Remove the prefix ${CROSS_COMPILE} from clang. Signed-off-by: Leo Yan --- debian/experimental/x-mips/Dockerfile | 5 +++++ debian/experimental/x-mips/rx_and_build.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/experimental/x-mips/Dockerfile b/debian/experimental/x-mips/Dockerfile index cb2bb58..c529e09 100644 --- a/debian/experimental/x-mips/Dockerfile +++ b/debian/experimental/x-mips/Dockerfile @@ -7,6 +7,11 @@ MAINTAINER Arnaldo Carvalho de Melo ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ apt-get -y install apt-utils make flex bison curl bc findutils build-essential cmake xmlto asciidoc vim strace exuberant-ctags && \ + apt-get -y install clang llvm libclang-dev llvm-dev libcap-dev \ + libunwind8-dev libssl-dev libslang2-dev python3-dev python3-setuptools \ + systemtap-sdt-dev libgtk2.0-dev liblzma-dev binutils-dev \ + libelf-dev libiberty-dev libdw-dev libaudit-dev libtraceevent-dev libbpf-dev \ + libperl-dev libnuma-dev libzstd-dev cmake xmlto asciidoc && \ apt-get -y clean && \ rm -rf /usr/share/doc /usr/share/gtk-doc /usr/share/locale /usr/share/man ENV ARCH mips diff --git a/debian/experimental/x-mips/rx_and_build.sh b/debian/experimental/x-mips/rx_and_build.sh index 7351125..164a03f 100755 --- a/debian/experimental/x-mips/rx_and_build.sh +++ b/debian/experimental/x-mips/rx_and_build.sh @@ -69,7 +69,7 @@ set -o xtrace set +o xtrace # Bail ou if we don't have clang, print the version for dm to harvest and put in the status line -${CROSS_COMPILE}clang -v || exit 0 +clang -v || exit 0 if [ -z "$BUILD_CMD" ] ; then build_perf_clang From 9eb6328139846c9a55ff4c46693fcd671f7edc90 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Sat, 4 Oct 2025 09:10:42 +0100 Subject: [PATCH 4/6] debian:experimental:x-mips64: Fix Clang build Install Clang/LLVM and host packages. Remove the prefix ${CROSS_COMPILE} from clang. Signed-off-by: Leo Yan --- debian/experimental/x-mips64/Dockerfile | 5 +++++ debian/experimental/x-mips64/rx_and_build.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/experimental/x-mips64/Dockerfile b/debian/experimental/x-mips64/Dockerfile index 08e68bd..ae7b4f5 100644 --- a/debian/experimental/x-mips64/Dockerfile +++ b/debian/experimental/x-mips64/Dockerfile @@ -4,6 +4,11 @@ MAINTAINER Arnaldo Carvalho de Melo ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ apt-get -y install apt-utils make flex bison curl bc findutils build-essential cmake xmlto asciidoc vim strace exuberant-ctags && \ + apt-get -y install clang llvm libclang-dev llvm-dev libcap-dev \ + libunwind8-dev libssl-dev libslang2-dev python3-dev python3-setuptools \ + systemtap-sdt-dev libgtk2.0-dev liblzma-dev binutils-dev \ + libelf-dev libiberty-dev libdw-dev libaudit-dev libtraceevent-dev libbpf-dev \ + libperl-dev libnuma-dev libzstd-dev cmake xmlto asciidoc && \ apt-get -y clean && \ rm -rf /usr/share/doc /usr/share/gtk-doc /usr/share/locale /usr/share/man ENV ARCH mips diff --git a/debian/experimental/x-mips64/rx_and_build.sh b/debian/experimental/x-mips64/rx_and_build.sh index 7351125..164a03f 100755 --- a/debian/experimental/x-mips64/rx_and_build.sh +++ b/debian/experimental/x-mips64/rx_and_build.sh @@ -69,7 +69,7 @@ set -o xtrace set +o xtrace # Bail ou if we don't have clang, print the version for dm to harvest and put in the status line -${CROSS_COMPILE}clang -v || exit 0 +clang -v || exit 0 if [ -z "$BUILD_CMD" ] ; then build_perf_clang From 311b4a0c86c2ea7b72259321a9084d555eaeb516 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Sat, 4 Oct 2025 09:17:44 +0100 Subject: [PATCH 5/6] debian:experimental:x-mipsel: Fix Clang build Install Clang/LLVM and host packages. Remove the prefix ${CROSS_COMPILE} from clang. Signed-off-by: Leo Yan --- debian/experimental/x-mipsel/Dockerfile | 5 +++++ debian/experimental/x-mipsel/rx_and_build.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/experimental/x-mipsel/Dockerfile b/debian/experimental/x-mipsel/Dockerfile index a86f54c..7d02d9b 100644 --- a/debian/experimental/x-mipsel/Dockerfile +++ b/debian/experimental/x-mipsel/Dockerfile @@ -4,6 +4,11 @@ MAINTAINER Arnaldo Carvalho de Melo ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ apt-get -y install apt-utils make flex bison curl bc findutils build-essential cmake xmlto asciidoc vim strace exuberant-ctags && \ + apt-get -y install clang llvm libclang-dev llvm-dev libcap-dev \ + libunwind8-dev libssl-dev libslang2-dev python3-dev python3-setuptools \ + systemtap-sdt-dev libgtk2.0-dev liblzma-dev binutils-dev \ + libelf-dev libiberty-dev libdw-dev libaudit-dev libtraceevent-dev libbpf-dev \ + libperl-dev libnuma-dev libzstd-dev cmake xmlto asciidoc && \ apt-get -y clean && \ rm -rf /usr/share/doc /usr/share/gtk-doc /usr/share/locale /usr/share/man ENV ARCH mips diff --git a/debian/experimental/x-mipsel/rx_and_build.sh b/debian/experimental/x-mipsel/rx_and_build.sh index 7351125..164a03f 100755 --- a/debian/experimental/x-mipsel/rx_and_build.sh +++ b/debian/experimental/x-mipsel/rx_and_build.sh @@ -69,7 +69,7 @@ set -o xtrace set +o xtrace # Bail ou if we don't have clang, print the version for dm to harvest and put in the status line -${CROSS_COMPILE}clang -v || exit 0 +clang -v || exit 0 if [ -z "$BUILD_CMD" ] ; then build_perf_clang From 84e39fae9c14835506044e0b5e2b2db113e4ce73 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Mon, 6 Oct 2025 17:05:38 +0100 Subject: [PATCH 6/6] ubuntu:20.04:x-powerpc64el: Don't unset TARGET variable Don't unset TARGET variable as it is used later. Signed-off-by: Leo Yan --- ubuntu/20.04/x-powerpc64el/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu/20.04/x-powerpc64el/Dockerfile b/ubuntu/20.04/x-powerpc64el/Dockerfile index 65eea5a..226c0ff 100644 --- a/ubuntu/20.04/x-powerpc64el/Dockerfile +++ b/ubuntu/20.04/x-powerpc64el/Dockerfile @@ -41,7 +41,7 @@ RUN export ELFUTILS_VER=0.180 && \ rm -rf elfutils-${ELFUTILS_VER} && \ apt-get -y remove wget bzip2 && \ apt-get clean && \ - unset TARGET INSTALLDIR TARGETMACH CROSS CC LD AS && \ + unset INSTALLDIR TARGETMACH CROSS CC LD AS && \ mkdir -m 777 -p /git /tmp/build/perf /tmp/build/objtool /tmp/build/linux && \ groupadd -r toolsbuilder && \ useradd -m -r -g toolsbuilder toolsbuilder && \