File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 options :
2828 - arm
2929 - arm64
30+ - ppc64
3031 - x64
3132 - x86
3233 - wasm
Original file line number Diff line number Diff line change 2828 type : string
2929 required : true
3030 target_cpu :
31- description : Target (CPU arm|arm64|x64|x86|wasm)
31+ description : Target (CPU arm|arm64|ppc64| x64|x86|wasm)
3232 type : string
3333 required : true
3434 target_environment :
Original file line number Diff line number Diff line change 11#! /bin/bash -eu
22
33OS_NAMES=" android|emscripten|ios|linux|mac|win"
4- CPU_NAMES=" arm|arm64|x64|x86|wasm"
4+ CPU_NAMES=" arm|arm64|ppc64| x64|x86|wasm"
55ENV_NAMES=" catalyst|device|musl|simulator"
66OS_ENV_COMBINATIONS=" linux musl|ios (catalyst|device|simulator)"
77STEP_REGEX=" [0-9]"
Original file line number Diff line number Diff line change 1+ diff --git a/linux/sysroot_scripts/install-sysroot.py b/linux/sysroot_scripts/install-sysroot.py
2+ index 3158972..fadb431 100755
3+ --- a/linux/sysroot_scripts/install-sysroot.py
4+ +++ b/linux/sysroot_scripts/install-sysroot.py
5+ @@ -46,6 +46,7 @@ ARCH_TRANSLATIONS = {
6+ "mips": "mipsel",
7+ "mips64": "mips64el",
8+ "ppc64le": "ppc64el",
9+ + "ppc64": "ppc64el",
10+ }
11+
12+ DEFAULT_TARGET_PLATFORMS = {
13+ diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn
14+ index a6e20a0..b98f5dc 100644
15+ --- a/toolchain/linux/BUILD.gn
16+ +++ b/toolchain/linux/BUILD.gn
17+ @@ -312,12 +312,14 @@ gcc_toolchain("s390x") {
18+ }
19+
20+ gcc_toolchain("ppc64") {
21+ - cc = "gcc"
22+ - cxx = "g++"
23+ + toolprefix = "powerpc64le-linux-gnu-"
24+
25+ - readelf = "readelf"
26+ - nm = "nm"
27+ - ar = "ar"
28+ + cc = "${toolprefix}gcc"
29+ + cxx = "${toolprefix}g++"
30+ +
31+ + readelf = "${toolprefix}readelf"
32+ + nm = "${toolprefix}nm"
33+ + ar = "${toolprefix}ar"
34+ ld = cxx
35+
36+ toolchain_args = {
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ case "$TARGET_OS" in
7070
7171 sudo apt-get install -y $PACKAGES
7272
73- else
73+ else # i.e. not musl
7474
7575 case " $TARGET_CPU " in
7676 arm)
@@ -81,6 +81,14 @@ case "$TARGET_OS" in
8181 sudo apt-get install -y libc6-i386 gcc-10-multilib g++-10-aarch64-linux-gnu gcc-10-aarch64-linux-gnu
8282 ;;
8383
84+ ppc64)
85+ sudo apt-get install -y gcc-11-multilib g++-11-powerpc64le-linux-gnu gcc-11-powerpc64le-linux-gnu
86+ sudo update-alternatives --install /usr/bin/powerpc64le-linux-gnu-gcc powerpc64le-linux-gnu-gcc /usr/bin/powerpc64le-linux-gnu-gcc-11 100
87+ sudo update-alternatives --install /usr/bin/powerpc64le-linux-gnu-g++ powerpc64le-linux-gnu-g++ /usr/bin/powerpc64le-linux-gnu-g++-11 100
88+ sudo update-alternatives --set powerpc64le-linux-gnu-gcc /usr/bin/powerpc64le-linux-gnu-gcc-11
89+ sudo update-alternatives --set powerpc64le-linux-gnu-g++ /usr/bin/powerpc64le-linux-gnu-g++-11
90+ ;;
91+
8492 x86)
8593 sudo apt-get install -y g++-multilib
8694 ;;
Original file line number Diff line number Diff line change 33PATCHES=" $PWD /patches"
44SOURCE=" ${PDFium_SOURCE_DIR:- pdfium} "
55OS=" ${PDFium_TARGET_OS:? } "
6+ TARGET_CPU=" ${PDFium_TARGET_CPU:? } "
67TARGET_ENVIRONMENT=" ${PDFium_TARGET_ENVIRONMENT:- } "
78ENABLE_V8=${PDFium_ENABLE_V8:- false}
89
@@ -68,4 +69,10 @@ case "$TARGET_ENVIRONMENT" in
6869 ;;
6970esac
7071
72+ case " $TARGET_CPU " in
73+ ppc64)
74+ apply_patch " $PATCHES /ppc64/build.patch" build
75+ ;;
76+ esac
77+
7178popd
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ mkdir -p "$BUILD"
4040 ;;
4141 linux)
4242 echo " clang_use_chrome_plugins = false"
43+ if [ " $TARGET_CPU " == ' ppc64' ]; then
44+ echo ' is_clang = false'
45+ echo ' use_custom_libcxx = false'
46+ fi
4347 ;;
4448 mac)
4549 echo " clang_use_chrome_plugins = false"
Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ case "$OS" in
8686 SUFFIX=" -10"
8787 fi
8888 ;;
89+ ppc64)
90+ PREFIX=" powerpc64le-linux-gnu-"
91+ ;;
8992 x86)
9093 if [ " $TARGET_ENVIRONMENT " == " musl" ]; then
9194 PREFIX=" i686-linux-musl-"
You can’t perform that action at this time.
0 commit comments