chore: support for ppc64 (big-endian)

This commit is contained in:
Marcus Holland-Moritz 2025-08-12 09:16:51 +02:00
parent 3bd97c5c8b
commit 33c0b273e9
7 changed files with 27 additions and 6 deletions

View File

@ -34,13 +34,13 @@ run_debian:
@docker run $(COMMON_RUN_OPTS) $(IMAGE_DEBIAN) @docker run $(COMMON_RUN_OPTS) $(IMAGE_DEBIAN)
build_alpine: build_alpine:
docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64le,s390x,arm,i386 -t $(IMAGE_ALPINE) . docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64,ppc64le,s390x,arm,i386 -t $(IMAGE_ALPINE) .
run_alpine: run_alpine:
@docker run $(COMMON_RUN_OPTS) $(IMAGE_ALPINE) @docker run $(COMMON_RUN_OPTS) $(IMAGE_ALPINE)
build_alpine_newarch: build_alpine_newarch:
docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=loongarch64 -t $(IMAGE_ALPINE_NEWARCH) . docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=ppc64 -t $(IMAGE_ALPINE_NEWARCH) .
run_alpine_newarch: run_alpine_newarch:
@docker run $(COMMON_RUN_OPTS) $(IMAGE_ALPINE_NEWARCH) @docker run $(COMMON_RUN_OPTS) $(IMAGE_ALPINE_NEWARCH)

View File

@ -186,6 +186,11 @@ esac
case "-$BUILD_TYPE-" in case "-$BUILD_TYPE-" in
*-static-*) *-static-*)
case "$CROSS_ARCH" in case "$CROSS_ARCH" in
ppc64)
# https://github.com/rui314/mold/issues/1498
CMAKE_ARGS="${CMAKE_ARGS} -DDISABLE_MOLD=1"
export LDFLAGS="${LDFLAGS} -fuse-ld=lld"
;;
*) *)
export LDFLAGS="${LDFLAGS} -fuse-ld=mold" export LDFLAGS="${LDFLAGS} -fuse-ld=mold"
;; ;;

View File

@ -92,7 +92,7 @@ PARALLEL_HASHMAP_TARBALL="parallel-hashmap-${PARALLEL_HASHMAP_VERSION}.tar.gz"
use_lib() { use_lib() {
local lib="$1" local lib="$1"
case "$CARCH" in case "$CARCH" in
ppc64le|arm) ppc64*|arm)
case "$lib" in case "$lib" in
libunwind|libdwarf|cpptrace) libunwind|libdwarf|cpptrace)
return 1 return 1
@ -276,7 +276,7 @@ for target_arch in ${TARGET_ARCH_STR//,/ }; do
# COMPILERS="clang clang-lto clang-minsize-lto gcc" # COMPILERS="clang clang-lto clang-minsize-lto gcc"
case "$CARCH" in case "$CARCH" in
# https://github.com/llvm/llvm-project/issues/150913 # https://github.com/llvm/llvm-project/issues/150913
ppc64le) ppc64*)
COMPILERS="gcc" COMPILERS="gcc"
;; ;;
*) *)

View File

@ -112,6 +112,9 @@ for target_arch in ${TARGET_ARCH_STR//,/ }; do
GCC_CONFIGURE_ARGS="--with-arch=armv6 --with-fpu=vfp --with-float=hard" GCC_CONFIGURE_ARGS="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
TARGET="arm-linux-musleabihf" TARGET="arm-linux-musleabihf"
;; ;;
ppc64)
GCC_CONFIGURE_ARGS="--with-abi=elfv2"
;;
s390x) s390x)
GCC_CONFIGURE_ARGS="--with-arch=z10" GCC_CONFIGURE_ARGS="--with-arch=z10"
;; ;;

View File

@ -363,6 +363,19 @@ jobs:
build_type: gcc-release-lto-ninja-static build_type: gcc-release-lto-ninja-static
cross_arch: ppc64le cross_arch: ppc64le
- build_arch: amd64
build_dist: alpine
build_type: gcc-release-ninja-static
cross_arch: ppc64
skip_fuse_tests: true # big-endian FUSE driver won't work on little-endian
######## blocked by https://github.com/rui314/mold/issues/1498
# - build_arch: amd64
# build_dist: alpine
# build_type: gcc-release-lto-ninja-static
# cross_arch: ppc64
# skip_fuse_tests: true # big-endian FUSE driver won't work on little-endian
######## no libressl support ######## no libressl support
# - build_arch: amd64 # - build_arch: amd64
# build_dist: alpine # build_dist: alpine

View File

@ -67,7 +67,7 @@ jobs:
-f .docker/Dockerfile.${{ inputs.build_dist }} \ -f .docker/Dockerfile.${{ inputs.build_dist }} \
-t dwarfs-linux-build-${{ inputs.build_dist }} \ -t dwarfs-linux-build-${{ inputs.build_dist }} \
--build-arg ARCH=${{ inputs.build_arch }} \ --build-arg ARCH=${{ inputs.build_arch }} \
${{ inputs.build_arch == 'amd64' && '--build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64le,s390x,arm,i386' || '' }} \ ${{ inputs.build_arch == 'amd64' && '--build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64,ppc64le,s390x,arm,i386' || '' }} \
.docker .docker
- name: Run Build - name: Run Build

View File

@ -1066,7 +1066,7 @@ if(STATIC_BUILD_DO_NOT_USE OR WIN32)
list(APPEND UNIVERSAL_TARGETS dwarfsfuseextract) list(APPEND UNIVERSAL_TARGETS dwarfsfuseextract)
endif() endif()
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i386|x86_64|AMD64|aarch64|ppc64le|arm)$") if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i386|x86_64|AMD64|aarch64|ppc64|ppc64le|arm)$")
find_program(UPX_EXE upx upx.exe PATHS "c:/bin" DOC "ultimate packer for executables") find_program(UPX_EXE upx upx.exe PATHS "c:/bin" DOC "ultimate packer for executables")
endif() endif()