add mongodb/80 at its current state (basically the files from rsadowski,

but marked BROKEN for now as it crashes unless --noscripting is used,
possibly more patches needed for spidermonkey?)
This commit is contained in:
sthen
2025-09-02 12:25:13 +00:00
parent 450e06ade4
commit 70a939e82e
34 changed files with 749 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
PORTROACH= limitw:1,even
BROKEN= SIGSEGV or SIGILL at runtime unless --noscripting is used
V= 8.0.12
# mozjs tag comes from ${WRKSRC}/src/third_party/mozjs/get-sources.sh
MOZJS_TAG= 5acd3be6c9563ad3e7ca6182285c69a38de47bab
DIST_TUPLE= github mongodb-forks spidermonkey ${MOZJS_TAG} \
src/third_party/mozjs/mozilla-release
WANTLIB += ${COMPILER_LIBCXX} boost_filesystem-mt boost_iostreams-mt
WANTLIB += boost_log-mt boost_program_options-mt boost_system-mt
WANTLIB += boost_thread-mt c crypto curl execinfo icudata icui18n
WANTLIB += icuuc kvm m snappy ssl stemmer yaml-cpp z zstd
BUILD_DEPENDS+= databases/py-mongo \
devel/py-gitpython \
devel/py-retry2 \
sysutils/py-distro \
www/py-requests
LIB_DEPENDS+= archivers/zstd \
net/curl
MODSCONS_ENV= PREFIX="${PREFIX}"
MODSCONS_FLAGS= --allocator=system \
--cxx-std=20 \
--disable-warnings-as-errors \
--libc++ \
--runtime-hardening=on \
--ssl \
--use-system-snappy \
--use-system-stemmer \
--use-system-yaml \
--use-system-zlib \
--use-system-zstd \
AR=ar \
VERBOSE=on
ALL_TARGET= install-core
CXXFLAGS += -Wno-error=deprecated-builtins -Wno-error=unused-variable
CLAGS += -DBOOST_NO_CXX98_FUNCTION_BASE
post-extract:
cd ${WRKSRC}/src/third_party/mozjs; \
if ! grep -q ^LIB_GIT_REVISION=${MOZJS_TAG}$$ get-sources.sh; then \
echo "bad MOZJS_TAG; should match `grep ^LIB_GIT_REVISION get-sources.sh`"; \
fi
rm -rf ${WRKSRC}/src/third_party/{libstemmer_c,yaml-cpp,zlib-*,zstandard,snappy-*}
cd ${WRKSRC}/src/third_party/mozjs/platform/x86_64/ && cp -R linux openbsd
cd ${WRKSRC}/src/third_party/mozjs/platform/aarch64/ && cp -R linux openbsd
do-install:
.for bin in mongod mongos
${INSTALL_PROGRAM} ${WRKSRC}/build/install/usr/local/bin/${bin} \
${PREFIX}/bin
if [ -f ${WRKSRC}/debian/${bin}.1 ]; then \
${INSTALL_MAN} ${WRKSRC}/debian/${bin}.1 ${PREFIX}/man/man1; \
fi
.endfor
${INSTALL_MAN} ${WRKSRC}/debian/mongodb-parameters.5 ${PREFIX}/man/man5
do-test:
@${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} -C ${WRKSRC} \
${MODSCONS_ENV} ${MODSCONS_FLAGS} install-unittests
cd ${WRKSRC} && ${MODPY_BIN} buildscripts/resmoke.py run \
--suites=unittests
.include <bsd.port.mk>
+4
View File
@@ -0,0 +1,4 @@
SHA256 (mongo-r8.0.12.tar.gz) = DpAAvYZ06LfE9IkG9nmflgSh1h95Igy7CZsjGlCsBeo=
SHA256 (mongodb-forks-spidermonkey-5acd3be6c9563ad3e7ca6182285c69a38de47bab.tar.gz) = FCBTPiOXAXH/ekIOPe0epJPhl2+4iWpf1vNeWy11czs=
SIZE (mongo-r8.0.12.tar.gz) = 98534080
SIZE (mongodb-forks-spidermonkey-5acd3be6c9563ad3e7ca6182285c69a38de47bab.tar.gz) = 280439685
+41
View File
@@ -0,0 +1,41 @@
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# network interfaces
net:
# Only listen on the local network interface. Change this only if you
# need a public-facing instance and have turned on authorization.
port: 27017
bindIp: 127.0.0.1
# how the process runs
processManagement:
fork: true
timeZoneInfo: /usr/share/zoneinfo
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
@@ -0,0 +1,74 @@
Index: SConstruct
--- SConstruct.orig
+++ SConstruct
@@ -120,7 +120,7 @@ def make_variant_dir_generator():
# Always randomize the build order to shake out missing edges, and to help the cache:
# http://scons.org/doc/production/HTML/scons-user/ch24s06.html
-SetOption('random', 1)
+#SetOption('random', 1)
# Options TODOs:
#
@@ -1730,6 +1730,7 @@ envDict = dict(
CONFIGURELOG='$BUILD_ROOT/scons/config.log',
CONFIG_HEADER_DEFINES={},
LIBDEPS_TAG_EXPANSIONS=[],
+ ENV = {'PATH': os.environ['PATH']},
MSVC_VERSION=variables_only_env.get("MSVC_VERSION"),
MSVC_TOOLSET_VERSION=variables_only_env.get("MSVC_TOOLSET_VERSION"),
)
@@ -1848,7 +1849,7 @@ if has_option('variables-help'):
unknown_vars = env_vars.UnknownVariables()
if unknown_vars:
- env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys())))
+ print("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys())))
install_actions.setup(env, get_option('install-action'))
@@ -2096,7 +2097,8 @@ if env.TargetOSIs('posix'):
env.Append(
CCFLAGS_WERROR=["-Werror"],
CXXFLAGS_WERROR=["-Werror=unused-result"] if env.ToolchainIs("clang") else [],
- LINKFLAGS_WERROR=["-Wl,--fatal-warnings"] if not env.TargetOSIs("darwin") else [],
+ # trips on API warnings in libc
+ #LINKFLAGS_WERROR=["-Wl,--fatal-warnings"] if not env.TargetOSIs("darwin") else [],
)
elif env.TargetOSIs('windows'):
env.Append(CCFLAGS_WERROR=["/WX"])
@@ -2796,7 +2798,7 @@ if env.TargetOSIs('linux'):
elif env.TargetOSIs('solaris'):
env.Append(LIBS=["socket", "resolv", "lgrp"])
-elif env.TargetOSIs('freebsd'):
+elif env.TargetOSIs('freebsd', 'openbsd'):
env.Append(LIBS=["kvm"])
env.Append(CCFLAGS=["-fno-omit-frame-pointer"])
@@ -3123,7 +3125,6 @@ if env.TargetOSIs('posix'):
env.Append(
CCFLAGS=[
"-fasynchronous-unwind-tables",
- "-g2" if not env.TargetOSIs('emscripten') else "-g",
"-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
@@ -3790,6 +3791,8 @@ def doConfigure(myenv):
# TODO SERVER-58675 - Remove this suppression after abseil is upgraded
myenv.AddToCXXFLAGSIfSupported("-Wno-deprecated-builtins")
+ # src/mongo/bson/bsonelement.h:1068:22: error: implicit conversion from 'std::numeric_limits<long long>::type' (aka 'long long') to 'double' changes value from 9223372036854775807 to 9223372036854775808
+ myenv.AddToCXXFLAGSIfSupported("-Wno-implicit-const-int-float-conversion")
# Check if we can set "-Wnon-virtual-dtor" when "-Werror" is set. The only time we can't set it is on
# clang 3.4, where a class with virtual function(s) and a non-virtual destructor throws a warning when
@@ -4974,7 +4977,7 @@ def doConfigure(myenv):
sslLibName = "ssl"
cryptoLibName = "crypto"
sslLinkDependencies = ["crypto", "dl"]
- if conf.env.TargetOSIs('freebsd'):
+ if conf.env.TargetOSIs('freebsd', 'openbsd'):
sslLinkDependencies = ["crypto"]
if conf.env.TargetOSIs('windows'):
@@ -0,0 +1,37 @@
Fix build with python 3.12
Index: buildscripts/moduleconfig.py
--- buildscripts/moduleconfig.py.orig
+++ buildscripts/moduleconfig.py
@@ -27,7 +27,7 @@ MongoDB SConscript files do.
__all__ = ('discover_modules', 'discover_module_directories', 'configure_modules',
'register_module_test') # pylint: disable=undefined-all-variable
-import imp
+import importlib
import inspect
import os
@@ -68,16 +68,12 @@ def discover_modules(module_root, allowed_modules):
try:
print("adding module: %s" % (name))
- fp = open(build_py, "r")
- try:
- module = imp.load_module("module_" + name, fp, build_py,
- (".py", "r", imp.PY_SOURCE))
- if getattr(module, "name", None) is None:
- module.name = name
- found_modules.append(module)
- found_module_names.append(name)
- finally:
- fp.close()
+ spec = importlib.util.spec_from_file_location("module_" + name, build_py)
+ module = importlib.util.module_from_spec(spec)
+ if getattr(module, "name", None) is None:
+ module.name = name
+ found_modules.append(module)
+ found_module_names.append(name)
except (FileNotFoundError, IOError):
pass
@@ -0,0 +1,19 @@
Index: buildscripts/scons.py
--- buildscripts/scons.py.orig
+++ buildscripts/scons.py
@@ -18,15 +18,6 @@ SITE_TOOLS_DIR = os.path.join(MONGODB_ROOT, 'site_scon
sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path
-# pylint: disable=C0413
-from mongo.pip_requirements import verify_requirements, MissingRequirements
-
-try:
- verify_requirements()
-except MissingRequirements as ex:
- print(ex)
- sys.exit(1)
-
try:
import SCons.Script
except ImportError as import_err:
@@ -0,0 +1,12 @@
Index: src/mongo/db/initialize_server_global_state.cpp
--- src/mongo/db/initialize_server_global_state.cpp.orig
+++ src/mongo/db/initialize_server_global_state.cpp
@@ -332,7 +332,7 @@ bool checkAndMoveLogFile(const std::string& absoluteLo
<< "\" should name a file, not a directory.");
}
- if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) {
+ if (!serverGlobalParams.logAppend && boost::filesystem::is_regular_file(absoluteLogpath)) {
std::string renameTarget = absoluteLogpath + "." + terseCurrentTimeForFilename();
boost::system::error_code ec;
boost::filesystem::rename(absoluteLogpath, renameTarget, ec);
@@ -0,0 +1,12 @@
Index: src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
--- src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp.orig
+++ src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -177,7 +177,7 @@ std::string extractIdentFromPath(const boost::filesyst
// Remove the file extension and convert to generic form (i.e. replace "\" with "/"
// on windows, no-op on unix).
- return boost::filesystem::change_extension(identWithExtension, "").generic_string();
+ return boost::filesystem::path(identWithExtension).replace_extension("").generic_string();
}
bool WiredTigerFileVersion::shouldDowngrade(bool hasRecoveryTimestamp) {
@@ -0,0 +1,14 @@
Index: src/mongo/platform/process_id.cpp
--- src/mongo/platform/process_id.cpp.orig
+++ src/mongo/platform/process_id.cpp
@@ -80,6 +80,10 @@ inline NativeProcessId getCurrentNativeThreadId() {
inline NativeProcessId getCurrentNativeThreadId() {
return pthread_getthreadid_np();
}
+#elif __OpenBSD__
+inline NativeProcessId getCurrentNativeThreadId() {
+ return getthrid();
+}
#else
inline NativeProcessId getCurrentNativeThreadId() {
return ::syscall(SYS_gettid);
@@ -0,0 +1,27 @@
Index: src/mongo/platform/waitable_atomic.cpp
--- src/mongo/platform/waitable_atomic.cpp.orig
+++ src/mongo/platform/waitable_atomic.cpp
@@ -235,6 +235,23 @@ bool waitUntil(const void* uaddr,
return timeoutOverflow || errno != ETIMEDOUT;
}
+#elif defined(__OpenBSD__)
+
+void notifyOne(const void* uaddr) {
+}
+
+void notifyMany(const void* uaddr, int nToWake) {
+}
+
+void notifyAll(const void* uaddr) {
+}
+
+bool waitUntil(const void* uaddr,
+ uint32_t old,
+ boost::optional<system_clock::time_point> deadline) {
+ return true;
+}
+
#else
#error "Need an implementation of waitUntil(), notifyOne(), notifyMany(), notifyAll() for this OS"
#endif
@@ -0,0 +1,11 @@
Index: src/mongo/util/net/sock.h
--- src/mongo/util/net/sock.h.orig
+++ src/mongo/util/net/sock.h
@@ -37,6 +37,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
+#include <unistd.h>
#ifdef __OpenBSD__
#include <sys/uio.h>
@@ -0,0 +1,19 @@
Index: src/mongo/util/net/socket_utils.cpp
--- src/mongo/util/net/socket_utils.cpp.orig
+++ src/mongo/util/net/socket_utils.cpp
@@ -225,6 +225,7 @@ void setSocketKeepAliveParams(int sock,
// steps, and we'll be able to get rid of this special case eventually.
windowsApplyMaxTcpKeepAlive(sock, severity, maxIdle, maxInterval);
#else // _WIN32
+#if ! defined(__OpenBSD__)
#if defined(__APPLE__)
int idleOpt = TCP_KEEPALIVE;
#else
@@ -236,6 +237,7 @@ void setSocketKeepAliveParams(int sock,
applyMax(sock, IPPROTO_TCP, idleOpt, iSec(maxIdle), "TCP_KEEPIDLE", severity);
applyMax(sock, IPPROTO_TCP, TCP_KEEPINTVL, iSec(maxInterval), "TCP_KEEPINTVL", severity);
#endif // _WIN32
+#endif // OpenBSD
}
std::string makeUnixSockPath(int port, StringData label) {
@@ -0,0 +1,13 @@
Index: src/mongo/util/options_parser/options_parser.cpp
--- src/mongo/util/options_parser/options_parser.cpp.orig
+++ src/mongo/util/options_parser/options_parser.cpp
@@ -34,8 +34,7 @@
#include <boost/any.hpp>
#include <boost/any/bad_any_cast.hpp>
#include <boost/core/typeinfo.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path_traits.hpp>
+#include <boost/filesystem.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/imbue.hpp>
@@ -0,0 +1,12 @@
Index: src/mongo/util/processinfo_openbsd.cpp
--- src/mongo/util/processinfo_openbsd.cpp.orig
+++ src/mongo/util/processinfo_openbsd.cpp
@@ -93,7 +93,7 @@ template <>
int getSysctlByIDWithDefault<std::string>(const int* sysctlID,
const int idLen,
const std::string& defaultValue,
- string* result) {
+ std::string* result) {
char value[256] = {0};
size_t len = sizeof(value);
if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) {
@@ -0,0 +1,12 @@
Index: src/mongo/util/time_support.cpp
--- src/mongo/util/time_support.cpp.orig
+++ src/mongo/util/time_support.cpp
@@ -888,7 +888,7 @@ class MachPort { (private)
// Find minimum timer resolution of OS
Nanoseconds getMinimumTimerResolution() {
Nanoseconds minTimerResolution;
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
struct timespec tp;
int ret = clock_getres(CLOCK_REALTIME, &tp);
if (ret == -1) {
@@ -0,0 +1,12 @@
Index: src/mongo/watchdog/watchdog.cpp
--- src/mongo/watchdog/watchdog.cpp.orig
+++ src/mongo/watchdog/watchdog.cpp
@@ -576,7 +576,7 @@ void checkFile(OperationContext* opCtx, const boost::f
std::string nowStr = now.toString();
// Apple does not support O_DIRECT, so instead we use fcntl to enable the F_NOCACHE flag later.
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(__OpenBSD__)
int fd = open(file.generic_string().c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
#else
int fd = open(file.generic_string().c_str(), O_RDWR | O_CREAT | O_DIRECT, S_IRUSR | S_IWUSR);
@@ -0,0 +1,12 @@
Index: src/third_party/abseil-cpp/dist/absl/base/internal/raw_logging.cc
--- src/third_party/abseil-cpp/dist/absl/base/internal/raw_logging.cc.orig
+++ src/third_party/abseil-cpp/dist/absl/base/internal/raw_logging.cc
@@ -235,7 +235,7 @@ void AsyncSignalSafeWriteError(const char* s, size_t l
#elif defined(ABSL_HAVE_SYSCALL_WRITE)
// We prefer calling write via `syscall` to minimize the risk of libc doing
// something "helpful".
- syscall(SYS_write, STDERR_FILENO, s, len);
+ write(STDERR_FILENO, s, len);
#elif defined(ABSL_HAVE_POSIX_WRITE)
write(STDERR_FILENO, s, len);
#elif defined(ABSL_HAVE_RAW_IO)
@@ -0,0 +1,111 @@
Index: src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp
--- src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp.orig
+++ src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp
@@ -87,7 +87,7 @@ context::context(context::method m)
#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) || defined(OPENSSL_NO_SSL2)
// SSL v3.
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
case context::sslv3:
handle_ = ::SSL_CTX_new(::TLS_method());
if (handle_)
@@ -132,7 +132,7 @@ context::context(context::method m)
#endif // defined(OPENSSL_NO_SSL3)
// TLS v1.0.
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
case context::tlsv1:
handle_ = ::SSL_CTX_new(::TLS_method());
if (handle_)
@@ -177,7 +177,7 @@ context::context(context::method m)
#endif // defined(SSL_TXT_TLSV1)
// TLS v1.1.
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
case context::tlsv11:
handle_ = ::SSL_CTX_new(::TLS_method());
if (handle_)
@@ -222,7 +222,7 @@ context::context(context::method m)
#endif // defined(SSL_TXT_TLSV1_1)
// TLS v1.2.
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
case context::tlsv12:
handle_ = ::SSL_CTX_new(::TLS_method());
if (handle_)
@@ -316,7 +316,7 @@ context::context(context::method m)
break;
// Any supported TLS version.
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
case context::tls:
handle_ = ::SSL_CTX_new(::TLS_method());
if (handle_)
@@ -386,7 +386,7 @@ context::~context()
{
if (handle_)
{
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
void* cb_userdata = handle_->default_passwd_callback_userdata;
@@ -397,7 +397,7 @@ context::~context()
static_cast<detail::password_callback_base*>(
cb_userdata);
delete callback;
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
::SSL_CTX_set_default_passwd_cb_userdata(handle_, 0);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
handle_->default_passwd_callback_userdata = 0;
@@ -734,7 +734,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain(
bio_cleanup bio = { make_buffer_bio(chain) };
if (bio.p)
{
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_);
void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
@@ -761,7 +761,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain(
ASIO_SYNC_OP_VOID_RETURN(ec);
}
-#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10002000L)
::SSL_CTX_clear_chain_certs(handle_);
#else
if (handle_->extra_certs)
@@ -838,7 +838,7 @@ ASIO_SYNC_OP_VOID context::use_private_key(
{
::ERR_clear_error();
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_);
void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
@@ -905,7 +905,7 @@ ASIO_SYNC_OP_VOID context::use_rsa_private_key(
{
::ERR_clear_error();
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_);
void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
@@ -1144,7 +1144,7 @@ int context::verify_callback_function(int preverified,
ASIO_SYNC_OP_VOID context::do_set_password_callback(
detail::password_callback_base* callback, asio::error_code& ec)
{
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
void* old_callback = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
::SSL_CTX_set_default_passwd_cb_userdata(handle_, callback);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
@@ -0,0 +1,12 @@
Index: src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c
--- src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c.orig
+++ src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c
@@ -166,7 +166,7 @@ bson_strerror_r (int err_code, /* I
// Could not obtain a valid `locale_t` object to satisfy `strerror_l`.
// Fallback to `bson_strncpy` below.
}
-#elif defined(_GNU_SOURCE)
+#elif defined(_GNU_SOURCE) || defined(__OpenBSD__)
// Unlikely, but continue supporting use of GNU extension in cases where the
// C Driver is being built without _XOPEN_SOURCE=700.
ret = strerror_r (err_code, buf, buflen);
@@ -0,0 +1,12 @@
Index: src/third_party/libmongocrypt/dist/src/mongocrypt-util.c
--- src/third_party/libmongocrypt/dist/src/mongocrypt-util.c.orig
+++ src/third_party/libmongocrypt/dist/src/mongocrypt-util.c
@@ -78,7 +78,7 @@ current_module_result current_module_path(void) {
}
free(path);
}
-#elif defined(_GNU_SOURCE) || defined(_DARWIN_C_SOURCE) || defined(__FreeBSD__)
+#elif defined(_GNU_SOURCE) || defined(_DARWIN_C_SOURCE) || defined(__FreeBSD__) || defined(__OpenBSD__)
// Darwin/BSD/glibc define extensions for finding dynamic library info from
// the address of a symbol.
Dl_info info;
@@ -0,0 +1,18 @@
Index: src/third_party/libmongocrypt/dist/src/os_posix/os_dll.c
--- src/third_party/libmongocrypt/dist/src/os_posix/os_dll.c.orig
+++ src/third_party/libmongocrypt/dist/src/os_posix/os_dll.c
@@ -113,6 +113,14 @@ mcr_dll_path_result mcr_dll_path(mcr_dll dll) {
// Handled in os_win/os_dll.c
+#elif defined(__OpenBSD__)
+
+// XXXX
+mcr_dll_path_result mcr_dll_path(mcr_dll dll) {
+ mcr_dll_path_result r;
+ return r;
+}
+
#else
#error "Don't know how to do mcr_dll_path() on this platform"
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/SConscript
--- src/third_party/mozjs/SConscript.orig
+++ src/third_party/mozjs/SConscript
@@ -147,7 +147,7 @@ sources = [
"extract/js/src/wasm/WasmCode-platform.cpp",
]
-if env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'):
+if False and env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'):
env.Append(CCFLAGS=['-mavx2'])
sources.extend(["extract/mozglue/misc/SIMD_avx2.cpp", "extract/mozglue/misc/SSE.cpp"])
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/extract/js/src/threading/posix/PosixThread.cpp
--- src/third_party/mozjs/extract/js/src/threading/posix/PosixThread.cpp.orig
+++ src/third_party/mozjs/extract/js/src/threading/posix/PosixThread.cpp
@@ -125,7 +125,7 @@ void ThisThread::GetName(char* nameBuffer, size_t len)
MOZ_RELEASE_ASSERT(len >= 16);
int rv = -1;
-#ifdef HAVE_PTHREAD_GETNAME_NP
+#if defined(HAVE_PTHREAD_GETNAME_NP) && ! defined(__OpenBSD__)
rv = pthread_getname_np(pthread_self(), nameBuffer, len);
#elif defined(HAVE_PTHREAD_GET_NAME_NP)
pthread_get_name_np(pthread_self(), nameBuffer, len);
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/extract/js/src/vm/ArrayBufferObject.cpp
--- src/third_party/mozjs/extract/js/src/vm/ArrayBufferObject.cpp.orig
+++ src/third_party/mozjs/extract/js/src/vm/ArrayBufferObject.cpp
@@ -278,7 +278,7 @@ bool js::ExtendBufferMapping(void* dataPointer, size_t
return true;
#elif defined(__wasi__)
return false;
-#elif defined(XP_LINUX)
+#elif defined(XP_LINUX) && !defined(__OpenBSD__)
// Note this will not move memory (no MREMAP_MAYMOVE specified)
if (MAP_FAILED == mremap(dataPointer, mappedSize, newMappedSize, 0)) {
return false;
@@ -0,0 +1,40 @@
Index: src/third_party/mozjs/extract/mfbt/TaggedAnonymousMemory.cpp
--- src/third_party/mozjs/extract/mfbt/TaggedAnonymousMemory.cpp.orig
+++ src/third_party/mozjs/extract/mfbt/TaggedAnonymousMemory.cpp
@@ -4,13 +4,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifdef XP_LINUX
+#if defined(XP_LINUX) || defined(__OpenBSD__)
# include "mozilla/TaggedAnonymousMemory.h"
# include <sys/types.h>
# include <sys/mman.h>
+#if defined(XP_LINUX) && !defined(__OpenBSD__)
# include <sys/prctl.h>
+#endif
# include <sys/syscall.h>
# include <unistd.h>
@@ -31,9 +33,13 @@ namespace mozilla {
// Returns 0 for success and -1 (with errno) for error.
static int TagAnonymousMemoryAligned(const void* aPtr, size_t aLength,
const char* aTag) {
+#if defined(XP_LINUX) && !defined(__OpenBSD__)
return prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME,
reinterpret_cast<unsigned long>(aPtr), aLength,
reinterpret_cast<unsigned long>(aTag));
+#else
+ return -1;
+#endif
}
// On some architectures, it's possible for the page size to be larger
@@ -80,4 +86,4 @@ void* MozTaggedAnonymousMmap(void* aAddr, size_t aLeng
return mapped;
}
-#endif // XP_LINUX
+#endif // defined(XP_LINUX) || defined(__OpenBSD__)
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp
--- src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp.orig
+++ src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp
@@ -448,7 +448,7 @@ const char* SIMD::memchr8SSE2(const char* ptr, char va
// assertion failure. Accordingly, we just don't allow that to happen. We
// are not particularly concerned about ensuring that newer 32 bit processors
// get access to the AVX2 functions exposed here.
-# if defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__)
+# if 0 && defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__)
bool SupportsAVX2() { return supports_avx2(); }
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/extract/mozglue/misc/TimeStamp_posix.cpp
--- src/third_party/mozjs/extract/mozglue/misc/TimeStamp_posix.cpp.orig
+++ src/third_party/mozjs/extract/mozglue/misc/TimeStamp_posix.cpp
@@ -214,7 +214,7 @@ TimeStamp TimeStamp::Now(bool aHighResolution) {
return TimeStamp(ClockTimeNs(CLOCK_MONOTONIC));
}
-#if defined(XP_LINUX) || defined(ANDROID)
+#if (defined(XP_LINUX) || defined(ANDROID)) && ! defined(__OpenBSD__)
// Calculates the amount of jiffies that have elapsed since boot and up to the
// starttime value of a specific process as found in its /proc/*/stat file.
@@ -0,0 +1,28 @@
Index: src/third_party/mozjs/gen-config.sh
--- src/third_party/mozjs/gen-config.sh.orig
+++ src/third_party/mozjs/gen-config.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
set -e
set -v
@@ -50,6 +50,9 @@ case "$_Path" in
"platform/x86_64/openbsd")
_CONFIG_OPTS="--host=x86_64-openbsd"
;;
+ "platform/aarch64/openbsd")
+ _CONFIG_OPTS="--host=aarch64-openbsd"
+ ;;
"platform/x86_64/windows")
_CONFIG_OPTS="--host=x86_64-windows-msvc"
;;
@@ -111,7 +114,7 @@ CFLAGS="$CFLAGS -D__STDC_FORMAT_MACROS" \
--disable-wasm-moz-intgemm \
"$_CONFIG_OPTS"
-make recurse_export
+gmake recurse_export
cd ../../../..
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/platform/aarch64/openbsd/build/js-confdefs.h
--- src/third_party/mozjs/platform/aarch64/openbsd/build/js-confdefs.h.orig
+++ src/third_party/mozjs/platform/aarch64/openbsd/build/js-confdefs.h
@@ -67,7 +67,7 @@
#define JS_PUNBOX64 1
#define JS_STANDALONE 1
#define JS_WITHOUT_NSPR 1
-#define MALLOC_H <malloc.h>
+#define MALLOC_H <stdlib.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.12.0"
@@ -0,0 +1,12 @@
Index: src/third_party/mozjs/platform/x86_64/openbsd/build/js-confdefs.h
--- src/third_party/mozjs/platform/x86_64/openbsd/build/js-confdefs.h.orig
+++ src/third_party/mozjs/platform/x86_64/openbsd/build/js-confdefs.h
@@ -68,7 +68,7 @@
#define JS_PUNBOX64 1
#define JS_STANDALONE 1
#define JS_WITHOUT_NSPR 1
-#define MALLOC_H <malloc.h>
+#define MALLOC_H <stdlib.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.12.0"
+6
View File
@@ -0,0 +1,6 @@
MongoDB (from "humongous") is an open source, high-performance,
schema-free, document-oriented database written in the C++ programming
language.
Note that some regression tests do fail in this port, so carefully check
whether it is reliable for your use case.
+21
View File
@@ -0,0 +1,21 @@
@option is-branch
@newgroup _mongodb:670
@newuser _mongodb:670:670::MongoDB Account:/nonexistent:/sbin/nologin
@rcscript ${RCDIR}/mongod
@mode 750
@owner _mongodb
@group _mongodb
@sample /var/mongodb/
@sample /var/mongodb/data/
@sample /var/log/mongodb/
@mode
@owner
@group
@bin bin/mongod
@bin bin/mongos
@man man/man1/mongod.1
@man man/man1/mongos.1
@man man/man5/mongodb-parameters.5
share/examples/mongodb/
share/examples/mongodb/mongodb.conf
@sample ${SYSCONFDIR}/mongodb.conf
+11
View File
@@ -0,0 +1,11 @@
#!/bin/ksh
daemon="${TRUEPREFIX}/bin/mongod"
daemon_flags="-f ${SYSCONFDIR}/mongodb.conf"
daemon_user="_mongodb"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1
+1
View File
@@ -1,4 +1,5 @@
SUBDIR =
SUBDIR += 44
SUBDIR += 80
.include <bsd.port.subdir.mk>