Containerfile.rv64 (1595B)
1 # test/libc/musl/Containerfile.rv64 — produces a musl riscv64 sysroot 2 # tarball on stdout. Uses Alpine edge (riscv64 is in community ports; 3 # stable Alpine has not yet promoted it to a tier-1 release branch). 4 # 5 # Companion to ./Containerfile (aarch64). See that file for the design 6 # notes on what gets staged and why; arch-specific differences: 7 # - riscv64/alpine base 8 # - ld-musl-riscv64.so.1 as the dynamic loader (still aliased to 9 # libc.so so kit ld can link against it as a shared input). 10 # 11 # Note: alpine:edge floats. We pin via the digest-bearing tag at 12 # extract time when possible; the PROVENANCE record below records the 13 # resolved musl version so a regression in the upstream package is 14 # visible in test failures. 15 FROM docker.io/riscv64/alpine:edge 16 17 RUN apk add --no-cache musl-dev linux-headers 18 19 RUN mkdir -p /sysroot/lib /sysroot/include \ 20 && cp /usr/lib/crt1.o /sysroot/lib/ \ 21 && cp /usr/lib/Scrt1.o /sysroot/lib/ \ 22 && cp /usr/lib/rcrt1.o /sysroot/lib/ \ 23 && cp /usr/lib/crti.o /sysroot/lib/ \ 24 && cp /usr/lib/crtn.o /sysroot/lib/ \ 25 && cp /usr/lib/libc.a /sysroot/lib/ \ 26 && cp /usr/lib/libssp_nonshared.a /sysroot/lib/ \ 27 && cp /lib/ld-musl-riscv64.so.1 /sysroot/lib/ \ 28 && ln -s ld-musl-riscv64.so.1 /sysroot/lib/libc.so \ 29 && cp -r /usr/include/. /sysroot/include/ 30 31 RUN sh -c 'set -eu; \ 32 musl_ver=$(apk info -v musl-dev | head -1); \ 33 alpine_rel=$(cat /etc/alpine-release); \ 34 echo "alpine $alpine_rel $musl_ver" > /sysroot/PROVENANCE; \ 35 uname -m >> /sysroot/PROVENANCE' 36 37 ENTRYPOINT ["sh", "-c", "tar -C /sysroot -cf - ."]