Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.7 2015/08/26 05:03:00 fhajny Exp $
# $NetBSD: Makefile,v 1.16 2016/09/26 13:28:14 ryoon Exp $
DISTNAME= mongodb-src-r3.0.6
DISTNAME= mongodb-src-r3.2.9
PKGNAME= ${DISTNAME:S/src-r//:S/-rc/rc/}
CATEGORIES= databases
MASTER_SITES= http://fastdl.mongodb.org/src/
@@ -17,29 +17,21 @@ BUILD_DEPENDS+= scons-[0-9]*:../../devel/scons
SCONS_BIN= ${PREFIX}/bin/scons
SCONS_ARGS= ${_MAKE_JOBS}
SCONS_ARGS+= --c++11=on
SCONS_ARGS+= --cc=${WRAPPER_BINDIR}/${CC:Q}
SCONS_ARGS+= --cxx=${WRAPPER_BINDIR}/${CXX:Q}
SCONS_ARGS+= --use-system-boost=USE-SYSTEM-BOOST
SCONS_ARGS+= --use-system-pcre=USE-SYSTEM-PCRE
SCONS_ARGS+= --use-system-snappy=USE-SYSTEM-SNAPPY
SCONS_ARGS+= --use-system-tcmalloc=USE-SYSTEM-TCMALLOC
SCONS_ARGS+= --js-engine=v8-3.25
# Avoid Argument list too long from mongod linking
SCONS_ARGS+= --variant-dir=pkgsrc
SCONS_ARGS+= --use-system-boost
SCONS_ARGS+= --use-system-pcre
SCONS_ARGS+= --use-system-snappy
SCONS_ARGS+= --use-system-tcmalloc
SCONS_ARGS+= --use-system-yaml
SCONS_ARGS+= --use-system-zlib
SCONS_ARGS+= --js-engine=mozjs
SCONS_ARGS+= --release
PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # not yet supported as of 3.0.4
PYTHON_VERSIONS_INCOMPATIBLE= 34 35 # not yet supported as of 3.0.4
.include "../../mk/bsd.prefs.mk"
GCC_REQD+= 4.8.2
.if ${MACHINE_ARCH} == "x86_64"
SCONS_ARGS+= --64
.else
SCONS_ARGS+= --32
.endif
CPPFLAGS+= -fno-jump-tables
.include "options.mk"
@@ -101,6 +93,10 @@ CONF_FILES+= share/examples/mongodb/mongod.conf \
post-extract:
chmod -R g-w ${WRKSRC}
cp -r ${WRKSRC}/src/third_party/mozjs-38/platform/x86_64/freebsd \
${WRKSRC}/src/third_party/mozjs-38/platform/x86_64/dragonfly
cp -r ${WRKSRC}/src/third_party/mozjs-38/platform/x86_64/openbsd \
${WRKSRC}/src/third_party/mozjs-38/platform/x86_64/netbsd
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SCONS_BIN} ${SCONS_ARGS} core
@@ -127,5 +123,7 @@ post-install:
.include "../../devel/libexecinfo/buildlink3.mk"
.include "../../devel/pcre/buildlink3.mk"
.include "../../devel/snappy/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../net/libpcap/buildlink3.mk"
.include "../../textproc/yaml-cpp/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View File

@@ -1,18 +1,23 @@
$NetBSD: distinfo,v 1.7 2015/09/08 07:48:19 fhajny Exp $
$NetBSD: distinfo,v 1.15 2016/09/26 13:28:14 ryoon Exp $
SHA1 (mongodb-src-r3.0.6.tar.gz) = b80acf2cd63b3bce27d860581ce17a3aad2b8ea8
RMD160 (mongodb-src-r3.0.6.tar.gz) = 3e3dc920c0790826b54d02e5a82faace48da9e9f
Size (mongodb-src-r3.0.6.tar.gz) = 26241944 bytes
SHA1 (patch-SConstruct) = 71f06ac82474f81a6b1b6660cd9e23cd5a63d55f
SHA1 (patch-debian_mongod.conf) = 35f3d7e7da4f573458bef0fe742c1790adec8200
SHA1 (mongodb-src-r3.2.9.tar.gz) = 22b702cd8e18ef1d6ae5fefecef9e39ca0b26549
RMD160 (mongodb-src-r3.2.9.tar.gz) = 44533a4c23c69b87421428acab9657f705326282
SHA512 (mongodb-src-r3.2.9.tar.gz) = 83187167c9775065ac24da180c6483bfc1580e085cfb7ff27572c812b9eee9ec7e9800d5da2238c333f03c641cc0e41b067341f28578ffc4513369a3f99dc002
Size (mongodb-src-r3.2.9.tar.gz) = 28950352 bytes
SHA1 (patch-SConstruct) = aa9bcab6be8785f03cdb30acef1eb37e489d661f
SHA1 (patch-debian_mongod.conf) = d4146b3d62b4472d55609c7f6aaa596f8f893d1f
SHA1 (patch-src_mongo_base_initializer.h) = add32c5940c922a98122d0e6883eb3ad52dc25c5
SHA1 (patch-src_mongo_db_repl_isself.c) = c27e7ac0f19158eff9d5bf59d5d07835ab222bc4
SHA1 (patch-src_mongo_platform_random.cpp) = 4e962e0ffdcbd80956bacebfcb052cb25508d4ca
SHA1 (patch-src_mongo_shell_linenoise__utf8.h) = 2d18e46cb63313e6fb09714e0662c98347f4f74e
SHA1 (patch-src_mongo_util_intrusive__counter.h) = d242db05708c999bd19f2751bdc881db50ea81f0
SHA1 (patch-src_third__party_s2_base_port.h) = 8e715efbfcacaba51d957c21aa32ccfd3cc4f736
SHA1 (patch-src_third__party_v8-3.25_SConscript) = a8da59130c36b2be3b89498ba0b23b1c7c9ab9e6
SHA1 (patch-src_third__party_v8-3.25_src_platform-posix.cc) = 2fa27016a9af828d1c01815739770918a2d53d16
SHA1 (patch-src_third__party_v8-3.25_src_platform_semaphore.cc) = 92447c13b379eeb4d9f8bac9455d78d54b4f9e32
SHA1 (patch-src_third__party_wiredtiger_SConscript) = b9ed24d0c05e812d66941f94a77cf4c91f55d43b
SHA1 (patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h) = e41064c0ff7268efc795782312ff413295cbcba7
SHA1 (patch-src_mongo_db_repl_isself.c) = 8cb386b7b0a8925908f20ac9b9b18cac796367ba
SHA1 (patch-src_mongo_platform_random.cpp) = 59c31e55fc2dc5a2b82b8f16dacf8736d8354cdb
SHA1 (patch-src_mongo_platform_stack__locator__dragonfly.cpp) = fb885c491e4de1cfbc2875620d854af726e5b45f
SHA1 (patch-src_mongo_platform_stack__locator__netbsd.cpp) = 3b09e86b2401555b6ab4c31d14c0693d766119c2
SHA1 (patch-src_mongo_shell_linenoise__utf8.h) = f975925f56125d48b5124894fa1adf1382a634d2
SHA1 (patch-src_mongo_util_intrusive__counter.h) = 9f1af59e1bc86e33bf183a6dda1737007afc7a18
SHA1 (patch-src_mongo_util_processinfo__dragonfly.cpp) = 62c236ce820dfe81f45625b15e022cca0f2c10ee
SHA1 (patch-src_mongo_util_processinfo__netbsd.cpp) = 4c746c4c3a79df849994c00a4639662d8a2c799d
SHA1 (patch-src_third__party_mozjs-38_platform_x86__64_netbsd_build_js-confdefs.h) = 81107c2d368884dc0d2fddc03862fe58f2035206
SHA1 (patch-src_third__party_mozjs-38_platform_x86__64_netbsd_include_js-config.h) = f2b90732fd18048cf7feac44cca54c99a2420a4a
SHA1 (patch-src_third__party_s2_base_port.h) = 892ce91b5aaa432f34e1e7c169b7fd6eea2a3e94
SHA1 (patch-src_third__party_wiredtiger_SConscript) = 9b11a7703f4db845fb38ba996238fe1ca7f24767
SHA1 (patch-src_third__party_wiredtiger_build__dragonfly_wiredtiger__config.h) = 0b00da401f832d985107dfa5dcc6447db4beec6d
SHA1 (patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h) = 63d3a0cc66d9fcc76b21150de8be1b6e050b7d8d

View File

@@ -1,7 +1,12 @@
# $NetBSD: options.mk,v 1.1 2015/05/02 08:10:33 ryoon Exp $
# $NetBSD: options.mk,v 1.3 2016/02/26 16:03:09 fhajny Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.mongodb
PKG_SUPPORTED_OPTIONS= ssl
PKG_SUPPORTED_OPTIONS= ssl wiredtiger
PKG_SUGGESTED_OPTIONS= #
.if !empty(MACHINE_ARCH:Mx86_64)
PKG_SUGGESTED_OPTIONS+= wiredtiger
.endif
.include "../../mk/bsd.options.mk"
@@ -9,3 +14,15 @@ PKG_SUPPORTED_OPTIONS= ssl
.include "../../security/openssl/buildlink3.mk"
SCONS_ARGS+= --ssl
.endif
# The prospect of using databases/wiredtiger is unclear yet;
# MongoDB doesn't provide guarantees for non-bundled WiredTiger:
# https://groups.google.com/forum/#!msg/mongodb-dev/31FQSo4KVCI/Fx-WtJ9fzU4J
.if !empty(PKG_OPTIONS:Mwiredtiger)
. if empty(MACHINE_ARCH:Mx86_64)
PKG_FAIL_REASON+= "WiredTiger is not supported on 32-bit platforms"
. endif
SCONS_ARGS+= --wiredtiger=on
.else
SCONS_ARGS+= --wiredtiger=off
.endif

View File

@@ -1,69 +1,86 @@
$NetBSD: patch-SConstruct,v 1.2 2015/05/05 15:54:49 joerg Exp $
$NetBSD: patch-SConstruct,v 1.4 2016/06/17 11:51:08 fhajny Exp $
Add support for NetBSD/Dragonfly, fix locations.
--- SConstruct.orig 2015-04-08 20:28:08.000000000 +0000
--- SConstruct.orig 2016-06-02 14:46:27.000000000 +0000
+++ SConstruct
@@ -53,7 +53,9 @@ nix = False
linux = False
darwin = False
windows = False
+dragonfly = False
freebsd = False
+netbsd = False
openbsd = False
solaris = False
@@ -40,8 +40,12 @@ def get_running_os_name():
running_os = os.sys.platform
if running_os.startswith('linux'):
running_os = 'linux'
+ elif running_os.startswith('dragonfly'):
+ running_os = 'dragonfly'
elif running_os.startswith('freebsd'):
running_os = 'freebsd'
+ elif running_os.startswith('netbsd'):
+ running_os = 'netbsd'
elif running_os.startswith('openbsd'):
running_os = 'openbsd'
elif running_os == 'sunos5':
@@ -59,7 +63,7 @@ def env_get_os_name_wrapper(self):
@@ -65,8 +67,12 @@ elif platform.startswith("linux"):
platform = "linux"
elif "sunos5" == platform:
solaris = True
+elif platform.startswith( "dragonfly" ):
+ dragonfly = True
elif platform.startswith( "freebsd" ):
freebsd = True
+elif platform.startswith( "netbsd" ):
+ netbsd = True
elif platform.startswith( "openbsd" ):
openbsd = True
elif "win32" == platform:
@@ -571,6 +577,7 @@ envDict = dict(BUILD_ROOT=buildDir,
CONFIGUREDIR=sconsDataDir.Dir('sconf_temp'),
CONFIGURELOG=sconsDataDir.File('config.log'),
def is_os_raw(target_os, os_list_to_check):
okay = False
- posix_os_list = [ 'linux', 'openbsd', 'freebsd', 'osx', 'solaris' ]
+ posix_os_list = [ 'linux', 'openbsd', 'freebsd', 'osx', 'solaris', 'dragonfly', 'netbsd' ]
for p in os_list_to_check:
if p == 'posix' and target_os in posix_os_list:
@@ -831,6 +835,7 @@ envDict = dict(BUILD_ROOT=buildDir,
INSTALL_DIR=installDir,
+ ENV = os.environ
CONFIG_HEADER_DEFINES={},
LIBDEPS_TAG_EXPANSIONS=[],
+ ENV = os.environ,
)
if windows:
@@ -848,6 +855,12 @@ elif solaris:
env.Append( CPPDEFINES=[ "__sunos__" ] )
env = Environment(variables=env_vars, **envDict)
@@ -968,7 +973,9 @@ def CheckForProcessor(context, which_arc
os_macros = {
"windows": "_WIN32",
"solaris": "__sun",
+ "dragonfly": "__DragonFly__",
"freebsd": "__FreeBSD__",
+ "netbsd": "__NetBSD__",
"openbsd": "__OpenBSD__",
"osx": "__APPLE__",
"linux": "__linux__",
@@ -1233,7 +1240,7 @@ if env['_LIBDEPS'] == '$_LIBDEPS_OBJS':
libdeps.setup_environment(env, emitting_shared=(link_model.startswith("dynamic")))
-if env.TargetOSIs('linux', 'freebsd', 'openbsd'):
+if env.TargetOSIs('linux', 'dragonfly', 'freebsd', 'netbsd', 'openbsd'):
env['LINK_LIBGROUP_START'] = '-Wl,--start-group'
env['LINK_LIBGROUP_END'] = '-Wl,--end-group'
env['LINK_WHOLE_ARCHIVE_START'] = '-Wl,--whole-archive'
@@ -1261,10 +1268,24 @@ if env.TargetOSIs('linux'):
elif env.TargetOSIs('solaris'):
env.Append( LIBS=["socket","resolv","lgrp"] )
+elif os.sys.platform.startswith( "dragonfly" ):
+ env.Append( CPPPATH=[ "/usr/pkg/include" ] )
+ env.Append( LIBPATH=[ "/usr/pkg/lib" ] )
+ env.Append( LIBS=[ "m" ] )
+ env.Append( LIBS=[ "kvm" ] )
+ env.Append( CPPDEFINES=[ "__dragonfly__" ] )
+
elif freebsd:
elif env.TargetOSIs('freebsd'):
env.Append( LIBS=[ "kvm" ] )
env.Append( EXTRACPPPATH=[ "/usr/local/include" ] )
@@ -855,6 +868,12 @@ elif freebsd:
env.Append( CPPDEFINES=[ "__freebsd__" ] )
env.Append( CCFLAGS=[ "-fno-omit-frame-pointer" ] )
+elif os.sys.platform.startswith( "netbsd" ):
+ env.Append( CPPPATH=[ "/usr/pkg/include" ] )
+ env.Append( LIBPATH=[ "/usr/pkg/lib" ] )
+ env.Append( LIBS=[ "m" ] )
+ env.Append( LIBS=[ "kvm" ] )
+ env.Append( CPPDEFINES=[ "__netbsd__" ] )
+
elif openbsd:
env.Append( EXTRACPPPATH=[ "/usr/local/include" ] )
env.Append( EXTRALIBPATH=[ "/usr/local/lib" ] )
@@ -1020,8 +1039,11 @@ if nix:
elif env.TargetOSIs('openbsd'):
env.Append( LIBS=[ "kvm" ] )
@@ -1432,8 +1453,11 @@ if env.TargetOSIs('posix'):
if not has_option("disable-warnings-as-errors"):
env.Append( CCFLAGS=["-Werror"] )
env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+ env.Append( CPPDEFINES=["XP_UNIX=1"] )
env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
@@ -72,21 +89,20 @@ Add support for NetBSD/Dragonfly, fix locations.
# SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
# startup.
@@ -2163,7 +2185,7 @@ def doConfigure(myenv):
Exit(1)
@@ -2406,6 +2430,7 @@ def doConfigure(myenv):
# permit more than four parameters.
"BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD",
"BOOST_SYSTEM_NO_DEPRECATED",
+ "BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE",
]
)
@@ -2472,7 +2497,7 @@ def doConfigure(myenv):
myenv.ConfError("Couldn't find SASL header/libraries")
# requires ports devel/libexecinfo to be installed
- if freebsd or openbsd:
+ if freebsd or openbsd or netbsd or dragonfly:
- if env.TargetOSIs('freebsd', 'openbsd'):
+ if env.TargetOSIs('dragonfly', 'freebsd', 'netbsd', 'openbsd'):
if not conf.CheckLib("execinfo"):
print("Cannot find libexecinfo, please install devel/libexecinfo.")
Exit(1)
@@ -2409,7 +2431,7 @@ Export("mongoCodeVersion")
Export("usev8")
Export("v8version v8suffix")
Export("boostSuffix")
-Export("darwin windows solaris linux freebsd nix openbsd")
+Export("darwin windows solaris linux freebsd nix openbsd netbsd dragonfly")
Export('module_sconscripts')
Export("debugBuild optBuild")
Export("s3push")
myenv.ConfError("Cannot find libexecinfo, please install devel/libexecinfo.")

View File

@@ -1,23 +1,23 @@
$NetBSD: patch-debian_mongod.conf,v 1.1 2015/05/02 08:10:33 ryoon Exp $
$NetBSD: patch-debian_mongod.conf,v 1.3 2016/02/12 03:37:24 ryoon Exp $
Use proper paths in default config file.
--- debian/mongod.conf.orig 2014-04-07 00:36:57.000000000 +0000
--- debian/mongod.conf.orig 2016-01-05 18:31:44.000000000 +0000
+++ debian/mongod.conf
@@ -5,13 +5,15 @@
# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
-dbpath=/var/lib/mongodb
+dbpath=@MONGODB_DBPATH@
@@ -5,7 +5,7 @@
#where to log
-logpath=/var/log/mongodb/mongod.log
+logpath=@MONGODB_LOGPATH@/mongod.log
# Where and how to store data.
storage:
- dbPath: /var/lib/mongodb
+ dbPath: @MONGODB_DBPATH@
journal:
enabled: true
# engine:
@@ -16,7 +16,7 @@ storage:
systemLog:
destination: file
logAppend: true
- path: /var/log/mongodb/mongod.log
+ path: @MONGODB_DBPATH@/mongod.log
logappend=true
+pidfilepath = @MONGODB_DBPATH@/mongod.pid
+
#port = 27017
# Listen to local interface only. Comment out to listen on all interfaces.
# network interfaces
net:

View File

@@ -1,15 +1,15 @@
$NetBSD: patch-src_mongo_db_repl_isself.c,v 1.2 2015/08/26 05:03:00 fhajny Exp $
$NetBSD: patch-src_mongo_db_repl_isself.c,v 1.3 2016/02/12 03:37:24 ryoon Exp $
* Add NetBSD support.
--- src/mongo/db/repl/isself.cpp.orig 2015-08-24 00:39:52.000000000 +0000
--- src/mongo/db/repl/isself.cpp.orig 2016-01-05 18:31:44.000000000 +0000
+++ src/mongo/db/repl/isself.cpp
@@ -48,7 +48,7 @@
#include "mongo/util/log.h"
#if defined(__linux__) || defined(__APPLE__) || defined(__freebsd__) || defined(__sunos__) || \
- defined(__openbsd__)
+ defined(__openbsd__) || defined(__netbsd__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) || \
- defined(__OpenBSD__)
+ defined(__OpenBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
#define FASTPATH_UNIX 1
#endif
@@ -17,8 +17,8 @@ $NetBSD: patch-src_mongo_db_repl_isself.c,v 1.2 2015/08/26 05:03:00 fhajny Exp $
#include <ifaddrs.h>
#include <netdb.h>
-#ifdef __freebsd__
+#if defined __freebsd__ || defined __netbsd__
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <netinet/in.h>
#endif

View File

@@ -1,14 +1,14 @@
$NetBSD: patch-src_mongo_platform_random.cpp,v 1.2 2015/08/26 05:03:00 fhajny Exp $
$NetBSD: patch-src_mongo_platform_random.cpp,v 1.3 2016/02/12 03:37:24 ryoon Exp $
Add NetBSD support.
--- src/mongo/platform/random.cpp.orig 2015-08-24 00:39:52.000000000 +0000
--- src/mongo/platform/random.cpp.orig 2016-01-05 18:31:44.000000000 +0000
+++ src/mongo/platform/random.cpp
@@ -116,7 +116,7 @@ SecureRandom* SecureRandom::create() {
@@ -145,7 +145,7 @@ SecureRandom* SecureRandom::create() {
return new WinSecureRandom();
}
-#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__freebsd__)
+#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__freebsd__) || defined(__netbsd__)
-#elif defined(__linux__) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
class InputStreamSecureRandom : public SecureRandom {
public:

View File

@@ -0,0 +1,63 @@
$NetBSD: patch-src_mongo_platform_stack__locator__dragonfly.cpp,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/mongo/platform/stack_locator_dragonfly.cpp.orig 2016-02-11 11:27:13.489023328 +0000
+++ src/mongo/platform/stack_locator_dragonfly.cpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (C) 2015 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/platform/basic.h"
+
+#include "mongo/platform/stack_locator.h"
+
+#include <pthread.h>
+#include <pthread_np.h>
+
+#include "mongo/util/assert_util.h"
+#include "mongo/util/scopeguard.h"
+
+namespace mongo {
+
+StackLocator::StackLocator() {
+ pthread_attr_t attr;
+ size_t size;
+
+ pthread_t self = pthread_self();
+
+ invariant(pthread_attr_init(&attr) == 0);
+ ON_BLOCK_EXIT(pthread_attr_destroy, &attr);
+
+ invariant(pthread_attr_get_np(self, &attr) == 0);
+
+ invariant(pthread_attr_getstack(&attr, &_end, &size) == 0);
+
+ // TODO: Assumes stack grows downward on FreeBSD
+ _begin = static_cast<char*>(_end) + size;
+}
+
+} // namespace mongo

View File

@@ -0,0 +1,63 @@
$NetBSD: patch-src_mongo_platform_stack__locator__netbsd.cpp,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/mongo/platform/stack_locator_netbsd.cpp.orig 2016-02-11 12:24:33.443209041 +0000
+++ src/mongo/platform/stack_locator_netbsd.cpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (C) 2015 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/platform/basic.h"
+
+#include "mongo/platform/stack_locator.h"
+
+#include <pthread.h>
+
+
+#include "mongo/util/assert_util.h"
+#include "mongo/util/scopeguard.h"
+
+namespace mongo {
+
+StackLocator::StackLocator() {
+ pthread_attr_t attr;
+ size_t size;
+
+ pthread_t self = pthread_self();
+
+ invariant(pthread_attr_init(&attr) == 0);
+ ON_BLOCK_EXIT(pthread_attr_destroy, &attr);
+
+ invariant(pthread_attr_get_np(self, &attr) == 0);
+
+ invariant(pthread_attr_getstack(&attr, &_end, &size) == 0);
+
+ // TODO: Assumes stack grows downward on FreeBSD
+ _begin = static_cast<char*>(_end) + size;
+}
+
+} // namespace mongo

View File

@@ -1,17 +1,17 @@
$NetBSD: patch-src_mongo_shell_linenoise__utf8.h,v 1.2 2015/08/26 05:03:00 fhajny Exp $
$NetBSD: patch-src_mongo_shell_linenoise__utf8.h,v 1.3 2016/02/12 03:37:24 ryoon Exp $
Use Boost swap instead of std. Fixes build on SunOS.
--- src/mongo/shell/linenoise_utf8.h.orig 2015-08-24 00:39:52.000000000 +0000
--- src/mongo/shell/linenoise_utf8.h.orig 2016-01-05 18:31:44.000000000 +0000
+++ src/mongo/shell/linenoise_utf8.h
@@ -27,6 +27,7 @@
* then also delete it in the license file.
*/
+#include <boost/core/swap.hpp>
#include <boost/smart_ptr/scoped_array.hpp>
#include <algorithm>
#include <memory>
#include <string.h>
@@ -173,9 +174,9 @@ struct UtfStringMixin {
@@ -178,9 +179,9 @@ struct UtfStringMixin {
}
void swap(UtfStringMixin& other) {

View File

@@ -1,6 +1,6 @@
$NetBSD: patch-src_mongo_util_intrusive__counter.h,v 1.1 2015/05/05 15:54:49 joerg Exp $
$NetBSD: patch-src_mongo_util_intrusive__counter.h,v 1.2 2016/02/12 03:37:24 ryoon Exp $
--- src/mongo/util/intrusive_counter.h.orig 2015-05-05 12:50:27.000000000 +0000
--- src/mongo/util/intrusive_counter.h.orig 2016-01-05 18:31:44.000000000 +0000
+++ src/mongo/util/intrusive_counter.h
@@ -28,6 +28,7 @@
@@ -8,5 +8,5 @@ $NetBSD: patch-src_mongo_util_intrusive__counter.h,v 1.1 2015/05/05 15:54:49 joe
+#include <cstdlib>
#include <boost/intrusive_ptr.hpp>
#include <boost/noncopyable.hpp>
#include "mongo/platform/atomic_word.h"
#include <stdlib.h>

View File

@@ -0,0 +1,195 @@
$NetBSD: patch-src_mongo_util_processinfo__dragonfly.cpp,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/mongo/util/processinfo_dragonfly.cpp.orig 2016-02-11 12:26:02.935580479 +0000
+++ src/mongo/util/processinfo_dragonfly.cpp
@@ -0,0 +1,190 @@
+/* Copyright 2012 10gen Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects
+ * for all of the code used other than as permitted herein. If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so. If you do not
+ * wish to do so, delete this exception statement from your version. If you
+ * delete this exception statement from all source files in the program,
+ * then also delete it in the license file.
+ */
+
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kControl
+
+#include <cstdlib>
+#include <string>
+
+#include <kvm.h>
+#include <sys/file.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/vmmeter.h>
+#include <unistd.h>
+#include <vm/vm_param.h>
+
+#include "mongo/util/scopeguard.h"
+#include "mongo/util/log.h"
+#include "processinfo.h"
+
+using namespace std;
+
+namespace mongo {
+
+ProcessInfo::ProcessInfo(ProcessId pid) : _pid(pid) {}
+
+ProcessInfo::~ProcessInfo() {}
+
+/**
+ * Get a sysctl string value by name. Use string specialization by default.
+ */
+template <typename T>
+int getSysctlByNameWithDefault(const char* sysctlName, const T& defaultValue, T* result);
+
+template <>
+int getSysctlByNameWithDefault<uintptr_t>(const char* sysctlName,
+ const uintptr_t& defaultValue,
+ uintptr_t* result) {
+ uintptr_t value = 0;
+ size_t len = sizeof(value);
+ if (sysctlbyname(sysctlName, &value, &len, NULL, 0) == -1) {
+ *result = defaultValue;
+ return errno;
+ }
+ if (len > sizeof(value)) {
+ *result = defaultValue;
+ return EINVAL;
+ }
+
+ *result = value;
+ return 0;
+}
+
+template <>
+int getSysctlByNameWithDefault<string>(const char* sysctlName,
+ const string& defaultValue,
+ string* result) {
+ char value[256] = {0};
+ size_t len = sizeof(value);
+ if (sysctlbyname(sysctlName, &value, &len, NULL, 0) == -1) {
+ *result = defaultValue;
+ return errno;
+ }
+ *result = value;
+ return 0;
+}
+
+bool ProcessInfo::checkNumaEnabled() {
+ return false;
+}
+
+int ProcessInfo::getVirtualMemorySize() {
+ kvm_t* kd = NULL;
+ int cnt = 0;
+ char err[_POSIX2_LINE_MAX] = {0};
+ if ((kd = kvm_open(NULL, "/dev/null", "/dev/null", O_RDONLY, err)) == NULL)
+ return -1;
+ kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), &cnt);
+ kvm_close(kd);
+ return task->ki_size / 1024 / 1024; // convert from bytes to MB
+}
+
+int ProcessInfo::getResidentSize() {
+ kvm_t* kd = NULL;
+ int cnt = 0;
+ char err[_POSIX2_LINE_MAX] = {0};
+ if ((kd = kvm_open(NULL, "/dev/null", "/dev/null", O_RDONLY, err)) == NULL)
+ return -1;
+ kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), &cnt);
+ kvm_close(kd);
+ return task->ki_rssize * sysconf(_SC_PAGESIZE) / 1024 / 1024; // convert from pages to MB
+}
+
+double ProcessInfo::getSystemMemoryPressurePercentage() {
+ return 0.0;
+}
+
+void ProcessInfo::SystemInfo::collectSystemInfo() {
+ osType = "BSD";
+ osName = "FreeBSD";
+
+ int status = getSysctlByNameWithDefault("kern.version", string("unknown"), &osVersion);
+ if (status != 0)
+ log() << "Unable to collect OS Version. (errno: " << status << " msg: " << strerror(status)
+ << ")" << endl;
+
+ status = getSysctlByNameWithDefault("hw.machine_arch", string("unknown"), &cpuArch);
+ if (status != 0)
+ log() << "Unable to collect Machine Architecture. (errno: " << status
+ << " msg: " << strerror(status) << ")" << endl;
+ addrSize = cpuArch.find("64") != std::string::npos ? 64 : 32;
+
+ uintptr_t numBuffer;
+ uintptr_t defaultNum = 1;
+ status = getSysctlByNameWithDefault("hw.physmem", defaultNum, &numBuffer);
+ memSize = numBuffer;
+ if (status != 0)
+ log() << "Unable to collect Physical Memory. (errno: " << status
+ << " msg: " << strerror(status) << ")" << endl;
+
+ status = getSysctlByNameWithDefault("hw.ncpu", defaultNum, &numBuffer);
+ numCores = numBuffer;
+ if (status != 0)
+ log() << "Unable to collect Number of CPUs. (errno: " << status
+ << " msg: " << strerror(status) << ")" << endl;
+
+ pageSize = static_cast<unsigned long long>(sysconf(_SC_PAGESIZE));
+
+ hasNuma = checkNumaEnabled();
+}
+
+void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {}
+
+bool ProcessInfo::supported() {
+ return true;
+}
+
+bool ProcessInfo::blockCheckSupported() {
+ return true;
+}
+
+bool ProcessInfo::blockInMemory(const void* start) {
+ char x = 0;
+ if (mincore(alignToStartOfPage(start), getPageSize(), &x)) {
+ log() << "mincore failed: " << errnoWithDescription() << endl;
+ return 1;
+ }
+ return x & 0x1;
+}
+
+bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, vector<char>* out) {
+ out->resize(numPages);
+ // int mincore(const void *addr, size_t len, char *vec);
+ if (mincore(alignToStartOfPage(start), numPages * getPageSize(), &(out->front()))) {
+ log() << "mincore failed: " << errnoWithDescription() << endl;
+ return false;
+ }
+ for (size_t i = 0; i < numPages; ++i) {
+ (*out)[i] = 0x1;
+ }
+ return true;
+}
+}

View File

@@ -0,0 +1,218 @@
$NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/mongo/util/processinfo_netbsd.cpp.orig 2016-02-11 22:14:23.486964953 +0000
+++ src/mongo/util/processinfo_netbsd.cpp
@@ -0,0 +1,213 @@
+/* Copyright 2012 10gen Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects
+ * for all of the code used other than as permitted herein. If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so. If you do not
+ * wish to do so, delete this exception statement from your version. If you
+ * delete this exception statement from all source files in the program,
+ * then also delete it in the license file.
+ */
+
+#if defined(__NetBSD__)
+#define _KMEMUSER
+#endif
+
+#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kControl
+
+#include <cstdlib>
+#include <string>
+
+#include <kvm.h>
+#include <sys/file.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/vmmeter.h>
+#include <unistd.h>
+
+#include "mongo/util/scopeguard.h"
+#include "mongo/util/log.h"
+#include "processinfo.h"
+
+using namespace std;
+
+namespace mongo {
+
+ProcessInfo::ProcessInfo(ProcessId pid) : _pid(pid) {}
+
+ProcessInfo::~ProcessInfo() {}
+
+/**
+ * Get a sysctl string value by name. Use string specialization by default.
+ */
+template <typename T>
+int getSysctlByIDWithDefault(const int* sysctlID,
+ const int idLen,
+ const T& defaultValue,
+ T* result);
+
+template <>
+int getSysctlByIDWithDefault<uintptr_t>(const int* sysctlID,
+ const int idLen,
+ const uintptr_t& defaultValue,
+ uintptr_t* result) {
+ uintptr_t value = 0;
+ size_t len = sizeof(value);
+ if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) {
+ *result = defaultValue;
+ return errno;
+ }
+ if (len > sizeof(value)) {
+ *result = defaultValue;
+ return EINVAL;
+ }
+
+ *result = value;
+ return 0;
+}
+
+template <>
+int getSysctlByIDWithDefault<string>(const int* sysctlID,
+ const int idLen,
+ const string& defaultValue,
+ string* result) {
+ char value[256] = {0};
+ size_t len = sizeof(value);
+ if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) {
+ *result = defaultValue;
+ return errno;
+ }
+ *result = value;
+ return 0;
+}
+
+bool ProcessInfo::checkNumaEnabled() {
+ return false;
+}
+
+int ProcessInfo::getVirtualMemorySize() {
+ kvm_t* kd = NULL;
+ int cnt = 0;
+ char err[_POSIX2_LINE_MAX] = {0};
+ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, err)) == NULL) {
+ log() << "Unable to get virt mem size: " << err << endl;
+ return -1;
+ }
+
+ kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc2), &cnt);
+ kvm_close(kd);
+ return ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) /
+ 1048576;
+}
+
+int ProcessInfo::getResidentSize() {
+ kvm_t* kd = NULL;
+ int cnt = 0;
+ char err[_POSIX2_LINE_MAX] = {0};
+ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, err)) == NULL) {
+ log() << "Unable to get res mem size: " << err << endl;
+ return -1;
+ }
+ kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc2), &cnt);
+ kvm_close(kd);
+ return (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576; // convert from pages to MB
+}
+
+double ProcessInfo::getSystemMemoryPressurePercentage() {
+ return 0.0;
+}
+
+void ProcessInfo::SystemInfo::collectSystemInfo() {
+ osType = "BSD";
+ osName = "NetBSD";
+ int mib[2];
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_VERSION;
+ int status = getSysctlByIDWithDefault(mib, 2, string("unknown"), &osVersion);
+ if (status != 0)
+ log() << "Unable to collect OS Version. (errno: " << status << " msg: " << strerror(status)
+ << ")" << endl;
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_MACHINE;
+ status = getSysctlByIDWithDefault(mib, 2, string("unknown"), &cpuArch);
+ if (status != 0)
+ log() << "Unable to collect Machine Architecture. (errno: " << status
+ << " msg: " << strerror(status) << ")" << endl;
+ addrSize = cpuArch.find("64") != std::string::npos ? 64 : 32;
+
+ uintptr_t numBuffer;
+ uintptr_t defaultNum = 1;
+ mib[0] = CTL_HW;
+ mib[1] = HW_PHYSMEM;
+ status = getSysctlByIDWithDefault(mib, 2, defaultNum, &numBuffer);
+ memSize = numBuffer;
+ if (status != 0)
+ log() << "Unable to collect Physical Memory. (errno: " << status
+ << " msg: " << strerror(status) << ")" << endl;
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_NCPU;
+ status = getSysctlByIDWithDefault(mib, 2, defaultNum, &numBuffer);
+ numCores = numBuffer;
+ if (status != 0)
+ log() << "Unable to collect Number of CPUs. (errno: " << status
+ << " msg: " << strerror(status) << ")" << endl;
+
+ pageSize = static_cast<unsigned long long>(sysconf(_SC_PAGESIZE));
+
+ hasNuma = checkNumaEnabled();
+}
+
+void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {}
+
+bool ProcessInfo::supported() {
+ return true;
+}
+
+bool ProcessInfo::blockCheckSupported() {
+ return true;
+}
+
+bool ProcessInfo::blockInMemory(const void* start) {
+ char x = 0;
+ if (mincore((void*)alignToStartOfPage(start), getPageSize(), &x)) {
+ log() << "mincore failed: " << errnoWithDescription() << endl;
+ return 1;
+ }
+ return x & 0x1;
+}
+
+bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, vector<char>* out) {
+ out->resize(numPages);
+ // int mincore(const void *addr, size_t len, char *vec);
+ if (mincore((void*)alignToStartOfPage(start), numPages * getPageSize(), &(out->front()))) {
+ log() << "mincore failed: " << errnoWithDescription() << endl;
+ return false;
+ }
+ for (size_t i = 0; i < numPages; ++i) {
+ (*out)[i] = 0x1;
+ }
+ return true;
+}
+}

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_third__party_mozjs-38_platform_x86__64_netbsd_build_js-confdefs.h,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/third_party/mozjs-38/platform/x86_64/netbsd/build/js-confdefs.h.orig 2016-02-11 12:42:39.272068631 +0000
+++ src/third_party/mozjs-38/platform/x86_64/netbsd/build/js-confdefs.h
@@ -19,7 +19,6 @@
#define HAVE_CPUID_H 1
#define HAVE_DIRENT_H 1
#define HAVE_DLOPEN 1
-#define HAVE_ENDIAN_H 1
#define HAVE_EXPM1 1
#define HAVE_GETC_UNLOCKED 1
#define HAVE_GETOPT_H 1
@@ -54,7 +53,6 @@
#define JS_CODEGEN_X64 1
#define JS_CPU_X64 1
#define JS_DEFAULT_JITREPORT_GRANULARITY 3
-#define JS_HAVE_ENDIAN_H 1
#define JS_HAVE_MACHINE_ENDIAN_H 1
#define JS_POSIX_NSPR 1
#define JS_PUNBOX64 1

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-src_third__party_mozjs-38_platform_x86__64_netbsd_include_js-config.h,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/third_party/mozjs-38/platform/x86_64/netbsd/include/js-config.h.orig 2016-02-11 12:24:33.328723425 +0000
+++ src/third_party/mozjs-38/platform/x86_64/netbsd/include/js-config.h
@@ -36,7 +36,7 @@
/* Define to 1 if the <endian.h> header is present and
useable. See jscpucfg.h. */
-#define JS_HAVE_ENDIAN_H 1
+/* #undef JS_HAVE_ENDIAN_H */
/* Define to 1 if the <machine/endian.h> header is present and
useable. See jscpucfg.h. */

View File

@@ -1,15 +1,15 @@
$NetBSD: patch-src_third__party_s2_base_port.h,v 1.1 2015/05/02 08:10:33 ryoon Exp $
$NetBSD: patch-src_third__party_s2_base_port.h,v 1.2 2016/02/12 03:37:24 ryoon Exp $
* Add NetBSD support.
--- src/third_party/s2/base/port.h.orig 2015-04-08 20:28:08.000000000 +0000
--- src/third_party/s2/base/port.h.orig 2016-01-05 18:31:44.000000000 +0000
+++ src/third_party/s2/base/port.h
@@ -102,7 +102,7 @@ typedef uint16_t u_int16_t;
#endif
-#if defined __sunos__ || defined __freebsd__ || defined __openbsd__
+#if defined __sunos__ || defined __freebsd__ || defined __openbsd__ || defined __netbsd__
-#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__
+#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__ || defined __DragonFly__ || defined __NetBSD__
#ifdef _LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN
#elif defined _BIG_ENDIAN
@@ -17,7 +17,7 @@ $NetBSD: patch-src_third__party_s2_base_port.h,v 1.1 2015/05/02 08:10:33 ryoon E
#define bswap_16(x) swap16(x)
#define bswap_32(x) swap32(x)
#define bswap_64(x) swap64(x)
+#elif defined __netbsd__
+#elif defined __NetBSD__
+#include <machine/bswap.h>
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)

View File

@@ -1,35 +0,0 @@
$NetBSD: patch-src_third__party_v8-3.25_SConscript,v 1.1 2015/05/02 08:10:33 ryoon Exp $
* Treat NetBSD like OpenBSD.
--- src/third_party/v8-3.25/SConscript.orig 2015-04-08 20:28:08.000000000 +0000
+++ src/third_party/v8-3.25/SConscript
@@ -32,7 +32,7 @@ root_dir = dirname(File('SConscript').rf
sys.path.insert(0, join(root_dir, 'tools'))
import js2c
-Import("env windows linux darwin solaris freebsd debugBuild openbsd")
+Import("env windows linux darwin solaris freebsd debugBuild openbsd dragonfly netbsd")
# pared-down copies of the equivalent structures in v8's SConstruct/SConscript:
LIBRARY_FLAGS = {
@@ -313,6 +313,8 @@ SOURCES = {
'os:linux': ['platform-linux.cc', 'platform-posix.cc'],
'os:macos': ['platform-macos.cc', 'platform-posix.cc'],
'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'],
+ 'os:dragonfly': ['platform-freebsd.cc', 'platform-posix.cc'],
+ 'os:netbsd': ['platform-openbsd.cc', 'platform-posix.cc'],
'os:nullos': ['platform-nullos.cc'],
'os:win32': ['platform-win32.cc', 'win32-math.cc'],
'mode:release': [],
@@ -377,6 +379,10 @@ def get_options():
os_string = 'os:solaris'
elif openbsd:
os_string = 'os:openbsd'
+ elif dragonfly:
+ os_string = 'os:dragonfly'
+ elif netbsd:
+ os_string = 'os:netbsd'
else:
os_string = 'os:nullos'

View File

@@ -1,29 +0,0 @@
$NetBSD: patch-src_third__party_v8-3.25_src_platform-posix.cc,v 1.1 2015/05/02 08:10:33 ryoon Exp $
* Add NetBSD support from lang/nodejs.
--- src/third_party/v8-3.25/src/platform-posix.cc.orig 2015-04-08 20:28:08.000000000 +0000
+++ src/third_party/v8-3.25/src/platform-posix.cc
@@ -588,8 +588,13 @@ Thread::Thread(const Options& options)
: data_(new PlatformData),
stack_size_(options.stack_size()),
start_semaphore_(NULL) {
+#if defined(__NetBSD__)
+ if (stack_size_ > 0 && stack_size_ < sysconf(_SC_THREAD_STACK_MIN)) {
+ stack_size_ = sysconf(_SC_THREAD_STACK_MIN);
+#else
if (stack_size_ > 0 && stack_size_ < PTHREAD_STACK_MIN) {
stack_size_ = PTHREAD_STACK_MIN;
+#endif
}
set_name(options.name());
}
@@ -605,7 +610,7 @@ static void SetThreadName(const char* na
pthread_set_name_np(pthread_self(), name);
#elif V8_OS_NETBSD
STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
- pthread_setname_np(pthread_self(), "%s", name);
+ pthread_setname_np(pthread_self(), "%s", (void *)name);
#elif V8_OS_MACOSX
// pthread_setname_np is only available in 10.6 or later, so test
// for it at runtime.

View File

@@ -1,48 +0,0 @@
$NetBSD: patch-src_third__party_v8-3.25_src_platform_semaphore.cc,v 1.2 2015/09/08 07:48:19 fhajny Exp $
Work around lack of sem_timedwait(3) in NetBSD < 6.99.4.
Adapted from d4f11c0cf476dd854eaebec1cbacb1afc7bea18e of the Chromium V8 sources.
--- src/third_party/v8-3.25/src/platform/semaphore.cc.orig 2015-08-24 00:39:52.000000000 +0000
+++ src/third_party/v8-3.25/src/platform/semaphore.cc
@@ -32,9 +32,14 @@
#include <mach/task.h>
#endif
+#if V8_OS_NETBSD
+#include <sys/param.h> // for __NetBSD_Version__
+#endif
+
#include <errno.h>
#include "checks.h"
+#include "platform/elapsed-timer.h"
#include "platform/time.h"
namespace v8 {
@@ -129,6 +134,17 @@ void Semaphore::Wait() {
bool Semaphore::WaitFor(const TimeDelta& rel_time) {
+#if V8_OS_NACL || (V8_OS_NETBSD && __NetBSD_Version__ - 0 < 699000400)
+ // PNaCL and older NetBSD doesn't support sem_timedwait, do ugly busy waiting.
+ ElapsedTimer timer;
+ timer.Start();
+ do {
+ int result = sem_trywait(&native_handle_);
+ if (result == 0) return true;
+ ASSERT(errno == EAGAIN || errno == EINTR);
+ } while (!timer.HasExpired(rel_time));
+ return false;
+#else
// Compute the time for end of timeout.
const Time time = Time::NowFromSystemTime() + rel_time;
const struct timespec ts = time.ToTimespec();
@@ -152,6 +168,7 @@ bool Semaphore::WaitFor(const TimeDelta&
ASSERT_EQ(-1, result);
ASSERT_EQ(EINTR, errno);
}
+#endif
}
#elif V8_OS_WIN

View File

@@ -1,24 +1,19 @@
$NetBSD: patch-src_third__party_wiredtiger_SConscript,v 1.2 2015/06/23 13:31:24 ryoon Exp $
$NetBSD: patch-src_third__party_wiredtiger_SConscript,v 1.4 2016/06/17 11:51:08 fhajny Exp $
* Add NetBSD case.
--- src/third_party/wiredtiger/SConscript.orig 2015-06-15 15:43:51.000000000 +0000
--- src/third_party/wiredtiger/SConscript.orig 2016-06-02 14:46:27.000000000 +0000
+++ src/third_party/wiredtiger/SConscript
@@ -2,7 +2,7 @@
import re
import textwrap
-Import("env windows darwin solaris linux freebsd openbsd debugBuild")
+Import("env windows darwin solaris linux freebsd openbsd netbsd debugBuild")
Import("get_option")
env = env.Clone()
@@ -32,6 +32,8 @@ elif freebsd:
@@ -51,8 +51,12 @@ elif env.TargetOSIs('solaris'):
# For an explanation of __EXTENSIONS__,
# see http://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html
env.Append(CPPDEFINES=["__EXTENSIONS__"])
+elif env.TargetOSIs('dragonfly'):
+ env.Append(CPPPATH=["build_dragonfly"])
elif env.TargetOSIs('freebsd'):
env.Append(CPPPATH=["build_freebsd"])
elif openbsd:
env.Append(CPPPATH=["build_openbsd"])
+elif netbsd:
+elif env.TargetOSIs('netbsd'):
+ env.Append(CPPPATH=["build_netbsd"])
elif linux:
env.Append(CPPPATH=["build_linux"])
env.Append(CPPDEFINES=["_GNU_SOURCE"])
elif env.TargetOSIs('openbsd'):
env.Append(CPPPATH=["build_openbsd"])
elif env.TargetOSIs('linux'):

View File

@@ -0,0 +1,159 @@
$NetBSD: patch-src_third__party_wiredtiger_build__dragonfly_wiredtiger__config.h,v 1.1 2016/02/12 03:37:24 ryoon Exp $
--- src/third_party/wiredtiger/build_dragonfly/wiredtiger_config.h.orig 2016-02-11 11:07:15.049932059 +0000
+++ src/third_party/wiredtiger/build_dragonfly/wiredtiger_config.h
@@ -0,0 +1,154 @@
+/* wiredtiger_config.h. Generated from config.hin by configure. */
+/* build_posix/config.hin. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Define to 1 to pause for debugger attach on failure. */
+/* #undef HAVE_ATTACH */
+
+/* Build the LevelDB API with Basho LevelDB support. */
+/* #undef HAVE_BASHOLEVELDB */
+
+/* Snappy support automatically loaded. */
+/* #undef HAVE_BUILTIN_EXTENSION_SNAPPY */
+
+/* Zlib support automatically loaded. */
+/* #undef HAVE_BUILTIN_EXTENSION_ZLIB */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 for diagnostic tests. */
+/* #undef HAVE_DIAGNOSTIC */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `fallocate' function. */
+/* #undef HAVE_FALLOCATE */
+
+/* Define to 1 if you have the `fcntl' function. */
+#define HAVE_FCNTL 1
+
+/* Define to 1 if you have the `fdatasync' function. */
+/* #undef HAVE_FDATASYNC */
+
+/* Define to 1 if you have the `fread_unlocked' function. */
+/* #undef HAVE_FREAD_UNLOCKED */
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Build the LevelDB API with HyperLevelDB support. */
+/* #undef HAVE_HYPERLEVELDB */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+/* #undef HAVE_LIBBZ2 */
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+/* #undef HAVE_LIBDL */
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#define HAVE_LIBPTHREAD 1
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#define HAVE_LIBRT 1
+
+/* Define to 1 if you have the `snappy' library (-lsnappy). */
+/* #undef HAVE_LIBSNAPPY */
+
+/* Define to 1 if you have the `z' library (-lz). */
+/* #undef HAVE_LIBZ */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `posix_fadvise' function. */
+#define HAVE_POSIX_FADVISE 1
+
+/* Define to 1 if you have the `posix_fallocate' function. */
+#define HAVE_POSIX_FALLOCATE 1
+
+/* Define to 1 if you have the `posix_madvise' function. */
+#define HAVE_POSIX_MADVISE 1
+
+/* Define to 1 if you have the `posix_memalign' function. */
+#define HAVE_POSIX_MEMALIGN 1
+
+/* Define to 1 if you have the <pthread_np.h> header file. */
+#define HAVE_PTHREAD_NP_H 1
+
+/* Build the LevelDB API with RocksDB support. */
+/* #undef HAVE_ROCKSDB */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtouq' function. */
+#define HAVE_STRTOUQ 1
+
+/* Define to 1 if you have the `sync_file_range' function. */
+/* #undef HAVE_SYNC_FILE_RANGE */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Enable verbose message configuration. */
+/* #undef HAVE_VERBOSE */
+
+/* Define to 1 if you have the <x86intrin.h> header file. */
+/* #undef HAVE_X86INTRIN_H */
+
+/* Spinlock type from mutex.h. */
+#define SPINLOCK_TYPE SPINLOCK_PTHREAD_MUTEX
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Default alignment of buffers used for I/O */
+#define WT_BUFFER_ALIGNMENT_DEFAULT 0
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */

View File

@@ -1,10 +1,10 @@
$NetBSD: patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h,v 1.1 2015/05/02 08:10:33 ryoon Exp $
$NetBSD: patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h,v 1.2 2016/02/12 03:37:24 ryoon Exp $
* Copy from OpenBSD case.
--- src/third_party/wiredtiger/build_netbsd/wiredtiger_config.h.orig 2015-05-02 04:35:05.000000000 +0000
--- src/third_party/wiredtiger/build_netbsd/wiredtiger_config.h.orig 2016-02-11 11:07:20.607136772 +0000
+++ src/third_party/wiredtiger/build_netbsd/wiredtiger_config.h
@@ -0,0 +1,151 @@
@@ -0,0 +1,154 @@
+/* wiredtiger_config.h. Generated from config.hin by configure. */
+/* build_posix/config.hin. Generated from configure.ac by autoheader. */
+
@@ -125,6 +125,9 @@ $NetBSD: patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h,v
+/* Enable verbose message configuration. */
+/* #undef HAVE_VERBOSE */
+
+/* Define to 1 if you have the <x86intrin.h> header file. */
+/* #undef HAVE_X86INTRIN_H */
+
+/* Spinlock type from mutex.h. */
+#define SPINLOCK_TYPE SPINLOCK_PTHREAD_MUTEX
+