1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-05 01:55:52 +00:00

lang/mono: Fix build on aarch64.

Approved by:	portmgr (build fix blanket)
This commit is contained in:
Mikael Urankar 2021-10-18 08:20:57 +02:00
parent 4b0565682a
commit f863e5a659
6 changed files with 3043 additions and 6 deletions

View File

@ -13,7 +13,7 @@ COMMENT= Open source implementation of .NET Development Framework
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= amd64 armv6 armv7 i386 powerpc powerpc64 powerpc64le
ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 powerpc powerpc64 powerpc64le
BUILD_DEPENDS= p5-XML-Parser>=0:textproc/p5-XML-Parser \
bash:shells/bash \
@ -65,6 +65,10 @@ OPTIONS_SLAVE= MONOLITE
.include <bsd.port.options.mk>
.if ${ARCH} == aarch64
PLIST= ${.CURDIR}/pkg-plist.aarch64
.endif
.if ${ARCH:Mpowerpc*}
PLIST+= ${.CURDIR}/pkg-plist.powerpc
.else

View File

@ -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"

View File

@ -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 */

View File

@ -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

View File

@ -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)

2945
lang/mono/pkg-plist.aarch64 Normal file

File diff suppressed because it is too large Load Diff