diff options
Diffstat (limited to 'lang/mono/files')
-rw-r--r-- | lang/mono/files/patch-configure.ac | 31 | ||||
-rw-r--r-- | lang/mono/files/patch-external_boringssl_crypto_cpu-aarch64-linux.c | 42 | ||||
-rw-r--r-- | lang/mono/files/patch-mono_sgen_sgen-archdep.h | 11 | ||||
-rw-r--r-- | lang/mono/files/patch-mono_utils_mono-sigcontext.h | 14 |
4 files changed, 93 insertions, 5 deletions
diff --git a/lang/mono/files/patch-configure.ac b/lang/mono/files/patch-configure.ac index acd3051f7d70..4f52bab098b9 100644 --- a/lang/mono/files/patch-configure.ac +++ b/lang/mono/files/patch-configure.ac @@ -1,6 +1,19 @@ ---- configure.ac.orig 2018-08-24 15:19:14 UTC -+++ configure.ac -@@ -3298,6 +3298,8 @@ case "$host" in +--- configure.ac.orig 2018-08-24 17:19:14.000000000 +0200 ++++ configure.ac 2021-10-17 17:15:00.295997000 +0200 +@@ -201,6 +201,12 @@ case "$host" in + libdl= + libgc_threads=pthreads + use_sigposix=yes ++ case "$host" in ++ aarch64-*) ++ support_boehm=no ++ with_gc=sgen ++ ;; ++ esac + has_dtrace=yes + with_sgen_default_concurrent=yes + ;; +@@ -3298,6 +3304,8 @@ case "$host" in BTLS_PLATFORM=i386 ;; openbsd*|freebsd*|kfreebsd-gnu*) @@ -9,7 +22,7 @@ ;; esac ;; -@@ -3322,6 +3324,8 @@ case "$host" in +@@ -3322,6 +3330,8 @@ case "$host" in boehm_supported=false ;; openbsd*|freebsd*|kfreebsd-gnu*) @@ -18,7 +31,7 @@ ;; mingw*) ;; -@@ -3355,11 +3359,10 @@ case "$host" in +@@ -3355,11 +3365,10 @@ case "$host" in INTL="intl" ;; macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \ @@ -31,3 +44,11 @@ else TARGET=POWERPC; CPPFLAGS="$CPPFLAGS -D__mono_ppc__" +@@ -4425,6 +4434,7 @@ if test "x$enable_btls" = "xyes"; then + ;; + aarch64) + btls_arch=aarch64 ++ btls_cflags="-march=armv8-a+crypto" + ;; + android-armv5) + BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14" diff --git a/lang/mono/files/patch-external_boringssl_crypto_cpu-aarch64-linux.c b/lang/mono/files/patch-external_boringssl_crypto_cpu-aarch64-linux.c new file mode 100644 index 000000000000..f3de4984d5e4 --- /dev/null +++ b/lang/mono/files/patch-external_boringssl_crypto_cpu-aarch64-linux.c @@ -0,0 +1,42 @@ +--- external/boringssl/crypto/cpu-aarch64-linux.c.orig 2018-08-24 17:17:16 UTC ++++ external/boringssl/crypto/cpu-aarch64-linux.c +@@ -25,7 +25,32 @@ + + extern uint32_t OPENSSL_armcap_P; + ++#if defined(__FreeBSD__) ++#include <sys/types.h> ++#include <machine/armreg.h> ++ + void OPENSSL_cpuid_setup(void) { ++ uint64_t id_aa64isar0; ++ ++ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1); ++ ++ OPENSSL_armcap_P |= ARMV7_NEON; ++ ++ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) == ID_AA64ISAR0_AES_BASE) { ++ OPENSSL_armcap_P |= ARMV8_AES; ++ } ++ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL) { ++ OPENSSL_armcap_P |= ARMV8_PMULL; ++ } ++ if (ID_AA64ISAR0_SHA1_VAL(id_aa64isar0) == ID_AA64ISAR0_SHA1_BASE) { ++ OPENSSL_armcap_P |= ARMV8_SHA1; ++ } ++ if(ID_AA64ISAR0_SHA2_VAL(id_aa64isar0) == ID_AA64ISAR0_SHA2_BASE) { ++ OPENSSL_armcap_P |= ARMV8_SHA256; ++ } ++} ++#else // linux ++void OPENSSL_cpuid_setup(void) { + unsigned long hwcap = getauxval(AT_HWCAP); + + /* See /usr/include/asm/hwcap.h on an aarch64 installation for the source of +@@ -57,5 +82,6 @@ void OPENSSL_cpuid_setup(void) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } + } ++#endif + + #endif /* OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP */ diff --git a/lang/mono/files/patch-mono_sgen_sgen-archdep.h b/lang/mono/files/patch-mono_sgen_sgen-archdep.h new file mode 100644 index 000000000000..e46d7a1ccf04 --- /dev/null +++ b/lang/mono/files/patch-mono_sgen_sgen-archdep.h @@ -0,0 +1,11 @@ +--- mono/sgen/sgen-archdep.h.orig 2018-07-11 23:55:34 UTC ++++ mono/sgen/sgen-archdep.h +@@ -45,7 +45,7 @@ + + #elif defined(TARGET_ARM64) + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) + #define REDZONE_SIZE 0 + #elif defined(__APPLE__) + #define REDZONE_SIZE 128 diff --git a/lang/mono/files/patch-mono_utils_mono-sigcontext.h b/lang/mono/files/patch-mono_utils_mono-sigcontext.h index 22cf2458435d..f208802581d0 100644 --- a/lang/mono/files/patch-mono_utils_mono-sigcontext.h +++ b/lang/mono/files/patch-mono_utils_mono-sigcontext.h @@ -15,3 +15,17 @@ #endif #elif defined(TARGET_ARM) +@@ -460,6 +460,13 @@ typedef struct ucontext { + #define UCONTEXT_REG_SP(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__sp) + #define UCONTEXT_REG_R0(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x [ARMREG_R0]) + #define UCONTEXT_GREGS(ctx) (&(((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x)) ++#elif defined(__FreeBSD__) ++#include <ucontext.h> ++ /* https://lists.freebsd.org/pipermail/freebsd-arm/2017-February/015611.html */ ++ #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_elr) ++ #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_sp) ++ #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x [ARMREG_R0]) ++ #define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x)) + #else + #include <ucontext.h> + #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.pc) |