Skip to content

Commit 7e76562

Browse files
authored
Merge pull request #4 from ElectrodeYT/ppc64-1
Add PPC64 target
2 parents 7541729 + 0680e8b commit 7e76562

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
libgcc:
1010
strategy:
1111
matrix:
12-
target_arch: [i386, i686, x86_64, arm, aarch64, loongarch64, loongarch64-softfloat, riscv64, riscv64-softfloat, m68k]
12+
target_arch: [i386, i686, x86_64, arm, aarch64, loongarch64, loongarch64-softfloat, riscv64, riscv64-softfloat, m68k, ppc64]
1313

1414
name: Build and upload libgcc for ${{matrix.target_arch}}
1515
runs-on: ubuntu-latest
@@ -35,6 +35,8 @@ jobs:
3535
echo "loongarch64-elf" >target-triplet ;; \
3636
riscv64-softfloat) \
3737
echo "riscv64-elf" >target-triplet ;; \
38+
ppc64) \
39+
echo "powerpc64-linux-gnu" >target-triplet ;; \
3840
*) \
3941
echo "${{matrix.target_arch}}-elf" >target-triplet ;; \
4042
esac
@@ -47,12 +49,18 @@ jobs:
4749
CFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -mabi=lp64s -mfpu=none -msimd=none";; \
4850
riscv64-softfloat) \
4951
CFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -march=rv64imac_zicsr_zifencei -mabi=lp64";; \
52+
ppc64) \
53+
CFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -m64 -mno-altivec -mno-vsx";; \
5054
esac; \
5155
case "${{matrix.target_arch}}" in \
5256
riscv64*) \
5357
CFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -mno-relax";; \
5458
esac; \
55-
CFLAGS_FOR_TARGET="-O2 -pipe -fPIC -Wa,--noexecstack $CFLAGS_FOR_TARGET" TARGET="$(cat target-triplet)" ./make_toolchain.sh
59+
case "${{matrix.target_arch}}" in \
60+
ppc64) \
61+
ADDITIONAL_GCC_CONFIGURE_FLAGS="--disable-threads --disable-shared";; \
62+
esac; \
63+
CFLAGS_FOR_TARGET="-O2 -pipe -fPIC -Wa,--noexecstack $CFLAGS_FOR_TARGET" TARGET="$(cat target-triplet)" ADDITIONAL_GCC_CONFIGURE_FLAGS="$ADDITIONAL_GCC_CONFIGURE_FLAGS" ./make_toolchain.sh
5664
5765
- name: Copy libgcc.a
5866
run: cp toolchain/lib/gcc/*/*/libgcc.a ./libgcc-${{matrix.target_arch}}.a
@@ -72,9 +80,11 @@ jobs:
7280
run: echo "TAG_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
7381

7482
- name: Tag new release
83+
if: github.ref == 'refs/heads/trunk' && !env.ACT
7584
run: git tag $TAG_DATE && git push --tags
7685

7786
- name: Create new release
87+
if: github.ref == 'refs/heads/trunk' && !env.ACT
7888
uses: softprops/action-gh-release@v2
7989
with:
8090
name: Release ${{ env.TAG_DATE }}

make_toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ chmod +x contrib/download_prerequisites
9898
cd ..
9999
mkdir build-gcc
100100
cd build-gcc
101-
../gcc-$GCCVERSION/configure CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
101+
../gcc-$GCCVERSION/configure CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers $ADDITIONAL_GCC_CONFIGURE_FLAGS
102102
$MAKE all-gcc
103103
$MAKE all-target-libgcc
104104
$MAKE install-gcc

0 commit comments

Comments
 (0)