diff --git a/databases/mongodb44/Makefile b/databases/mongodb44/Makefile index 10465fc1b720..9402778d101b 100644 --- a/databases/mongodb44/Makefile +++ b/databases/mongodb44/Makefile @@ -1,85 +1,94 @@ PORTNAME= mongodb DISTVERSIONPREFIX= r DISTVERSION= 4.4.23 CATEGORIES= databases net MASTER_SITES= https://fastdl.mongodb.org/src/ \ http://fastdl.mongodb.org/src/ PKGNAMESUFFIX= ${DISTVERSION:R:S/.//} DISTNAME= mongodb-src-${DISTVERSIONPREFIX}${DISTVERSION} MAINTAINER= ronald@FreeBSD.org COMMENT= Distributed document-oriented "NoSQL" database (4.4.x Branch) WWW= https://docs.mongodb.com/v4.4/ LICENSE= SSPLv1 APACHE20 # mongodb is SSPLv1, C++ driver is APACHE20 LICENSE_COMB= multi LICENSE_NAME_SSPLv1= Server Side Public License Version 1 LICENSE_FILE_SSPLv1= ${WRKSRC}/LICENSE-Community.txt LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le ONLY_FOR_ARCHS_REASON= only ported to amd64, aarch64, and powerpc64le on FreeBSD; upstream supports arm64, ppc64le, s390x, and x86-64 BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} LIB_DEPENDS= libpcre.so:devel/pcre \ libcurl.so:ftp/curl \ libsnappy.so:archivers/snappy USES= compiler:c++17-lang cpe python:build scons USE_RC_SUBR= mongod MAKE_ARGS= --use-system-zlib \ --use-system-pcre \ --use-system-snappy \ --libc++ \ --cxx-std=17 \ --runtime-hardening=on \ -j ${MAKE_JOBS_NUMBER} \ --disable-warnings-as-errors \ VERBOSE=on \ AR=llvm-ar CFLAGS+= -D_HAS_AUTO_PTR_ETC=0 CONFLICTS_INSTALL= mongodb[0-9][0-9] # etc/mongodb.conf.sample PORTSCOUT= limit:^4\.4\. 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 SASL_MAKE_ARGS= --use-sasl-client SSL_USES= ssl SSL_MAKE_ARGS= --ssl .include .if ${ARCH} == aarch64 || ${ARCH} == powerpc64le EXTRA_PATCHES+= ${FILESDIR}/${ARCH} .endif ALL_TARGET= install-core CPE_PRODUCT= mongodb pre-patch: ${MV} ${WRKSRC}/src/third_party/wiredtiger/src/checksum/power8/crc32.sx ${WRKSRC}/src/third_party/wiredtiger/src/checksum/power8/crc32.S do-install: .for f in mongo mongod mongos ${INSTALL_PROGRAM} ${WRKSRC}/build/install${PREFIX}/bin/${f} ${STAGEDIR}${PREFIX}/bin .endfor ${INSTALL_DATA} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample .include 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 @@ -1,42 +1,33 @@ --- SConstruct.orig 2023-05-10 02:21:42 UTC +++ SConstruct @@ -1269,9 +1269,9 @@ if has_option('variables-help'): print(env_vars.GenerateHelpText(env)) Exit(0) -unknown_vars = env_vars.UnknownVariables() -if unknown_vars: - env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) +#unknown_vars = env_vars.UnknownVariables() +#if unknown_vars: +# env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) install_actions.setup(env, get_option('install-action')) @@ -2196,7 +2196,7 @@ if env.TargetOSIs('posix'): # If runtime hardening is requested, then build anything # destined for an executable with the necessary flags for PIE. env.AppendUnique( - PROGCCFLAGS=['-fPIE'], + PROGCCFLAGS=['-fpic'], PROGLINKFLAGS=['-pie'], ) @@ -2211,7 +2211,7 @@ if env.TargetOSIs('posix'): "-Wno-unknown-pragmas", "-Winvalid-pch"] ) # env.Append( " -Wconversion" ) TODO: this doesn't really work yet - if env.TargetOSIs('linux', 'darwin', 'solaris'): + if env.TargetOSIs('linux', 'darwin', 'solaris', 'freebsd'): 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'):