Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f95f82e

Browse files
rucoderclaude
andcommitted
build: migrate consumers to musl-cross-make cross-compilers
Migrate pillar, optee-os, and bsp-imx to use cross-compiler toolchains built from musl-cross-make (added in a previous PR). This replaces the old Alpine aports bootstrap approach. Key changes: - Remove old pkg/cross-compilers (aports bootstrap) - Remove cross-compilers from Makefile PKGS lists - Update consumers to use new toolchain from build-tools/cross-compilers with prefix {arch}-linux-musl- (e.g. aarch64-linux-musl-gcc) - Eliminate QEMU-based sysroot extraction using eve-cross-sysroot.sh which extracts target-arch packages from the eve-alpine mirror on the build host without needing a target-arch container Depends on: eve-cross-sysroot.sh in pkg/alpine (commit 1 of this PR) and build-tools/cross-compilers (separate PR lf-edge#5752) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Mikhail Malyshev <[email protected]>
1 parent 857f54a commit f95f82e

9 files changed

Lines changed: 50 additions & 249 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ else
484484
endif
485485

486486
PKGS_riscv64=pkg/ipxe pkg/mkconf pkg/mkimage-iso-efi pkg/grub \
487-
pkg/mkimage-raw-efi pkg/uefi pkg/u-boot pkg/cross-compilers \
487+
pkg/mkimage-raw-efi pkg/uefi pkg/u-boot \
488488
pkg/debug pkg/dom0-ztools pkg/gpt-tools pkg/storage-init pkg/mkrootfs-squash \
489489
pkg/bsp-imx pkg/optee-os pkg/recovertpm pkg/bpftrace
490490
# alpine-base and alpine must be the first packages to build
@@ -498,8 +498,8 @@ PKGS=pkg/alpine $(PKGS_$(ZARCH))
498498
# if you need a pkg to be loaded into docker, in addition to the lkt cache, add it here
499499
PKGS_DOCKER_LOAD=mkconf mkimage-iso-efi mkimage-raw-efi mkrootfs-ext4 mkrootfs-squash
500500
# these packages should exists for HOSTARCH as well as for ZARCH
501-
# alpine-base, alpine and cross-compilers are dependencies for others
502-
PKGS_HOSTARCH=alpine-base alpine cross-compilers $(PKGS_DOCKER_LOAD)
501+
# alpine-base and alpine are dependencies for others
502+
PKGS_HOSTARCH=alpine-base alpine $(PKGS_DOCKER_LOAD)
503503
# Package dependencies auto-generated by the build system
504504
-include pkg-deps.mk
505505

pkg/bsp-imx/Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ ARG BUILD_PKGS_BASE
2020
RUN BUILD_PKGS="${BUILD_PKGS_BASE}" eve-alpine-deploy.sh
2121

2222
# hadolint ignore=DL3029
23-
FROM --platform=${BUILDPLATFORM} lfedge/eve-cross-compilers:d794c049baf50389be1dd48da056fb2472574c3e AS cross-compilers
23+
FROM --platform=${BUILDPLATFORM} lfedge/eve-cross-compilers:gcc-14.2.0-alpine-3.22-40a25095 AS cross-compilers
2424

25-
# will use several packages from target arch and copy them to sysroot
25+
# pull target-arch eve-alpine for its mirror (no RUN = no QEMU needed)
2626
# hadolint ignore=DL3006
27-
FROM ${EVE_ALPINE_IMAGE} AS cross-compile-libs
28-
ENV PKGS="musl-dev libgcc libintl libuuid libtirpc libblkid"
29-
RUN eve-alpine-deploy.sh
27+
FROM ${EVE_ALPINE_IMAGE} AS target-alpine
3028

3129
# adjust EVE_TARGET_ARCH for cross-compiler
3230
FROM build-cross AS build-cross-target-amd64
@@ -38,11 +36,16 @@ ENV EVE_TARGET_ARCH=riscv64
3836

3937
# hadolint ignore=DL3006
4038
FROM build-cross-target-${TARGETARCH} AS build-cross-target
41-
ENV CROSS_COMPILE_ENV="${EVE_TARGET_ARCH}-alpine-linux-musl-"
42-
COPY --from=cross-compilers /packages /packages
43-
# hadolint ignore=DL3018
44-
RUN apk add --no-cache --allow-untrusted -X /packages build-base-"${EVE_TARGET_ARCH}"
45-
COPY --from=cross-compile-libs /out/ /usr/"${EVE_TARGET_ARCH}"-alpine-linux-musl/
39+
ENV CROSS_COMPILE_ENV="${EVE_TARGET_ARCH}-linux-musl-"
40+
# install musl.cc toolchain
41+
COPY --from=cross-compilers /toolchains/"${EVE_TARGET_ARCH}"-linux-musl-cross /opt/cross
42+
ENV PATH="/opt/cross/bin:${PATH}"
43+
# extract target-arch sysroot from eve-alpine mirror (no QEMU)
44+
COPY --from=target-alpine /mirror /target-mirror
45+
RUN EVE_TARGET_ARCH="${EVE_TARGET_ARCH}" \
46+
PKGS="musl-dev libgcc libintl libuuid libtirpc libblkid" \
47+
eve-cross-sysroot.sh
48+
RUN cp -a /out/* /opt/cross/"${EVE_TARGET_ARCH}"-linux-musl/
4649

4750
# cross-compilers
4851
FROM build-cross-target AS target-arm64-build-amd64

pkg/cross-compilers/Dockerfile

Lines changed: 0 additions & 121 deletions
This file was deleted.

pkg/cross-compilers/build.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

pkg/cross-compilers/patches/aports/0001-only-cross-compile-prepare.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

pkg/cross-compilers/patches/aports/0002-adjust-sysroot.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.

pkg/cross-compilers/patches/aports/0003-change-musl-mirror.patch

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)