chromium: fix build on ppc64le

This commit is contained in:
q66 2020-09-09 19:54:11 +02:00
parent 8f47108b6f
commit 7c923c5313
3 changed files with 123 additions and 7 deletions

View file

@ -0,0 +1,81 @@
Uses generic target for now. To use ppc64le, change --target to ppc64le-gnu
and add --enable-vsx, and change generic to ppc for the rtcd header.
From 18e6c5c55cfae0cfb458d8210d7bc709360a0e90 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Wed, 9 Sep 2020 19:08:25 +0200
Subject: [PATCH] enable generation of ppc64 libvpx bits
this doesn't update the gni file, that's done from
the template by running the appropriate scripts
---
third_party/libvpx/BUILD.gn | 4 ++++
third_party/libvpx/generate_gni.sh | 9 +++++++++
2 files changed, 13 insertions(+)
diff --git third_party/libvpx/BUILD.gn third_party/libvpx/BUILD.gn
index 7198e59..3300485 100644
--- third_party/libvpx/BUILD.gn
+++ third_party/libvpx/BUILD.gn
@@ -336,6 +336,8 @@ static_library("libvpx") {
} else {
sources = libvpx_srcs_arm64
}
+ } else if (current_cpu == "ppc64") {
+ sources = libvpx_srcs_ppc64
}
configs -= [ "//build/config/compiler:chromium_code" ]
@@ -401,6 +403,8 @@ static_library("libvp9rc") {
} else {
sources = libvpx_srcs_arm64
}
+ } else if (current_cpu == "ppc64") {
+ sources = libvpx_srcs_ppc64
}
sources += [ "//third_party/libvpx/source/libvpx/vp9/ratectrl_rtc.cc" ]
sources += [ "//third_party/libvpx/source/libvpx/vp9/ratectrl_rtc.h" ]
diff --git third_party/libvpx/generate_gni.sh third_party/libvpx/generate_gni.sh
index bcf84b0..8a3f4f1 100755
--- third_party/libvpx/generate_gni.sh
+++ third_party/libvpx/generate_gni.sh
@@ -361,6 +361,7 @@ gen_config_files linux/arm-neon-highbd "--target=armv7-linux-gcc ${all_platforms
gen_config_files linux/arm64-highbd "--target=armv8-linux-gcc ${all_platforms} ${HIGHBD}"
gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}"
gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}"
+gen_config_files linux/ppc64 "--target=generic-gnu $HIGHBD ${all_platforms}"
gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}"
gen_config_files win/arm64 "--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD}"
gen_config_files win/ia32 "--target=x86-win32-vs14 ${all_platforms} ${x86_platforms}"
@@ -386,6 +387,7 @@ lint_config linux/arm-neon-highbd
lint_config linux/arm64-highbd
lint_config linux/mipsel
lint_config linux/mips64el
+lint_config linux/ppc64
lint_config linux/generic
lint_config win/arm64
lint_config win/ia32
@@ -415,6 +417,7 @@ gen_rtcd_header linux/arm-neon-highbd armv7
gen_rtcd_header linux/arm64-highbd armv8
gen_rtcd_header linux/mipsel mipsel
gen_rtcd_header linux/mips64el mips64el
+gen_rtcd_header linux/ppc64 generic
gen_rtcd_header linux/generic generic
gen_rtcd_header win/arm64 armv8
gen_rtcd_header win/ia32 x86 "${require_sse2}"
@@ -500,6 +503,12 @@ if [ -z $ONLY_CONFIGS ]; then
echo "MIPS64 source list is identical to MIPS source list. No need to generate it."
+ echo "Generate ppc64 source list."
+ config=$(print_config_basic linux/ppc64)
+ make_clean
+ make libvpx_srcs.txt target=libs $config > /dev/null
+ convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_ppc64
+
echo "Generate NaCl source list."
config=$(print_config_basic nacl)
make_clean
--
2.28.0

View file

@ -0,0 +1,18 @@
--- third_party/swiftshader/third_party/llvm-10.0/BUILD.gn
+++ third_party/swiftshader/third_party/llvm-10.0/BUILD.gn
@@ -574,6 +574,7 @@ swiftshader_llvm_source_set("swiftshader
"llvm/lib/MC/MCAsmInfoCOFF.cpp",
"llvm/lib/MC/MCAsmInfoDarwin.cpp",
"llvm/lib/MC/MCAsmInfoELF.cpp",
+ "llvm/lib/MC/MCAsmInfoXCOFF.cpp",
"llvm/lib/MC/MCAsmMacro.cpp",
"llvm/lib/MC/MCAsmStreamer.cpp",
"llvm/lib/MC/MCAssembler.cpp",
@@ -629,6 +630,7 @@ swiftshader_llvm_source_set("swiftshader
"llvm/lib/MC/MCWinCOFFStreamer.cpp",
"llvm/lib/MC/MCWinEH.cpp",
"llvm/lib/MC/MCXCOFFStreamer.cpp",
+ "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp",
"llvm/lib/MC/MachObjectWriter.cpp",
"llvm/lib/MC/StringTableBuilder.cpp",
"llvm/lib/MC/SubtargetFeature.cpp",

View file

@ -72,6 +72,10 @@ post_patch() {
sed -i '/config("compiler")/ a cflags_cc = [ "-fno-delete-null-pointer-checks" ]' \
build/config/linux/BUILD.gn
fi
# prevent annoying errors when regenerating gni
vsed -i 's,^update_readme$,#update_readme,' \
third_party/libvpx/generate_gni.sh
}
do_configure() {
local system="" conf=()
@ -82,6 +86,26 @@ do_configure() {
export CXX=clang++
fi
export LDFLAGS="-pthread"
# compile gn early, so it can be used to generate gni stuff
AR="ar" CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD LD=$CXX_FOR_BUILD \
python2 tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
# we need to generate ppc64 stuff for libvpx as it's not shipped
# this has to be done before unbundling, but after gn is built
# comment out if we switch back to system libvpx again later
case "$XBPS_TARGET_MACHINE" in
ppc64*)
pushd third_party/libvpx
mkdir -p source/config/linux/ppc64
# need PATH to find gn
PATH="${wrksrc}/out/Release:$PATH" ./generate_gni.sh || \
msg_error "failed to generate libvpx gni"
popd
;;
esac
# Use system-provided libraries.
# TODO: use_system_hunspell (upstream changes needed).
# TODO: use_system_libsrtp.
@ -227,13 +251,6 @@ do_configure() {
ppc64*) conf+=( 'target_cpu="ppc64"' ) ;;
esac
export LDFLAGS="-pthread"
AR="ar" CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD LD=$CXX_FOR_BUILD \
python2 tools/gn/bootstrap/bootstrap.py -s -v \
--gn-gen-args "${conf[*]}"
out/Release/gn gen out/Release --args="${conf[*]}"
}
do_build() {