From 41abc9699af6755cf9956bebeed6e0780c6989e8 Mon Sep 17 00:00:00 2001 From: odrling Date: Tue, 30 Jan 2024 19:41:56 +0100 Subject: [PATCH] ci: build from chimera cross toolchain is easily available and useable without me building it in another repo --- Containerfile | 15 ++++++++++++--- ...ux-musl.txt => aarch64-chimera-linux-musl.txt} | 3 +-- ci/build.sh | 14 +++++++------- ci/x86_64-unknown-linux-musl.txt | 13 ------------- 4 files changed, 20 insertions(+), 25 deletions(-) rename ci/{aarch64-unknown-linux-musl.txt => aarch64-chimera-linux-musl.txt} (63%) delete mode 100644 ci/x86_64-unknown-linux-musl.txt diff --git a/Containerfile b/Containerfile index ad3b82f..10105d1 100644 --- a/Containerfile +++ b/Containerfile @@ -1,10 +1,19 @@ +FROM docker.io/amd64/alpine AS bootstrap +RUN apk add tar gzip curl +RUN curl https://repo.chimera-linux.org/live/20240122/chimera-linux-x86_64-ROOTFS-20240122-bootstrap.tar.gz -o chimera.tar.gz && \ + echo 'b57b4c84ef1b8c5c628e84aa9f1b80863d748440643041414102b9ee19b0a5e4 chimera.tar.gz' | sha256sum -c && \ + mkdir /chimera && tar xf chimera.tar.gz -C /chimera + +FROM scratch AS builder ARG ARCH -FROM ghcr.io/odrling/gentoo-crossdev-images:$ARCH-llvm17 AS builder + +COPY --from=bootstrap /chimera / + +RUN apk add musl-devel meson clang clang-rt-devel llvm-devel-static git lld COPY . /dakara_check -ARG ARCH -RUN cd /dakara_check && /dakara_check/ci/build.sh --cross-file ci/$ARCH-unknown-linux-musl.txt +RUN cd /dakara_check && /dakara_check/ci/build.sh FROM alpine diff --git a/ci/aarch64-unknown-linux-musl.txt b/ci/aarch64-chimera-linux-musl.txt similarity index 63% rename from ci/aarch64-unknown-linux-musl.txt rename to ci/aarch64-chimera-linux-musl.txt index ca8ae10..2ad0fb8 100644 --- a/ci/aarch64-unknown-linux-musl.txt +++ b/ci/aarch64-chimera-linux-musl.txt @@ -1,9 +1,8 @@ [binaries] -c = 'aarch64-unknown-linux-musl-clang' +c = 'aarch64-chimera-linux-musl-clang' ld = 'ld.lld' objcopy = 'llvm-objcopy' strip = 'llvm-strip' -pkg-config = 'aarch64-unknown-linux-musl-pkg-config' [host_machine] system = 'linux' diff --git a/ci/build.sh b/ci/build.sh index 1f6f021..6f251df 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -1,12 +1,12 @@ #!/bin/sh -export PATH="$PATH:/usr/lib/llvm/17/bin" -export CC=clang -export CC_LD=lld -export UBSAN_OPTIONS="signed-integer-overflow" -export CFLAGS="-D_FORTIFY_SOURCE=3" -export LDFLAGS="-Wl,-O1 -Wl,--as-needed" +export LDFLAGS="-Wl,-Bsymbolic" -meson setup build --buildtype release --strip -Ddefault_library=static -Dprefer_static=true -Dffmpeg:programs=disabled -Dffmpeg:tests=disabled -Dffmpeg:encoders=disabled -Dffmpeg:muxers=disabled -Dffmpeg:avfilter=disabled -Dffmpeg:avdevice=disabled -Dffmpeg:postproc=disabled -Dffmpeg:swresample=disabled -Dffmpeg:swscale=disabled -Dffmpeg:decoders=disabled -Dffmpeg:aac_decoder=enabled -Dffmpeg:aac_fixed_decoder=enabled -Dffmpeg:aac_latm_decoder=enabled -Dffmpeg:version3=enabled "$@" +if [ "$ARCH" != x86_64 ]; then + apk add "base-cross-$ARCH" "clang-rt-cross-$ARCH" "clang-rt-crt-cross-$ARCH" + extra_args="--cross-file ci/$ARCH-chimera-linux-musl.txt" +fi + +meson setup build --buildtype release --strip -Ddefault_library=static -Dprefer_static=true -Dffmpeg:programs=disabled -Dffmpeg:tests=disabled -Dffmpeg:encoders=disabled -Dffmpeg:muxers=disabled -Dffmpeg:avfilter=disabled -Dffmpeg:avdevice=disabled -Dffmpeg:postproc=disabled -Dffmpeg:swresample=disabled -Dffmpeg:swscale=disabled -Dffmpeg:decoders=disabled -Dffmpeg:aac_decoder=enabled -Dffmpeg:aac_fixed_decoder=enabled -Dffmpeg:aac_latm_decoder=enabled -Dffmpeg:version3=enabled $extra_args meson compile -C build meson install -C build --destdir=../dest/ diff --git a/ci/x86_64-unknown-linux-musl.txt b/ci/x86_64-unknown-linux-musl.txt deleted file mode 100644 index 151931d..0000000 --- a/ci/x86_64-unknown-linux-musl.txt +++ /dev/null @@ -1,13 +0,0 @@ -[binaries] -c = 'x86_64-unknown-linux-musl-clang' -ld = 'ld.lld' -objcopy = 'llvm-objcopy' -strip = 'llvm-strip' -pkg-config = 'x86_64-unknown-linux-musl-pkg-config' - -[host_machine] -system = 'linux' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' -