[Mod] First commit

This commit is contained in:
2022-10-31 22:18:58 +08:00
commit 1c8a3d9709
13090 changed files with 526733 additions and 0 deletions

View File

@ -0,0 +1,55 @@
From 362be06fc16a5ad0f9e9aa90cc763c5242e8e35c Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 9 Feb 2019 12:41:45 +0100
Subject: [PATCH] ssl_manager.cpp: fix build with gcc 7 and -fpermissive
Change prototype of DERToken::parse function from
parse(ConstDataRange cdr, size_t* outLength);
to parse(ConstDataRange cdr, uint64_t* outLength);
Otherwise, we got the following error:
src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWith<mongo::{anonymous}::DERToken> mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)':
src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) ||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/mongodb/mongo/pull/1296]
---
src/mongo/util/net/ssl_manager.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index b93ebe84a4..3511eb5d99 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -782,7 +782,7 @@ public:
*
* Returns a DERToken which consists of the (tag, length, value) tuple.
*/
- static StatusWith<DERToken> parse(ConstDataRange cdr, size_t* outLength);
+ static StatusWith<DERToken> parse(ConstDataRange cdr, uint64_t* outLength);
private:
DERType _type{DERType::EndOfContent};
@@ -799,7 +799,7 @@ struct DataType::Handler<DERToken> {
size_t length,
size_t* advanced,
std::ptrdiff_t debug_offset) {
- size_t outLength;
+ uint64_t outLength;
auto swPair = DERToken::parse(ConstDataRange(ptr, length), &outLength);
@@ -844,7 +844,7 @@ StatusWith<std::string> readDERString(ConstDataRangeCursor& cdc) {
}
-StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, size_t* outLength) {
+StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, uint64_t* outLength) {
const size_t kTagLength = 1;
const size_t kTagLengthAndInitialLengthByteLength = kTagLength + 1;
--
2.14.1

View File

@ -0,0 +1,44 @@
From 0941e560850d54160c24778fa66b605714fd5012 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Mon, 9 Aug 2021 21:18:50 +0200
Subject: [PATCH] src/mongo/db/exec/plan_stats.h: fix build with gcc
11
Fix the following build failure with gcc 11:
In file included from src/mongo/db/query/plan_cache.h:36,
from src/mongo/db/catalog/collection_info_cache.h:33,
from src/mongo/db/catalog/collection.h:42,
from src/mongo/db/exec/requires_collection_stage.h:32,
from src/mongo/db/exec/delete.h:32,
from src/mongo/db/query/internal_plans.h:33,
from src/mongo/db/query/internal_plans.cpp:32:
src/mongo/db/exec/plan_stats.h:214:10: error: 'optional' in namespace 'std' does not name a template type
214 | std::optional<std::string> replanReason;
| ^~~~~~~~
Fixes:
- http://autobuild.buildroot.org/results/8c0875fa413923504515a83d8b679366418c2444
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: already fixed by
https://github.com/mongodb/mongo/commit/e78b2bf6eaa0c43bd76dbb841add167b443d2bb0]
---
src/mongo/db/exec/plan_stats.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h
index 43053e27be..813e4edc9e 100644
--- a/src/mongo/db/exec/plan_stats.h
+++ b/src/mongo/db/exec/plan_stats.h
@@ -31,6 +31,7 @@
#include <cstdint>
#include <cstdlib>
+#include <optional>
#include <string>
#include <vector>
--
2.30.2

42
package/mongodb/Config.in Normal file
View File

@ -0,0 +1,42 @@
# from https://docs.mongodb.com/manual/installation/#supported-platforms
config BR2_PACKAGE_MONGODB_ARCH_SUPPORTS
bool
# ARM needs LDREX/STREX, so ARMv6+
default y if BR2_arm && !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
default y if BR2_aarch64 || BR2_x86_64
depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS # boost-filesystem
config BR2_PACKAGE_MONGODB
bool "mongodb"
depends on BR2_PACKAGE_MONGODB_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_USES_GLIBC # needs glibc malloc_usable_size
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17
select BR2_PACKAGE_BOOST
select BR2_PACKAGE_BOOST_FILESYSTEM
select BR2_PACKAGE_BOOST_IOSTREAMS
select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
select BR2_PACKAGE_BOOST_SYSTEM
select BR2_PACKAGE_PCRE
select BR2_PACKAGE_PCRE_UTF # runtime
select BR2_PACKAGE_SNAPPY
select BR2_PACKAGE_SQLITE
select BR2_PACKAGE_YAML_CPP
select BR2_PACKAGE_ZLIB
help
MongoDB is a cross-platform document-oriented database
(NoSQL).
It uses JSON-like documents with dynamic schemas (BSON),
making the integration of data in certain types of
applications easier and faster.
https://www.mongodb.org/
comment "mongodb needs a glibc toolchain w/ wchar, threads, C++, gcc >= 7"
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_GLIBC || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_7
depends on BR2_PACKAGE_MONGODB_ARCH_SUPPORTS

View File

@ -0,0 +1,4 @@
# Locally computed:
sha256 5bbb9567cc1f358ac7d9f37d9fe749862728bdf9f742d1dfc5e35a8b6c2985ba mongodb-src-r4.2.18.tar.gz
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 APACHE-2.0.txt
sha256 09d99ca61eb07873d5334077acba22c33e7f7d0a9fa08c92734e0ac8430d6e27 LICENSE-Community.txt

104
package/mongodb/mongodb.mk Normal file
View File

@ -0,0 +1,104 @@
################################################################################
#
# mongodb
#
################################################################################
MONGODB_VERSION = 4.2.18
MONGODB_SITE = https://fastdl.mongodb.org/src
MONGODB_SOURCE = mongodb-src-r$(MONGODB_VERSION).tar.gz
MONGODB_LICENSE = Apache-2.0 (drivers), SSPL (database)
MONGODB_LICENSE_FILES = APACHE-2.0.txt LICENSE-Community.txt
MONGODB_CPE_ID_VENDOR = mongodb
MONGODB_SELINUX_MODULES = mongodb
MONGODB_DEPENDENCIES = \
boost \
host-python-cheetah \
host-python-psutil \
host-python-pyyaml \
host-python-regex \
host-python-requests \
host-scons \
pcre \
snappy \
sqlite \
yaml-cpp \
zlib
MONGODB_SCONS_TARGETS = mongod mongos
MONGODB_SCONS_ENV = CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" \
-j"$(PARALLEL_JOBS)"
MONGODB_SCONS_OPTS = \
--disable-minimum-compiler-version-enforcement \
--disable-warnings-as-errors \
--use-system-boost \
--use-system-pcre \
--use-system-snappy \
--use-system-sqlite \
--use-system-yaml \
--use-system-zlib
# need to pass mongo version when not building from git repo
MONGODB_SCONS_OPTS += MONGO_VERSION=$(MONGODB_VERSION)-
# WiredTiger database storage engine only supported on 64 bits
ifeq ($(BR2_ARCH_IS_64),y)
MONGODB_SCONS_OPTS += --wiredtiger=on
else
MONGODB_SCONS_OPTS += --wiredtiger=off
endif
# JavaScript scripting engine and tcmalloc supported only on
# x86/x86-64 systems. Mongo target is a shell interface that
# depends on the javascript engine, so it will also only be
# built on x86/x86-64 systems.
ifeq ($(BR2_i386)$(BR2_x86_64),y)
MONGODB_SCONS_OPTS += --js-engine=mozjs --allocator=tcmalloc
MONGODB_SCONS_TARGETS += mongo
else
MONGODB_SCONS_OPTS += --js-engine=none --allocator=system
endif
ifeq ($(BR2_PACKAGE_LIBCURL),y)
MONGODB_DEPENDENCIES += libcurl
MONGODB_SCONS_OPTS += \
--enable-free-mon=on \
--enable-http-client=on
else
MONGODB_SCONS_OPTS += \
--enable-free-mon=off \
--enable-http-client=off
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
MONGODB_DEPENDENCIES += openssl
MONGODB_SCONS_OPTS += \
--ssl=on \
--ssl-provider=openssl
else
MONGODB_SCONS_OPTS += --ssl=off
endif
define MONGODB_BUILD_CMDS
(cd $(@D); \
$(SCONS) \
$(MONGODB_SCONS_ENV) \
$(MONGODB_SCONS_OPTS) \
$(MONGODB_SCONS_TARGETS))
endef
define MONGODB_INSTALL_TARGET_CMDS
(cd $(@D); \
$(SCONS) \
$(MONGODB_SCONS_ENV) \
$(MONGODB_SCONS_OPTS) \
--prefix=$(TARGET_DIR)/usr \
install)
endef
$(eval $(generic-package))