FreeBSD Bugzilla – Attachment 241755 Details for
Bug 271076
games/punchy: fix build on armv7 (preliminary)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
games/punchy: fix build on armv7
0001-games-punchy-fix-build-on-armv7.patch (text/plain), 14.56 KB, created by
Robert Clausecker
on 2023-04-26 10:00:41 UTC
(
hide
)
Description:
games/punchy: fix build on armv7
Filename:
MIME Type:
Creator:
Robert Clausecker
Created:
2023-04-26 10:00:41 UTC
Size:
14.56 KB
patch
obsolete
>From c6ff00519d217f86527e8fec5e528356f8b128ee Mon Sep 17 00:00:00 2001 >From: Robert Clausecker <fuz@FreeBSD.org> >Date: Wed, 26 Apr 2023 02:36:30 +0200 >Subject: [PATCH] games/punchy: fix build on armv7 > >Fix files/patch-v8 to compile on armv7 by refactoring it to use >ELF auxilliary vectors in the CPU detection code and by adding >some missing includes. >--- > games/punchy/Makefile | 2 +- > games/punchy/files/patch-v8 | 106 ++++++++++++++++++++---------------- > 2 files changed, 61 insertions(+), 47 deletions(-) > >diff --git a/games/punchy/Makefile b/games/punchy/Makefile >index d3193992c954..be709fe5c6e3 100644 >--- a/games/punchy/Makefile >+++ b/games/punchy/Makefile >@@ -1,7 +1,7 @@ > PORTNAME= punchy > DISTVERSIONPREFIX= v > DISTVERSION= 0.3.0 >-PORTREVISION= 4 >+PORTREVISION= 5 > CATEGORIES= games wayland > > MAINTAINER= jbeich@FreeBSD.org >diff --git a/games/punchy/files/patch-v8 b/games/punchy/files/patch-v8 >index 1b0bd8761916..a68a2609f4ed 100644 >--- a/games/punchy/files/patch-v8 >+++ b/games/punchy/files/patch-v8 >@@ -8,7 +8,7 @@ error[E0308]: mismatched types > | | > | implicitly returns `()` as its body has no tail or `return` expression > >---- cargo-crates/v8-0.47.1/build.rs.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build.rs.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build.rs > @@ -262,6 +262,14 @@ fn platform() -> &'static str { > { >@@ -25,7 +25,7 @@ error[E0308]: mismatched types > } > > fn download_ninja_gn_binaries() { >-@@ -642,6 +658,7 @@ fn ninja(gn_out_dir: &Path, maybe_env: Option<NinjaEnv >+@@ -642,6 +650,7 @@ type NinjaEnv = Vec<(String, String)>; > fn ninja(gn_out_dir: &Path, maybe_env: Option<NinjaEnv>) -> Command { > let cmd_string = env::var("NINJA").unwrap_or_else(|_| "ninja".to_owned()); > let mut cmd = Command::new(cmd_string); >@@ -33,7 +33,7 @@ error[E0308]: mismatched types > cmd.arg("-C"); > cmd.arg(&gn_out_dir); > if let Some(env) = maybe_env { >---- cargo-crates/v8-0.47.1/build/config/BUILD.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/config/BUILD.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/config/BUILD.gn > @@ -218,13 +218,17 @@ config("default_libs") { > "CoreText.framework", >@@ -55,7 +55,7 @@ error[E0308]: mismatched types > } > > group("common_deps") { >---- cargo-crates/v8-0.47.1/build/config/BUILDCONFIG.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/config/BUILDCONFIG.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/config/BUILDCONFIG.gn > @@ -136,7 +136,8 @@ declare_args() { > is_official_build = false >@@ -88,7 +88,7 @@ error[E0308]: mismatched types > # See comments in build/toolchain/cros/BUILD.gn about board compiles. > if (is_clang) { > _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" >-@@ -298,7 +300,11 @@ is_ios = current_os == "ios" >+@@ -298,7 +300,11 @@ is_android = current_os == "android" > is_chromeos = current_os == "chromeos" > is_fuchsia = current_os == "fuchsia" > is_ios = current_os == "ios" >@@ -101,9 +101,9 @@ error[E0308]: mismatched types > is_mac = current_os == "mac" > is_nacl = current_os == "nacl" > is_win = current_os == "win" || current_os == "winuwp" >---- cargo-crates/v8-0.47.1/build/config/compiler/BUILD.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/config/compiler/BUILD.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/config/compiler/BUILD.gn >-@@ -245,13 +245,16 @@ config("no_unresolved_symbols") { >+@@ -245,13 +245,16 @@ config("default_include_dirs") { > # Compiler instrumentation can introduce dependencies in DSOs to symbols in > # the executable they are loaded into, so they are unresolved at link-time. > config("no_unresolved_symbols") { >@@ -168,7 +168,7 @@ error[E0308]: mismatched types > # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. > cflags += [ > "-Xclang", >-@@ -1303,7 +1310,7 @@ config("clang_revision") { >+@@ -1303,7 +1310,7 @@ config("compiler_deterministic") { > } > > config("clang_revision") { >@@ -186,7 +186,7 @@ error[E0308]: mismatched types > cflags += [ > # Disabled for similar reasons as -Wunused-variable. > "-Wno-unused-but-set-variable", >-@@ -2264,7 +2271,7 @@ config("afdo") { >+@@ -2264,7 +2271,7 @@ config("afdo_optimize_size") { > # There are some targeted places that AFDO regresses, so we provide a separate > # config to allow AFDO to be disabled per-target. > config("afdo") { >@@ -214,7 +214,7 @@ error[E0308]: mismatched types > if (is_apple) { > # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. > # Make sure we don't use constructor homing on mac. >---- cargo-crates/v8-0.47.1/build/config/linux/BUILD.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/config/linux/BUILD.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/config/linux/BUILD.gn > @@ -41,7 +41,7 @@ config("runtime_library") { > } >@@ -225,7 +225,7 @@ error[E0308]: mismatched types > libs = [ "atomic" ] > } > } >-@@ -55,16 +55,5 @@ if (use_glib) { >+@@ -55,16 +55,5 @@ config("libresolv") { > } > > if (use_glib) { >@@ -243,7 +243,7 @@ error[E0308]: mismatched types > - } > + # unused by rusty_v8 > } >---- cargo-crates/v8-0.47.1/build/config/linux/pkg-config.py.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/config/linux/pkg-config.py.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/config/linux/pkg-config.py > @@ -109,7 +109,7 @@ def main(): > # If this is run on non-Linux platforms, just return nothing and indicate >@@ -254,7 +254,7 @@ error[E0308]: mismatched types > print("[[],[],[],[],[]]") > return 0 > >---- cargo-crates/v8-0.47.1/build/detect_host_arch.py.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/detect_host_arch.py.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/detect_host_arch.py > @@ -21,6 +21,8 @@ def HostArch(): > host_arch = 'ia32' >@@ -265,7 +265,7 @@ error[E0308]: mismatched types > elif host_arch.startswith('arm'): > host_arch = 'arm' > elif host_arch.startswith('aarch64'): >---- cargo-crates/v8-0.47.1/build/linux/chrome.map.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/linux/chrome.map.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/linux/chrome.map > @@ -20,6 +20,10 @@ global: > # Program entry point. >@@ -278,9 +278,9 @@ error[E0308]: mismatched types > # Memory allocation symbols. We want chrome and any libraries to > # share the same heap, so it is correct to export these symbols. > aligned_alloc; >---- cargo-crates/v8-0.47.1/build/linux/libpci/BUILD.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/linux/libpci/BUILD.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/linux/libpci/BUILD.gn >-@@ -3,20 +3,36 @@ import("//tools/generate_library_loader/generate_libra >+@@ -3,20 +3,36 @@ > # found in the LICENSE file. > > import("//tools/generate_library_loader/generate_library_loader.gni") >@@ -331,7 +331,7 @@ error[E0308]: mismatched types > + ] > + } > } >---- cargo-crates/v8-0.47.1/build/linux/unbundle/libusb.gn.orig 2021-04-15 08:12:30 UTC >+--- cargo-crates/v8-0.47.1/build/linux/unbundle/libusb.gn.orig 2023-04-25 23:33:42 UTC > +++ cargo-crates/v8-0.47.1/build/linux/unbundle/libusb.gn > @@ -0,0 +1,24 @@ > +# Copyright 2016 The Chromium Authors. All rights reserved. >@@ -358,7 +358,7 @@ error[E0308]: mismatched types > + ] > + public_configs = [ ":system_libusb" ] > +} >---- cargo-crates/v8-0.47.1/build/linux/unbundle/replace_gn_files.py.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/linux/unbundle/replace_gn_files.py.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/linux/unbundle/replace_gn_files.py > @@ -25,6 +25,7 @@ REPLACEMENTS = { > 'libevent': 'base/third_party/libevent/BUILD.gn', >@@ -368,9 +368,9 @@ error[E0308]: mismatched types > 'libvpx': 'third_party/libvpx/BUILD.gn', > 'libwebp': 'third_party/libwebp/BUILD.gn', > 'libxml': 'third_party/libxml/BUILD.gn', >---- cargo-crates/v8-0.47.1/build/toolchain/gcc_toolchain.gni.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/toolchain/gcc_toolchain.gni.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/toolchain/gcc_toolchain.gni >-@@ -786,13 +786,17 @@ template("clang_toolchain") { >+@@ -786,13 +786,17 @@ template("gcc_toolchain") { > # use_gold too. > template("clang_toolchain") { > gcc_toolchain(target_name) { >@@ -394,7 +394,7 @@ error[E0308]: mismatched types > > forward_variables_from(invoker, > [ >---- cargo-crates/v8-0.47.1/build/toolchain/get_concurrent_links.py.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/build/toolchain/get_concurrent_links.py.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/build/toolchain/get_concurrent_links.py > @@ -53,6 +53,14 @@ def _GetTotalMemoryInBytes(): > return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize'])) >@@ -411,7 +411,7 @@ error[E0308]: mismatched types > # TODO(scottmg): Implement this for other platforms. > return 0 > >---- cargo-crates/v8-0.47.1/third_party/zlib/BUILD.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/third_party/zlib/BUILD.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/third_party/zlib/BUILD.gn > @@ -119,6 +119,8 @@ if (use_arm_neon_optimizations) { > defines = [ "CRC32_ARMV8_CRC32" ] >@@ -422,9 +422,9 @@ error[E0308]: mismatched types > } else if (is_linux || is_chromeos) { > defines += [ "ARMV8_OS_LINUX" ] > } else if (is_mac) { >---- cargo-crates/v8-0.47.1/third_party/zlib/cpu_features.c.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/third_party/zlib/cpu_features.c.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/third_party/zlib/cpu_features.c >-@@ -31,11 +31,20 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0; >+@@ -31,11 +31,13 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0; > > #ifndef CPU_NO_SIMD > >@@ -435,19 +435,12 @@ error[E0308]: mismatched types > > -#if defined(ARMV8_OS_ANDROID) > +#if defined(ARMV8_OS_FREEBSD) >-+#include <machine/armreg.h> >-+#include <sys/types.h> >-+#ifndef ID_AA64ISAR0_AES_VAL >-+#define ID_AA64ISAR0_AES_VAL ID_AA64ISAR0_AES >-+#endif >-+#ifndef ID_AA64ISAR0_CRC32_VAL >-+#define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32 >-+#endif >++#include <sys/auxv.h> > +#elif defined(ARMV8_OS_ANDROID) > #include <cpu-features.h> > #elif defined(ARMV8_OS_LINUX) > #include <asm/hwcap.h> >-@@ -56,7 +65,7 @@ static void _cpu_check_features(void); >+@@ -56,7 +58,7 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0; > static void _cpu_check_features(void); > #endif > >@@ -456,21 +449,24 @@ error[E0308]: mismatched types > #if !defined(ARMV8_OS_MACOS) > // _cpu_check_features() doesn't need to do anything on mac/arm since all > // features are known at build time, so don't call it. >-@@ -123,6 +132,13 @@ static void _cpu_check_features(void) >+@@ -123,6 +125,16 @@ static void _cpu_check_features(void) > #elif defined(ARMV8_OS_WINDOWS) > arm_cpu_enable_crc32 = IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE); > arm_cpu_enable_pmull = IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE); >-+#elif defined(ARMV8_OS_FREEBSD) >-+ uint64_t id_aa64isar0; >-+ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1); >-+ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL) >-+ arm_cpu_enable_pmull = 1; >-+ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) >-+ arm_cpu_enable_crc32 = 1; >++#elif defined(ARMV8_OS_FREEBSD) && defined(__aarch64__) >++ unsigned long features; >++ elf_aux_info(AT_HWCAP, &features, sizeof features); >++ arm_cpu_enable_crc32 = !!(features & HWCAP_CRC32); >++ arm_cpu_enable_pmull = !!(features & HWCAP_PMULL); >++#elif defined(ARMV8_OS_FREEBSD) /* aarch32 */ >++ unsigned long features; >++ elf_aux_info(AT_HWCAP2, &features, sizeof features); >++ arm_cpu_enable_crc32 = !!(features & HWCAP2_CRC32); >++ arm_cpu_enable_pmull = !!(features & HWCAP2_PMULL); > #endif > } > #endif >---- cargo-crates/v8-0.47.1/v8/BUILD.gn.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/v8/BUILD.gn.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/v8/BUILD.gn > @@ -5348,7 +5348,7 @@ v8_component("v8_libbase") { > } >@@ -500,7 +496,7 @@ error[E0308]: mismatched types > } else if (current_os == "aix") { > sources += [ > "src/base/debug/stack_trace_posix.cc", >---- cargo-crates/v8-0.47.1/v8/src/api/api.cc.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/v8/src/api/api.cc.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/v8/src/api/api.cc > @@ -138,7 +138,7 @@ > #include "src/wasm/wasm-serialization.h" >@@ -520,7 +516,7 @@ error[E0308]: mismatched types > bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info, > void* context) { > #if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED >---- cargo-crates/v8-0.47.1/v8/src/base/platform/platform-freebsd.cc.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/v8/src/base/platform/platform-freebsd.cc.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/v8/src/base/platform/platform-freebsd.cc > @@ -82,8 +82,8 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLib > lib_name = std::string(path); >@@ -533,7 +529,7 @@ error[E0308]: mismatched types > } > > start += ssize; >---- cargo-crates/v8-0.47.1/v8/src/base/platform/platform-posix.cc.orig 1970-01-01 00:00:00 UTC >+--- cargo-crates/v8-0.47.1/v8/src/base/platform/platform-posix.cc.orig 1973-11-29 21:33:09 UTC > +++ cargo-crates/v8-0.47.1/v8/src/base/platform/platform-posix.cc > @@ -294,8 +294,15 @@ void OS::SetRandomMmapSeed(int64_t seed) { > } >@@ -559,7 +555,7 @@ error[E0308]: mismatched types > > // TODO(bbudge) Move Cygwin and Fuchsia stuff into platform-specific files. > #if !V8_OS_CYGWIN && !V8_OS_FUCHSIA >-@@ -634,7 +642,7 @@ bool OS::HasLazyCommits() { >+@@ -634,7 +642,7 @@ void OS::DestroySharedMemoryHandle(PlatformSharedMemor > > // static > bool OS::HasLazyCommits() { >@@ -590,3 +586,21 @@ error[E0308]: mismatched types > > // static > Stack::StackSlot Stack::GetStackStart() { >+--- cargo-crates/v8-0.47.1/v8/src/codegen/arm/cpu-arm.cc.orig 2023-04-26 09:31:09 UTC >++++ cargo-crates/v8-0.47.1/v8/src/codegen/arm/cpu-arm.cc >+@@ -2,12 +2,15 @@ >+ // Use of this source code is governed by a BSD-style license that can be >+ // found in the LICENSE file. >+ >++#include "include/v8config.h" >++ >+ // CPU specific code for arm independent of OS goes here. >+ #ifdef __arm__ >+ #ifdef __QNXNTO__ >+ #include <sys/mman.h> // for cache flushing. >+ #undef MAP_TYPE >+ #elif V8_OS_FREEBSD >++#include <sys/cdefs.h> >+ #include <machine/sysarch.h> // for cache flushing >+ #include <sys/types.h> >+ #elif V8_OS_STARBOARD >-- >2.40.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fuz
:
maintainer-approval?
(
jbeich
)
Actions:
View
|
Diff
Attachments on
bug 271076
: 241755