summaryrefslogtreecommitdiff
path: root/databases/mongodb44
diff options
context:
space:
mode:
authorRonald Klop <ronald@FreeBSD.org>2023-07-30 22:48:45 +0200
committerRonald Klop <ronald@FreeBSD.org>2023-07-30 22:57:08 +0200
commit0464348da5f077137bdcb0338d9af8b470771952 (patch)
treee6d1be30b130b1082b7283ffc64b810f1d3aac52 /databases/mongodb44
parentdatabases/mongodb44: style (diff)
databases/mongodb44: make support for ARMv8.0-A optional
no-op commit; default is still enabled Why? Upstream removed support for non-LSE ARM CPUs because of possible corruption on high concurrent load. Quite some people (including me) use this on RPI4 with net-mgmt/unifi7 and one WiFi dish. This is not a 'high concurrent load' and works fine. By making this CPU optional I hope to support both types of usage.
Diffstat (limited to 'databases/mongodb44')
-rw-r--r--databases/mongodb44/Makefile9
-rw-r--r--databases/mongodb44/files/extrapatch-SConstruct11
-rw-r--r--databases/mongodb44/files/patch-SConstruct9
3 files changed, 20 insertions, 9 deletions
diff --git a/databases/mongodb44/Makefile b/databases/mongodb44/Makefile
index 10465fc1b720..9402778d101b 100644
--- a/databases/mongodb44/Makefile
+++ b/databases/mongodb44/Makefile
@@ -51,10 +51,19 @@ USERS= mongodb
GROUPS= mongodb
OPTIONS_DEFINE= LTO SASL SSL
+OPTIONS_DEFINE_aarch64= ARMV80A
OPTIONS_DEFAULT= LTO SASL SSL
+OPTIONS_DEFAULT_aarch64= ARMV80A
OPTIONS_EXCLUDE_aarch64= ${OPTIONS_EXCLUDE_${ARCH}_${OSREL:R}}
OPTIONS_EXCLUDE_aarch64_14= LTO # Does not work with llvm12 on aarch64.
+# MongoDB on non-LSE ARM cpu like Raspberry Pi can work but is unsupported upstream.
+# Can give corruption on high concurrency.
+# Please read https://jira.mongodb.org/browse/SERVER-71772.
+ARMV80A_DESC= Enable non-LSE ARM64 CPUs like RPI4.
+
+ARMV80A_EXTRA_PATCHES= ${FILESDIR}/extrapatch-SConstruct
+
LTO_MAKE_ARGS= --lto=on
SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
diff --git a/databases/mongodb44/files/extrapatch-SConstruct b/databases/mongodb44/files/extrapatch-SConstruct
new file mode 100644
index 000000000000..f82c38ad98f8
--- /dev/null
+++ b/databases/mongodb44/files/extrapatch-SConstruct
@@ -0,0 +1,11 @@
+--- SConstruct.orig 2023-05-10 02:21:42 UTC
++++ SConstruct
+@@ -2297,7 +2297,7 @@ if env.ToolchainIs('GCC', 'clang'):
+ elif env['TARGET_ARCH'] == 'aarch64':
+ # If we are using GCC or clang to target aarch64, set the arch to be armv8.2-a,
+ # This is to prevent a bug with WT see SERVER-71772 for more details
+- env.Append( CCFLAGS=['-march=armv8.2-a', '-mtune=generic'] )
++ env.Append( CCFLAGS=['-march=armv8-a+crc', '-mtune=generic'] )
+
+ # Needed for auth tests since key files are stored in git with mode 644.
+ if not env.TargetOSIs('windows'):
diff --git a/databases/mongodb44/files/patch-SConstruct b/databases/mongodb44/files/patch-SConstruct
index 4d4576d66465..eab9454199b0 100644
--- a/databases/mongodb44/files/patch-SConstruct
+++ b/databases/mongodb44/files/patch-SConstruct
@@ -31,12 +31,3 @@
if not has_option("disable-warnings-as-errors"):
env.Append( CCFLAGS=["-Werror"] )
-@@ -2297,7 +2297,7 @@ if env.ToolchainIs('GCC', 'clang'):
- elif env['TARGET_ARCH'] == 'aarch64':
- # If we are using GCC or clang to target aarch64, set the arch to be armv8.2-a,
- # This is to prevent a bug with WT see SERVER-71772 for more details
-- env.Append( CCFLAGS=['-march=armv8.2-a', '-mtune=generic'] )
-+ env.Append( CCFLAGS=['-march=armv8-a+crc', '-mtune=generic'] )
-
- # Needed for auth tests since key files are stored in git with mode 644.
- if not env.TargetOSIs('windows'):