mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-31 18:02:57 +02:00
chromium: add support for ppc64le*
This commit is contained in:
parent
c29a883c00
commit
e6a1580672
5 changed files with 3908 additions and 5 deletions
179
srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
Normal file
179
srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
Normal file
|
@ -0,0 +1,179 @@
|
|||
diff --git sandbox/linux/bpf_dsl/seccomp_macros.h sandbox/linux/bpf_dsl/seccomp_macros.h
|
||||
index a6aec544e..2a4a7f1bc 100644
|
||||
--- sandbox/linux/bpf_dsl/seccomp_macros.h
|
||||
+++ sandbox/linux/bpf_dsl/seccomp_macros.h
|
||||
@@ -16,7 +16,7 @@
|
||||
#if defined(__mips__)
|
||||
// sys/user.h in eglibc misses size_t definition
|
||||
#include <stddef.h>
|
||||
-#elif defined(__powerpc64__)
|
||||
+#elif defined(__powerpc64__) && defined(__GLIBC__)
|
||||
// Manually define greg_t on ppc64
|
||||
typedef unsigned long long greg_t;
|
||||
#endif
|
||||
@@ -361,11 +361,11 @@ typedef struct pt_regs regs_struct;
|
||||
#define SECCOMP_ARCH AUDIT_ARCH_PPC64
|
||||
#endif
|
||||
|
||||
-#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
|
||||
+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
|
||||
|
||||
#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
|
||||
#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
|
||||
-#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
|
||||
+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
|
||||
#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
|
||||
#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
|
||||
#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
|
||||
diff --git sandbox/linux/seccomp-bpf/syscall.cc sandbox/linux/seccomp-bpf/syscall.cc
|
||||
index d53a7ff56..c290f0e92 100644
|
||||
--- sandbox/linux/seccomp-bpf/syscall.cc
|
||||
+++ sandbox/linux/seccomp-bpf/syscall.cc
|
||||
@@ -499,9 +499,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
|
||||
// Same as MIPS, need to invert ret and set error register (cr0.SO)
|
||||
if (ret_val <= -1 && ret_val >= -4095) {
|
||||
ret_val = -ret_val;
|
||||
- ctx->uc_mcontext.regs->ccr |= (1 << 28);
|
||||
+ ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
|
||||
} else {
|
||||
- ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
|
||||
+ ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
|
||||
}
|
||||
#endif
|
||||
SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
|
||||
diff --git third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
|
||||
index cdce9bf8..73d77dda 100644
|
||||
--- third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
|
||||
+++ third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
// The following platforms have an implementation of a hardware counter.
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
|
||||
- defined(__powerpc__) || defined(__ppc__) || \
|
||||
+ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
|
||||
defined(_M_IX86) || defined(_M_X64)
|
||||
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
|
||||
#else
|
||||
diff --git third_party/breakpad/BUILD.gn third_party/breakpad/BUILD.gn
|
||||
index f9a60e37..25f3a0b7 100644
|
||||
--- third_party/breakpad/BUILD.gn
|
||||
+++ third_party/breakpad/BUILD.gn
|
||||
@@ -637,6 +637,7 @@ if (is_linux || is_android) {
|
||||
|
||||
if (current_cpu == "ppc64") {
|
||||
defines = [ "HAVE_GETCONTEXT" ]
|
||||
+ libs += [ "ucontext" ]
|
||||
} else {
|
||||
sources += [
|
||||
"breakpad/src/common/linux/breakpad_getcontext.S"
|
||||
diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
|
||||
index 03afec7a..0264ecf1 100644
|
||||
--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
|
||||
+++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
|
||||
@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
|
||||
|
||||
#elif defined(__powerpc64__)
|
||||
|
||||
+#include <asm/elf.h>
|
||||
+#include <asm/ptrace.h>
|
||||
+
|
||||
uintptr_t ThreadInfo::GetInstructionPointer() const {
|
||||
return mcontext.gp_regs[PT_NIP];
|
||||
}
|
||||
@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
|
||||
out->ctr = mcontext.gp_regs[PT_CTR];
|
||||
|
||||
for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
|
||||
- out->float_save.fpregs[i] = mcontext.fp_regs[i];
|
||||
+ out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
|
||||
|
||||
- out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
|
||||
+ out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
|
||||
|
||||
for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
|
||||
out->vector_save.save_vr[i] = \
|
||||
diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
|
||||
index 1090470f..e580233d 100644
|
||||
--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
|
||||
+++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
|
||||
@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
|
||||
|
||||
#elif defined(__powerpc64__)
|
||||
|
||||
+#include <asm/elf.h>
|
||||
+#include <asm/ptrace.h>
|
||||
+
|
||||
uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
|
||||
return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
|
||||
}
|
||||
@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
|
||||
out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
|
||||
|
||||
for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
|
||||
- out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
|
||||
+ out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
|
||||
|
||||
- out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
|
||||
+ out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
|
||||
|
||||
for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
|
||||
out->vector_save.save_vr[i] =
|
||||
diff --git third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
||||
index 5a7ab50c..ee8b858c 100644
|
||||
--- third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
||||
+++ third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
|
||||
@@ -105,6 +105,11 @@
|
||||
#define PR_SET_PTRACER 0x59616d61
|
||||
#endif
|
||||
|
||||
+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
|
||||
+#if defined(__powerpc64__) && !defined(PT_NIP)
|
||||
+#define PT_NIP 32
|
||||
+#endif
|
||||
+
|
||||
namespace google_breakpad {
|
||||
|
||||
namespace {
|
||||
diff --git third_party/crashpad/crashpad/snapshot/linux/signal_context.h third_party/crashpad/crashpad/snapshot/linux/signal_context.h
|
||||
index 8e335a09..b2a0f155 100644
|
||||
--- third_party/crashpad/crashpad/snapshot/linux/signal_context.h
|
||||
+++ third_party/crashpad/crashpad/snapshot/linux/signal_context.h
|
||||
@@ -469,7 +469,7 @@ struct MContext64 {
|
||||
SignalThreadContext64 gp_regs;
|
||||
SignalFloatContext64 fp_regs;
|
||||
SignalVectorContext64 *v_regs;
|
||||
- int64_t vmx_reserve[69];
|
||||
+ int64_t vmx_reserve[101];
|
||||
};
|
||||
|
||||
struct ContextTraits64 : public Traits64 {
|
||||
diff --git third_party/crashpad/crashpad/util/linux/thread_info.h third_party/crashpad/crashpad/util/linux/thread_info.h
|
||||
index dea0d1f3..b203e5b2 100644
|
||||
--- third_party/crashpad/crashpad/util/linux/thread_info.h
|
||||
+++ third_party/crashpad/crashpad/util/linux/thread_info.h
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#if defined(ARCH_CPU_PPC64_FAMILY)
|
||||
#include <sys/ucontext.h>
|
||||
+#include <asm/ptrace.h>
|
||||
#endif
|
||||
|
||||
namespace crashpad {
|
||||
diff --git third_party/lss/linux_syscall_support.h third_party/lss/linux_syscall_support.h
|
||||
index 9955ce44..4c1cc488 100644
|
||||
--- third_party/lss/linux_syscall_support.h
|
||||
+++ third_party/lss/linux_syscall_support.h
|
||||
@@ -4216,9 +4216,13 @@ struct kernel_statfs {
|
||||
}
|
||||
#endif
|
||||
#if defined(__NR_fstatat64)
|
||||
+ // musl does #define fstatat64 fstatat
|
||||
+ #undef fstatat64
|
||||
LSS_INLINE _syscall4(int, fstatat64, int, d,
|
||||
const char *, p,
|
||||
struct kernel_stat64 *, b, int, f)
|
||||
+ // set it back like it was
|
||||
+ #define fstatat64 fstatat
|
||||
#endif
|
||||
#if defined(__NR_waitpid)
|
||||
// waitpid is polyfilled below when not available.
|
|
@ -0,0 +1,37 @@
|
|||
From 3a3effdd81e97bfc4f2698cd1f41b008355b0469 Mon Sep 17 00:00:00 2001
|
||||
From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Date: Tue, 26 May 2020 16:34:45 +0000
|
||||
Subject: [PATCH] scoped_nss_types.h: Include <certt.h> instead of <nss/certt.h>
|
||||
|
||||
Follow-up to commit 701cae5de ("Introduce a function to format a DER-encoded
|
||||
SPKI for UI").
|
||||
|
||||
That is the format used by other files that include <certt.h>, and the
|
||||
pkg-config configuration already passes -I/path/to/nss to the compiler.
|
||||
|
||||
This can potentially fix the non-sysroot build, as the NSS headers might be
|
||||
installed in e.g. /usr/include/nss3 rather than /usr/include/nss.
|
||||
|
||||
Change-Id: I0461a7a7f8c93459f2281ea71c96434a74687ee8
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214390
|
||||
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Commit-Queue: David Benjamin <davidben@chromium.org>
|
||||
Reviewed-by: David Benjamin <davidben@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#771840}
|
||||
---
|
||||
|
||||
diff --git a/crypto/scoped_nss_types.h b/crypto/scoped_nss_types.h
|
||||
index 2a3a6e1..0a663ea 100644
|
||||
--- crypto/scoped_nss_types.h
|
||||
+++ crypto/scoped_nss_types.h
|
||||
@@ -5,9 +5,9 @@
|
||||
#ifndef CRYPTO_SCOPED_NSS_TYPES_H_
|
||||
#define CRYPTO_SCOPED_NSS_TYPES_H_
|
||||
|
||||
+#include <certt.h>
|
||||
#include <keyhi.h>
|
||||
#include <nss.h>
|
||||
-#include <nss/certt.h>
|
||||
#include <pk11pub.h>
|
||||
#include <plarena.h>
|
||||
|
22
srcpkgs/chromium/patches/system-nodejs.patch
Normal file
22
srcpkgs/chromium/patches/system-nodejs.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
diff --git third_party/node/node.py third_party/node/node.py
|
||||
index 8097e2c49..10e6a16ea 100755
|
||||
--- third_party/node/node.py
|
||||
+++ third_party/node/node.py
|
||||
@@ -10,11 +10,12 @@ import sys
|
||||
|
||||
|
||||
def GetBinaryPath():
|
||||
- return os_path.join(os_path.dirname(__file__), *{
|
||||
- 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
|
||||
- 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
|
||||
- 'Windows': ('win', 'node.exe'),
|
||||
- }[platform.system()])
|
||||
+ return "/usr/bin/node"
|
||||
+ #return os_path.join(os_path.dirname(__file__), *{
|
||||
+ # 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
|
||||
+ # 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
|
||||
+ # 'Windows': ('win', 'node.exe'),
|
||||
+ #}[platform.system()])
|
||||
|
||||
|
||||
def RunNode(cmd_parts, stdout=None):
|
3659
srcpkgs/chromium/patches/xxx-ppc64le-support.patch
Normal file
3659
srcpkgs/chromium/patches/xxx-ppc64le-support.patch
Normal file
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@ pkgname=chromium
|
|||
# See http://www.chromium.org/developers/calendar for the latest version
|
||||
version=84.0.4147.105
|
||||
revision=1
|
||||
archs="i686* x86_64* aarch64* armv7l*"
|
||||
archs="i686* x86_64* aarch64* armv7l* ppc64le*"
|
||||
short_desc="Google's attempt at creating a safer, faster, and more stable browser"
|
||||
maintainer="Enno Boland <gottox@voidlinux.org>"
|
||||
license="BSD-3-Clause"
|
||||
|
@ -38,6 +38,10 @@ makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
|
|||
$(vopt_if sndio sndio-devel)"
|
||||
depends="libexif hwids desktop-file-utils hicolor-icon-theme xdg-utils"
|
||||
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
ppc64*-musl) makedepends+=" libucontext-devel" ;;
|
||||
esac
|
||||
|
||||
build_options_default="clang js_optimize vaapi pulseaudio"
|
||||
|
||||
post_patch() {
|
||||
|
@ -61,10 +65,6 @@ post_patch() {
|
|||
sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
|
||||
-i services/device/public/cpp/usb/BUILD.gn
|
||||
|
||||
# use system nodejs
|
||||
mkdir -p third_party/node/linux/node-linux-x64/bin
|
||||
ln -sf /usr/bin/node third_party/node/linux/node-linux-x64/bin/node
|
||||
|
||||
if [ -z "$build_option_clang" ]; then
|
||||
# Work around bug in blink in which GCC 6 optimizes away null pointer checks
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833524
|
||||
|
@ -228,6 +228,7 @@ do_configure() {
|
|||
i686*) conf+=( 'target_cpu="x86"' ) ;;
|
||||
arm*) conf+=( 'target_cpu="arm"' ) ;;
|
||||
aarch64*) conf+=( 'target_cpu="arm64"' ) ;;
|
||||
ppc64*) conf+=( 'target_cpu="ppc64"' ) ;;
|
||||
esac
|
||||
|
||||
export LDFLAGS="-pthread"
|
||||
|
@ -242,6 +243,11 @@ do_configure() {
|
|||
do_build() {
|
||||
export PYTHONPATH=${wrksrc}
|
||||
|
||||
if [ "$build_option_clang" ]; then
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
fi
|
||||
|
||||
ninja -C out/Release ${makejobs} chrome chromedriver mksnapshot
|
||||
}
|
||||
do_install() {
|
||||
|
|
Loading…
Add table
Reference in a new issue