Skip to content

Commit 21824e4

Browse files
committed
chore: support for ppc64 (big-endian)
1 parent 04bce88 commit 21824e4

6 files changed

Lines changed: 24 additions & 5 deletions

File tree

.docker/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ run_debian:
3434
@docker run $(COMMON_RUN_OPTS) $(IMAGE_DEBIAN)
3535

3636
build_alpine:
37-
docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64le,s390x,arm,i386 -t $(IMAGE_ALPINE) .
37+
docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64,ppc64le,s390x,arm,i386 -t $(IMAGE_ALPINE) .
3838

3939
run_alpine:
4040
@docker run $(COMMON_RUN_OPTS) $(IMAGE_ALPINE)
4141

4242
build_alpine_newarch:
43-
docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=loongarch64 -t $(IMAGE_ALPINE_NEWARCH) .
43+
docker buildx build -f Dockerfile.alpine --build-arg TARGET_ARCHS=ppc64 -t $(IMAGE_ALPINE_NEWARCH) .
4444

4545
run_alpine_newarch:
4646
@docker run $(COMMON_RUN_OPTS) $(IMAGE_ALPINE_NEWARCH)

.docker/build-linux.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ esac
186186
case "-$BUILD_TYPE-" in
187187
*-static-*)
188188
case "$CROSS_ARCH" in
189+
ppc64)
190+
# https://github.com/rui314/mold/issues/1498
191+
CMAKE_ARGS="${CMAKE_ARGS} -DDISABLE_MOLD=1"
192+
export LDFLAGS="${LDFLAGS} -fuse-ld=lld"
193+
;;
189194
*)
190195
export LDFLAGS="${LDFLAGS} -fuse-ld=mold"
191196
;;

.docker/install-static-libs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ PARALLEL_HASHMAP_TARBALL="parallel-hashmap-${PARALLEL_HASHMAP_VERSION}.tar.gz"
9292
use_lib() {
9393
local lib="$1"
9494
case "$CARCH" in
95-
ppc64le|arm)
95+
ppc64*|arm)
9696
case "$lib" in
9797
libunwind|libdwarf|cpptrace)
9898
return 1
@@ -276,7 +276,7 @@ for target_arch in ${TARGET_ARCH_STR//,/ }; do
276276
# COMPILERS="clang clang-lto clang-minsize-lto gcc"
277277
case "$CARCH" in
278278
# https://github.com/llvm/llvm-project/issues/150913
279-
ppc64le)
279+
ppc64*)
280280
COMPILERS="gcc"
281281
;;
282282
*)

.docker/install-toolchain.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ for target_arch in ${TARGET_ARCH_STR//,/ }; do
112112
GCC_CONFIGURE_ARGS="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
113113
TARGET="arm-linux-musleabihf"
114114
;;
115+
ppc64)
116+
GCC_CONFIGURE_ARGS="--with-abi=elfv2"
117+
;;
115118
s390x)
116119
GCC_CONFIGURE_ARGS="--with-arch=z10"
117120
;;

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,17 @@ jobs:
363363
build_type: gcc-release-lto-ninja-static
364364
cross_arch: ppc64le
365365

366+
- build_arch: amd64
367+
build_dist: alpine
368+
build_type: gcc-release-ninja-static
369+
cross_arch: ppc64
370+
371+
######## blocked by https://github.com/rui314/mold/issues/1498
372+
# - build_arch: amd64
373+
# build_dist: alpine
374+
# build_type: gcc-release-lto-ninja-static
375+
# cross_arch: ppc64
376+
366377
######## no libressl support
367378
# - build_arch: amd64
368379
# build_dist: alpine

.github/workflows/docker-run-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
-f .docker/Dockerfile.${{ inputs.build_dist }} \
6868
-t dwarfs-linux-build-${{ inputs.build_dist }} \
6969
--build-arg ARCH=${{ inputs.build_arch }} \
70-
${{ inputs.build_arch == 'amd64' && '--build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64le,s390x,arm,i386' || '' }} \
70+
${{ inputs.build_arch == 'amd64' && '--build-arg TARGET_ARCHS=x86_64,aarch64,loongarch64,riscv64,ppc64,ppc64le,s390x,arm,i386' || '' }} \
7171
.docker
7272
7373
- name: Run Build

0 commit comments

Comments
 (0)