add support for arm64;

This is now possible due to the libcxx update and pmap changes in the kernel.
Since swiftshader is not supported on aarch64 (amd64), create a PFRAG to be
included on anything else besides arm64.
This commit is contained in:
robert 2018-09-12 19:10:34 +00:00
parent c8e70ae949
commit d49241621a
18 changed files with 2553 additions and 29 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.384 2018/09/12 17:08:22 robert Exp $
# $OpenBSD: Makefile,v 1.385 2018/09/12 19:10:34 robert Exp $
.include <bsd.port.arch.mk>
@ -136,6 +136,10 @@ GN_ARGS+= extra_ldflags=\"-L${LOCALBASE}/lib -L${X11BASE}/lib -Wl,--no-keep-memo
GN_ARGS+= extra_ldflags=\"-L${LOCALBASE}/lib -L${X11BASE}/lib\"
.endif
.if ${MACHINE_ARCH} != "aarch64"
PKG_ARGS+= -Dswiftshader=1
.endif
# Note: these keys are for OpenBSD use ONLY. For your own distribution,
# please get your own set of keys. It's free!
GN_ARGS+= google_api_key=\"AIzaSyA015yecfJyWi8UQpneQVrNzIKlxjv4MhI\" \
@ -159,7 +163,7 @@ GN_ARGS+= is_official_build=true \
pre-configure:
@ln -sf ${MODPY_BIN} ${WRKDIR}/bin/python
.for _arch in x64 ia32
.for _arch in x64 ia32 arm64
. for _dir in avcodec avformat avutil
@cp -pR ${WRKSRC}/third_party/ffmpeg/chromium/config/Chrome/linux/${_arch}/lib${_dir} \
${WRKSRC}/third_party/ffmpeg/chromium/config/Chrome/openbsd/${_arch}/lib${_dir}
@ -215,11 +219,13 @@ do-install:
${INSTALL_DATA} ${BUILDDIR}/${f} ${PREFIX}/chrome
.endfor
.if ${MACHINE_ARCH} != "aarch64"
# SwiftShader
${INSTALL_DATA_DIR} ${PREFIX}/chrome/swiftshader
.for f in libEGL.so libGLESv2.so
${INSTALL_DATA} ${BUILDDIR}/swiftshader/${f} ${PREFIX}/chrome/swiftshader
.endfor
.endif
.if ${FLAVOR:Mcomponent}
cp -Rp ${BUILDDIR}/*.so ${PREFIX}/chrome/

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-base_sys_info_posix_cc,v 1.11 2018/04/23 15:00:15 robert Exp $
$OpenBSD: patch-base_sys_info_posix_cc,v 1.12 2018/09/12 19:10:34 robert Exp $
Index: base/sys_info_posix.cc
--- base/sys_info_posix.cc.orig
+++ base/sys_info_posix.cc
@@ -146,6 +146,19 @@ int64_t SysInfo::AmountOfVirtualMemory() {
@@ -146,7 +146,20 @@ int64_t SysInfo::AmountOfVirtualMemory() {
}
#endif
+#if !defined(OS_BSD)
+// static
// static
+int64_t SysInfo::AmountOfAvailablePhysicalMemory() {
+ long available_pages = sysconf(_SC_AVPHYS_PAGES);
+ long page_size = sysconf(_SC_PAGE_SIZE);
@ -19,6 +19,16 @@ Index: base/sys_info_posix.cc
+}
+#endif
+
// static
+// static
int64_t SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
AssertBlockingAllowed();
@@ -226,6 +239,8 @@ std::string SysInfo::OperatingSystemArchitecture() {
arch = "x86";
} else if (arch == "amd64") {
arch = "x86_64";
+ } else if (arch == "arm64") {
+ arch = "aarch64";
} else if (std::string(info.sysname) == "AIX") {
arch = "ppc64";
}

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-build_config_compiler_BUILD_gn,v 1.20 2018/09/12 17:08:22 robert Exp $
$OpenBSD: patch-build_config_compiler_BUILD_gn,v 1.21 2018/09/12 19:10:34 robert Exp $
Index: build/config/compiler/BUILD.gn
--- build/config/compiler/BUILD.gn.orig
@ -57,6 +57,15 @@ Index: build/config/compiler/BUILD.gn
cflags += [
# TODO(hans): Remove this once Clang generates better optimized debug info
# by default. https://crbug.com/765793
@@ -742,7 +737,7 @@ config("compiler_cpu_abi") {
cflags += [ "-mtune=$arm_tune" ]
}
} else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_openbsd) {
cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ]
}
@@ -1477,10 +1472,6 @@ config("default_warnings") {
cflags += [
# TODO(thakis): https://crbug.com/753973

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-build_detect_host_arch_py,v 1.1 2018/09/12 19:10:34 robert Exp $
Index: build/detect_host_arch.py
--- build/detect_host_arch.py.orig
+++ build/detect_host_arch.py
@@ -19,6 +19,8 @@ def HostArch():
host_arch = 'ia32'
elif host_arch in ['x86_64', 'amd64']:
host_arch = 'x64'
+ elif host_arch.startswith('arm64'):
+ host_arch = 'arm64'
elif host_arch.startswith('arm'):
host_arch = 'arm'
elif host_arch.startswith('aarch64'):

View File

@ -1,7 +1,8 @@
$OpenBSD: patch-build_toolchain_openbsd_BUILD_gn,v 1.2 2016/10/26 06:22:07 robert Exp $
--- build/toolchain/openbsd/BUILD.gn.orig.port Wed Oct 19 13:16:59 2016
+++ build/toolchain/openbsd/BUILD.gn Wed Oct 19 14:23:37 2016
@@ -0,0 +1,52 @@
$OpenBSD: patch-build_toolchain_openbsd_BUILD_gn,v 1.3 2018/09/12 19:10:34 robert Exp $
Index: build/toolchain/openbsd/BUILD.gn
--- build/toolchain/openbsd/BUILD.gn.orig
+++ build/toolchain/openbsd/BUILD.gn
@@ -0,0 +1,66 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
@ -54,3 +55,17 @@ $OpenBSD: patch-build_toolchain_openbsd_BUILD_gn,v 1.2 2016/10/26 06:22:07 rober
+ is_clang = false
+ }
+}
+
+clang_toolchain("clang_arm") {
+ toolchain_args = {
+ current_cpu = "arm64"
+ current_os = "openbsd"
+ }
+}
+
+clang_toolchain("clang_arm64") {
+ toolchain_args = {
+ current_cpu = "arm64"
+ current_os = "openbsd"
+ }
+}

View File

@ -1,17 +1,19 @@
$OpenBSD: patch-content_common_user_agent_cc,v 1.3 2018/07/30 15:28:28 robert Exp $
$OpenBSD: patch-content_common_user_agent_cc,v 1.4 2018/09/12 19:10:34 robert Exp $
Append Linux x86_64 to the user agent because we have to lie ...
Index: content/common/user_agent.cc
--- content/common/user_agent.cc.orig
+++ content/common/user_agent.cc
@@ -125,6 +125,14 @@ std::string BuildOSCpuInfo() {
@@ -125,6 +125,16 @@ std::string BuildOSCpuInfo() {
#endif
); // NOLINT
+#if defined(OS_OPENBSD)
+#if defined(__x86_64__)
+ base::StringAppendF(&os_cpu, "; Linux x86_64");
+#elif defined(__aarch64__)
+ base::StringAppendF(&os_cpu, "; Linux aarch64");
+#else
+ base::StringAppendF(&os_cpu, "; Linux i686");
+#endif

View File

@ -1,13 +1,14 @@
$OpenBSD: patch-third_party_boringssl_src_include_openssl_base_h,v 1.1 2018/07/25 06:53:36 robert Exp $
$OpenBSD: patch-third_party_boringssl_src_include_openssl_base_h,v 1.2 2018/09/12 19:10:34 robert Exp $
Index: third_party/boringssl/src/include/openssl/base.h
--- third_party/boringssl/src/include/openssl/base.h.orig
+++ third_party/boringssl/src/include/openssl/base.h
@@ -134,6 +134,10 @@ extern "C" {
@@ -134,6 +134,11 @@ extern "C" {
#define OPENSSL_FUCHSIA
#endif
+#if defined(__OpenBSD__)
+#define OPENSSL_OPENBSD
+#define OPENSSL_ARC4RANDOM
+#endif
+

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-third_party_boringssl_src_include_openssl_cpu_h,v 1.1 2018/09/12 19:10:34 robert Exp $
Index: third_party/boringssl/src/include/openssl/cpu.h
--- third_party/boringssl/src/include/openssl/cpu.h.orig
+++ third_party/boringssl/src/include/openssl/cpu.h
@@ -105,7 +105,7 @@ static inline const uint32_t *OPENSSL_ia32cap_get(void
#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)
-#if defined(OPENSSL_APPLE)
+#if defined(OPENSSL_APPLE) || defined(OPENSSL_OPENBSD)
// iOS builds use the static ARM configuration.
#define OPENSSL_STATIC_ARMCAP
#endif

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-third_party_crc32c_BUILD_gn,v 1.1 2018/09/12 19:10:34 robert Exp $
Index: third_party/crc32c/BUILD.gn
--- third_party/crc32c/BUILD.gn.orig
+++ third_party/crc32c/BUILD.gn
@@ -43,7 +43,7 @@ config("crc32c_config") {
defines += [ "HAVE_ARM64_CRC32C=0" ]
}
- if (is_linux || is_chromeos) {
+ if ((is_linux || is_chromeos) && !is_openbsd) {
defines += [
"HAVE_STRONG_GETAUXVAL=1",
"HAVE_WEAK_GETAUXVAL=1",

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_ia32_config_asm,v 1.27 2018/03/12 13:48:34 robert Exp $
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_ia32_config_asm,v 1.28 2018/09/12 19:10:34 robert Exp $
Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.asm
--- third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.asm.orig
+++ third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.asm
@ -255,7 +255,7 @@ Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.asm
+%define HAVE_DOS_PATHS 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
+%define HAVE_SECTION_DATA_REL_RO 0
+%define HAVE_SECTION_DATA_REL_RO 1
+%define HAVE_THREADS 1
+%define HAVE_UWP 0
+%define HAVE_WINRT 0

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_ia32_config_h,v 1.27 2018/03/12 13:48:34 robert Exp $
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_ia32_config_h,v 1.28 2018/09/12 19:10:34 robert Exp $
Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.h
--- third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.h.orig
+++ third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.h
@ -270,7 +270,7 @@ Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/ia32/config.h
+#define HAVE_DOS_PATHS 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
+#define HAVE_SECTION_DATA_REL_RO 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_THREADS 1
+#define HAVE_UWP 0
+#define HAVE_WINRT 0

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_x64_config_asm,v 1.28 2018/07/30 15:28:28 robert Exp $
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_x64_config_asm,v 1.29 2018/09/12 19:10:34 robert Exp $
Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.asm
--- third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.asm.orig
+++ third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.asm
@ -256,7 +256,7 @@ Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.asm
+%define HAVE_DOS_PATHS 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
+%define HAVE_SECTION_DATA_REL_RO 0
+%define HAVE_SECTION_DATA_REL_RO 1
+%define HAVE_THREADS 1
+%define HAVE_UWP 0
+%define HAVE_WINRT 0

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_x64_config_h,v 1.29 2018/07/30 15:28:28 robert Exp $
$OpenBSD: patch-third_party_ffmpeg_chromium_config_Chrome_openbsd_x64_config_h,v 1.30 2018/09/12 19:10:34 robert Exp $
Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.h
--- third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.h.orig
+++ third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.h
@ -271,7 +271,7 @@ Index: third_party/ffmpeg/chromium/config/Chrome/openbsd/x64/config.h
+#define HAVE_DOS_PATHS 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
+#define HAVE_SECTION_DATA_REL_RO 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_THREADS 1
+#define HAVE_UWP 0
+#define HAVE_WINRT 0

View File

@ -1,8 +1,26 @@
$OpenBSD: patch-third_party_zlib_BUILD_gn,v 1.8 2018/04/23 15:00:16 robert Exp $
$OpenBSD: patch-third_party_zlib_BUILD_gn,v 1.9 2018/09/12 19:10:34 robert Exp $
Index: third_party/zlib/BUILD.gn
--- third_party/zlib/BUILD.gn.orig
+++ third_party/zlib/BUILD.gn
@@ -63,7 +63,7 @@ config("zlib_arm_crc32_config") {
# - ChromeOS has wrapper scripts that are borking the compiler flags.
# - Fuchsia just added a syscall for feature detection.
# TODO(cavalcantii): crbug.com/810125.
- if (!is_ios && !is_chromeos && !is_fuchsia) {
+ if (!is_ios && !is_chromeos && !is_fuchsia && !is_openbsd) {
defines = [ "CRC32_ARMV8_CRC32" ]
if (is_android) {
defines += [ "ARMV8_OS_ANDROID" ]
@@ -78,7 +78,7 @@ if (current_cpu == "arm" || current_cpu == "arm64") {
source_set("zlib_arm_crc32") {
visibility = [ ":*" ]
- if (!is_ios && !is_chromeos && !is_fuchsia) {
+ if (!is_ios && !is_chromeos && !is_fuchsia && !is_openbsd) {
include_dirs = [ "." ]
if (is_android) {
@@ -327,7 +327,7 @@ static_library("minizip") {
]
}

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-tools_gn_tools_gn_args_cc,v 1.1 2018/09/12 17:08:22 robert Exp $
$OpenBSD: patch-tools_gn_tools_gn_args_cc,v 1.2 2018/09/12 19:10:34 robert Exp $
Index: tools/gn/tools/gn/args.cc
--- tools/gn/tools/gn/args.cc.orig
@ -12,3 +12,12 @@ Index: tools/gn/tools/gn/args.cc
#else
#error Unknown OS type.
#endif
@@ -320,6 +322,8 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
arch = kX86;
else if (os_arch == "x86_64")
arch = kX64;
+ else if (os_arch == "arm64")
+ arch = kArm64;
else if (os_arch.substr(0, 3) == "arm")
arch = kArm;
else if (os_arch == "aarch64")

View File

@ -0,0 +1,4 @@
@comment $OpenBSD: PFRAG.swiftshader,v 1.1 2018/09/12 19:10:34 robert Exp $
chrome/swiftshader/
chrome/swiftshader/libEGL.so
chrome/swiftshader/libGLESv2.so

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.84 2018/09/12 17:08:22 robert Exp $
@comment $OpenBSD: PLIST,v 1.85 2018/09/12 19:10:34 robert Exp $
@pkgpath www/chromium,proprietary
bin/chrome
@bin bin/chromedriver
@ -387,9 +387,7 @@ chrome/resources/inspector/worker_app.js
chrome/resources/inspector/workspace_diff/
chrome/resources/inspector/workspace_diff/workspace_diff_module.js
chrome/snapshot_blob.bin
chrome/swiftshader/
chrome/swiftshader/libEGL.so
chrome/swiftshader/libGLESv2.so
%%swiftshader%%
chrome/v8_context_snapshot.bin
chrome/views_mus_resources.pak
@man man/man1/chrome.1