diff options
Diffstat (limited to 'meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb')
21 files changed, 367 insertions, 119 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Do-not-use-MINSIGSTKSZ.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Do-not-use-MINSIGSTKSZ.patch deleted file mode 100644 index 0ee64e9c6c..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Do-not-use-MINSIGSTKSZ.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 027044a692b588ef586d495f65eb58b07cc711a3 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Tue, 11 May 2021 10:15:51 -0700 -Subject: [PATCH] Do not use MINSIGSTKSZ - -Since glibc 2.34+ MINSIGSTKSZ is no more a constant. So, -let's hardwire this for now until better fix is found. -64Kb should be good anyway - -Upstream-Status: Pending -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - src/mongo/stdx/thread.h | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/src/mongo/stdx/thread.h b/src/mongo/stdx/thread.h -index f8058279e3..f31f309959 100644 ---- a/src/mongo/stdx/thread.h -+++ b/src/mongo/stdx/thread.h -@@ -104,10 +104,7 @@ private: - // . N Y : 4,344 | 13,048 | 7,352 - // . Y Y : 4,424 | 13,672 | 8,392 - // ( https://jira.mongodb.org/secure/attachment/233569/233569_stacktrace-writeup.txt ) -- static constexpr std::size_t kMongoMinSignalStackSize = std::size_t{64} << 10; -- -- static constexpr std::size_t kStackSize = -- std::max(kMongoMinSignalStackSize, std::size_t{MINSIGSTKSZ}); -+ static constexpr std::size_t kStackSize = std::size_t{64} << 10; - std::unique_ptr<std::byte[]> _stackStorage = std::make_unique<std::byte[]>(kStackSize); - - #else // !MONGO_HAS_SIGALTSTACK --- -2.31.1 - diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch new file mode 100644 index 0000000000..4abc044151 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch @@ -0,0 +1,38 @@ +From b172ebe7e709b10338c1b260310dacc15c557cff Mon Sep 17 00:00:00 2001 +From: Martin Jansa <martin.jansa@gmail.com> +Date: Fri, 22 Sep 2023 15:37:29 +0200 +Subject: [PATCH] Fix build on 32bit + +* fixes: + src/mongo/util/net/http_client_curl.cpp: In function 'size_t mongo::{anonymous}::ReadMemoryCallback(char*, size_t, size_t, void*)': + src/mongo/util/net/http_client_curl.cpp:172:21: error: no matching function for call to 'min(size_t, long unsigned int)' + 172 | std::min(size * nitems, static_cast<unsigned long>(bufReader->remaining())); + | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* reported in: + https://jira.mongodb.org/browse/SERVER-73007 + but will probably get closed like: + mongodb/0001-Fix-type-mismatch-on-32bit-arches.patch + submitted in: + https://jira.mongodb.org/browse/SERVER-74633 + as they don't support 32bit builds + +Signed-off-by: Martin Jansa <martin.jansa@gmail.com> +Upstream-Status: Pending +--- + src/mongo/util/net/http_client_curl.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/mongo/util/net/http_client_curl.cpp b/src/mongo/util/net/http_client_curl.cpp +index 57290d0f8ed..f251fe2a550 100644 +--- a/src/mongo/util/net/http_client_curl.cpp ++++ b/src/mongo/util/net/http_client_curl.cpp +@@ -169,7 +169,7 @@ size_t ReadMemoryCallback(char* buffer, size_t size, size_t nitems, void* instre + + if (bufReader->remaining() > 0) { + size_t readSize = +- std::min(size * nitems, static_cast<unsigned long>(bufReader->remaining())); ++ std::min(size * nitems, static_cast<size_t>(bufReader->remaining())); + auto buf = bufReader->readBytes(readSize); + memcpy(buffer, buf.rawData(), readSize); + ret = readSize; diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-type-mismatch-on-32bit-arches.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-type-mismatch-on-32bit-arches.patch new file mode 100644 index 0000000000..def17995dc --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-type-mismatch-on-32bit-arches.patch @@ -0,0 +1,33 @@ +From 81eabea4e4da55cddfe8bcfcbc3759fa90948254 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 3 Mar 2023 14:13:29 -0800 +Subject: [PATCH] Fix type mismatch on 32bit arches + +std::set::size returns an unsigned integral type. +std::max call therefore gets (unsigned int, unsigned long) here. +Type of both arguments is not same, so its ambigous +and there is no matching std::max implementation for mismatching +arguments. std::max expects both input variables to be of +same type, max(int,int) etc.. + +Fixes +src/mongo/util/processinfo_linux.cpp:424:16: error: no matching function for call to 'max' + return std::max(socketIds.size(), 1ul); + +Upstream-Status: Submitted [https://jira.mongodb.org/browse/SERVER-74633] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/mongo/util/processinfo_linux.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/mongo/util/processinfo_linux.cpp ++++ b/src/mongo/util/processinfo_linux.cpp +@@ -421,7 +421,7 @@ public: + + // On ARM64, the "physical id" field is unpopulated, causing there to be 0 sockets found. In + // this case, we default to 1. +- return std::max(socketIds.size(), 1ul); ++ return std::max(static_cast<unsigned long>(socketIds.size()), 1ul); + } + + /** diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch index e636adc556..500e76bc2f 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch @@ -13,6 +13,8 @@ typedef int wchar_t; Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch index b8a325295d..4d84d3d15b 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch @@ -6,6 +6,8 @@ Subject: [PATCH 01/10] Tell scons to use build settings from environment Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- SConstruct | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-The-std-lib-unary-binary_function-base-classes-are-d.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-The-std-lib-unary-binary_function-base-classes-are-d.patch new file mode 100644 index 0000000000..4594bec81a --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-The-std-lib-unary-binary_function-base-classes-are-d.patch @@ -0,0 +1,40 @@ +From f9b55f5a1fab85bf73c95e6372779d6f50f75e84 Mon Sep 17 00:00:00 2001 +From: jzmaddock <john@johnmaddock.co.uk> +Date: Mon, 11 Jul 2022 18:26:07 +0100 +Subject: [PATCH] The std lib unary/binary_function base classes are + deprecated/removed from libcpp15. Fixes + https://github.com/boostorg/container_hash/issues/24. + +Upstream-Status: Backport [https://github.com/boostorg/config/pull/440/commits/f0af4a9184457939b89110795ae2d293582c5f66] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp ++++ b/src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp +@@ -140,4 +140,13 @@ + # define BOOST_NO_CXX14_HDR_SHARED_MUTEX + #endif + ++#if _LIBCPP_VERSION >= 15000 ++// ++// Unary function is now deprecated in C++11 and later: ++// ++#if __cplusplus >= 201103L ++#define BOOST_NO_CXX98_FUNCTION_BASE ++#endif ++#endif ++ + // --- end --- +--- a/src/third_party/boost-1.70.0/boost/container_hash/hash.hpp ++++ b/src/third_party/boost-1.70.0/boost/container_hash/hash.hpp +@@ -118,7 +118,7 @@ namespace boost + { + namespace hash_detail + { +-#if defined(_HAS_AUTO_PTR_ETC) && !_HAS_AUTO_PTR_ETC ++#if defined(BOOST_NO_CXX98_FUNCTION_BASE) + template <typename T> + struct hash_base + { diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch index 8d82be1b57..cfbcbd9aa2 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch @@ -5,6 +5,8 @@ Subject: [PATCH 03/10] Use __GLIBC__ to control use of gnu_get_libc_version Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- src/mongo/util/processinfo_linux.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-explicit-typecast-to-size_t.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-explicit-typecast-to-size_t.patch deleted file mode 100644 index 5b724ff8aa..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-explicit-typecast-to-size_t.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 6fdb2d304e05a17e57b2efd7f8252794a8722dbe Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Tue, 1 Jun 2021 08:25:36 -0700 -Subject: [PATCH] Use explicit typecast to size_t - -maxMemoryUsageBytes is size_t type which may not match long long value -internalDocumentSourceGroupMaxMemoryBytes.load() returns, so typecast it -to avoid narrowing warning from clang - -document_source_group.cpp:378:22: error: non-constant-expression cannot be narrowed from type 'long long' to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] - maxMemoryUsageBytes ? *maxMemoryUsageBytes - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Upstream-Status: Submitted [https://github.com/mongodb/mongo/pull/1405] -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - src/mongo/db/pipeline/document_source_group.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp -index c7bf44e72e..a52906a940 100644 ---- a/src/mongo/db/pipeline/document_source_group.cpp -+++ b/src/mongo/db/pipeline/document_source_group.cpp -@@ -376,7 +376,7 @@ DocumentSourceGroup::DocumentSourceGroup(const intrusive_ptr<ExpressionContext>& - _doingMerge(false), - _memoryTracker{pExpCtx->allowDiskUse && !pExpCtx->inMongos, - maxMemoryUsageBytes ? *maxMemoryUsageBytes -- : internalDocumentSourceGroupMaxMemoryBytes.load()}, -+ : (size_t)internalDocumentSourceGroupMaxMemoryBytes.load()}, - _initialized(false), - _groups(pExpCtx->getValueComparator().makeUnorderedValueMap<Accumulators>()), - _spilled(false) { --- -2.31.1 - diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch index 958e09c3dc..310301d57b 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch @@ -9,6 +9,8 @@ since this function expects long long as parameter and not int64_t Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- src/mongo/util/procparser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch new file mode 100644 index 0000000000..de05624429 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch @@ -0,0 +1,38 @@ +From ad37ee80b32a1f740a3197105174d74dff11e4e8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 13 Apr 2022 13:56:32 -0700 +Subject: [PATCH] add explict static_cast<size_t> to maxMemoryUsageBytes + +Fixes +src/mongo/db/pipeline/document_source_group.cpp:377:22: error: non-constant-expression cannot be narrowed from type 'long long' to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] + maxMemoryUsageBytes ? *maxMemoryUsageBytes + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src/mongo/db/pipeline/document_source_group.cpp:377:22: note: insert an explicit cast to silence this issue + maxMemoryUsageBytes ? *maxMemoryUsageBytes + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/mongo/db/pipeline/document_source_group.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp +index 4a7b48d6cd2..9a6076c6041 100644 +--- a/src/mongo/db/pipeline/document_source_group.cpp ++++ b/src/mongo/db/pipeline/document_source_group.cpp +@@ -374,8 +374,8 @@ DocumentSourceGroup::DocumentSourceGroup(const intrusive_ptr<ExpressionContext>& + _usedDisk(false), + _doingMerge(false), + _memoryTracker{pExpCtx->allowDiskUse && !pExpCtx->inMongos, +- maxMemoryUsageBytes ? *maxMemoryUsageBytes +- : internalDocumentSourceGroupMaxMemoryBytes.load()}, ++ static_cast<size_t>(maxMemoryUsageBytes ? *maxMemoryUsageBytes ++ : internalDocumentSourceGroupMaxMemoryBytes.load())}, + // We spill to disk in debug mode, regardless of allowDiskUse, to stress the system. + _file(!pExpCtx->inMongos && (pExpCtx->allowDiskUse || kDebugBuild) + ? std::make_shared<Sorter<Value, Value>::File>(pExpCtx->tempDir + "/" + +-- +2.35.2 + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-apply-msvc-workaround-for-clang-16.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-apply-msvc-workaround-for-clang-16.patch new file mode 100644 index 0000000000..096269308d --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-apply-msvc-workaround-for-clang-16.patch @@ -0,0 +1,32 @@ +From 03047c81b2601362bcf79cae67e06d1fba0a6101 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 2 Mar 2023 20:17:57 -0800 +Subject: [PATCH] apply msvc workaround for clang >= 16 + +This avoids a new Werror found with clang16 + +boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] + typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior; + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp b/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp +index 6bc05f7e96e..6bb8d24c9ce 100644 +--- a/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp ++++ b/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp +@@ -56,7 +56,7 @@ struct AUX_WRAPPER_NAME + // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), + // while some other don't like 'value + 1' (Borland), and some don't like + // either +-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) ++#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) || __clang_major__ > 15 + private: + BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); + BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1))); +-- +2.39.2 + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-asio-Dont-use-experimental-with-clang.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-asio-Dont-use-experimental-with-clang.patch index e726933f56..ad944e4666 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-asio-Dont-use-experimental-with-clang.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-asio-Dont-use-experimental-with-clang.patch @@ -5,6 +5,8 @@ Subject: [PATCH 10/10] asio: Dont use experimental with clang Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- src/third_party/asio-master/asio/include/asio/detail/string_view.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-free_mon-Include-missing-cstdint.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-free_mon-Include-missing-cstdint.patch new file mode 100644 index 0000000000..8cee14889f --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-free_mon-Include-missing-cstdint.patch @@ -0,0 +1,28 @@ +From 5d8218b8a1b5bc71e2a0cf543a000e194daba599 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 29 Jan 2023 17:15:30 -0800 +Subject: [PATCH] free_mon: Include missing <cstdint> + +gcc 13 moved some includes around and as a result <cstdint> is no +longer transitively included [1]. Explicitly include it +for uintXX_t. + +[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + src/mongo/db/free_mon/free_mon_options.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/src/mongo/db/free_mon/free_mon_options.h ++++ b/src/mongo/db/free_mon/free_mon_options.h +@@ -29,6 +29,7 @@ + + #pragma once + ++#include <cstdint> + #include <string> + #include <vector> + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch new file mode 100644 index 0000000000..52c9df9b1b --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch @@ -0,0 +1,37 @@ +From 5c9e0d0fc9188bab0ae09c9c33df01938b0c1b6c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 14 Apr 2022 09:25:33 -0700 +Subject: [PATCH] server: Adjust the cache alignment assumptions + +aarch64 has 256 for hardware_destructive_interference_size and gcc 12 +has added a warning to complain about mismatches which results in +static_assert failures + +In file included from src/mongo/s/commands/cluster_find_cmd.cpp:39: +src/mongo/db/stats/counters.h:185:47: error: static assertion failed: cache line spill + 185 | static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The structure need to ensure true sharing for both the elements +so align it to hardware_constructive_interference_size instead + +Upstream-Status: Inappropriate [https://jira.mongodb.org/browse/SERVER-65664] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/mongo/db/stats/counters.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/src/mongo/db/stats/counters.h ++++ b/src/mongo/db/stats/counters.h +@@ -182,8 +182,8 @@ private: + AtomicWord<long long> requests{0}; + }; + CacheAligned<Together> _together{}; +- static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size, +- "cache line spill"); ++ static_assert(sizeof(Together) <= stdx::hardware_constructive_interference_size, ++ "cache line spill"); + + CacheAligned<AtomicWord<long long>> _logicalBytesOut{0}; + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-wiredtiger-Avoid-using-off64_t.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-wiredtiger-Avoid-using-off64_t.patch new file mode 100644 index 0000000000..abe6898554 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-wiredtiger-Avoid-using-off64_t.patch @@ -0,0 +1,30 @@ +From 0508c1518c2e7c586a231d344e9f93b08507885b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 31 Dec 2022 14:23:40 -0800 +Subject: [PATCH] wiredtiger: Avoid using off64_t + +off64_t is not available on musl since off_t is already 64bit by +default. Therefore replace using off64_t with off_t + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/third_party/wiredtiger/src/os_posix/os_fs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/third_party/wiredtiger/src/os_posix/os_fs.c b/src/third_party/wiredtiger/src/os_posix/os_fs.c +index 3898eb74343..9ce2d5edb38 100644 +--- a/src/third_party/wiredtiger/src/os_posix/os_fs.c ++++ b/src/third_party/wiredtiger/src/os_posix/os_fs.c +@@ -533,7 +533,7 @@ __posix_file_sync_nowait(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session) + pfh = (WT_FILE_HANDLE_POSIX *)file_handle; + + /* See comment in __posix_sync(): sync cannot be retried or fail. */ +- WT_SYSCALL(sync_file_range(pfh->fd, (off64_t)0, (off64_t)0, SYNC_FILE_RANGE_WRITE), ret); ++ WT_SYSCALL(sync_file_range(pfh->fd, 0, 0, SYNC_FILE_RANGE_WRITE), ret); + if (ret == 0) + return (0); + +-- +2.39.0 + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch index 57f4168f5a..d1e662f291 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch @@ -7,6 +7,8 @@ It depends on the native arch's word size. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- src/mongo/util/stacktrace_posix.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-Fix-unknown-prefix-env.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-Fix-unknown-prefix-env.patch index 910ef0b5f4..d2ba6eb805 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-Fix-unknown-prefix-env.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-Fix-unknown-prefix-env.patch @@ -1,3 +1,5 @@ +Upstream-Status: Pending + Index: git/SConstruct =================================================================== --- git.orig/SConstruct diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch index 2cea9bc31f..45051e103d 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch @@ -4,6 +4,8 @@ Date: Sat, 2 Sep 2017 13:13:15 -0700 Subject: [PATCH 09/10] wiredtiger: Disable strtouq on musl Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending --- src/third_party/wiredtiger/build_linux/wiredtiger_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/1296.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/1296.patch index e4ae30776b..9259f96be8 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/1296.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/1296.patch @@ -1,4 +1,3 @@ -Upstream-Status: submitted https://github.com/mongodb/mongo/pull/1296 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 @@ -14,6 +13,8 @@ src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::Sta 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) || +Upstream-Status: Submitted [https://github.com/mongodb/mongo/pull/1296] + Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> --- diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/arm64-support.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/arm64-support.patch index 1a7bf0fc52..24b0ad58b6 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/arm64-support.patch +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/arm64-support.patch @@ -5,6 +5,8 @@ Subject: [PATCH 05/10] Add alises for arm64 which is same as aarch64 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com> + +Upstream-Status: Pending --- SConstruct | 1 + src/third_party/IntelRDFPMathLib20U1/SConscript | 2 +- diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb index 9c1e485b31..ee5c77a85d 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb @@ -11,10 +11,10 @@ DEPENDS = "openssl libpcap zlib boost curl python3 \ inherit scons dos2unix siteinfo python3native systemd useradd -PV = "4.4.6" -#v4.4.6 -SRCREV = "72e66213c2c3eab37d9358d5e78ad7f5c1d0d0d7" -SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4 \ +PV = "4.4.24" +#v4.4.24 +SRCREV = "0b86b9b7b42ad9970c5f818c527dd86c0634243a" +SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \ file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \ file://0001-Use-long-long-instead-of-int64_t.patch \ file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \ @@ -29,44 +29,57 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4 \ file://0001-include-needed-c-header.patch \ file://disable_runtime_check.patch \ file://ppc64_ARCH_BITS.patch \ - file://0001-Do-not-use-MINSIGSTKSZ.patch \ - file://0001-Use-explicit-typecast-to-size_t.patch \ + file://0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch \ + file://0001-server-Adjust-the-cache-alignment-assumptions.patch \ + file://0001-The-std-lib-unary-binary_function-base-classes-are-d.patch \ + file://0001-free_mon-Include-missing-cstdint.patch \ + file://0001-apply-msvc-workaround-for-clang-16.patch \ + file://0001-Fix-type-mismatch-on-32bit-arches.patch \ + file://0001-Fix-build-on-32bit.patch \ " -SRC_URI_append_libc-musl ="\ +SRC_URI:append:libc-musl ="\ file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \ file://0002-Fix-default-stack-size-to-256K.patch \ file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ + file://0001-wiredtiger-Avoid-using-off64_t.patch \ " -SRC_URI_append_toolchain-clang = "\ +SRC_URI:append:toolchain-clang = "\ file://0001-asio-Dont-use-experimental-with-clang.patch \ " - S = "${WORKDIR}/git" +CVE_STATUS[CVE-2014-8180] = "not-applicable-config: Not affecting our configuration so it can be safely ignored." +CVE_STATUS[CVE-2017-2665] = "not-applicable-config: Not affecting our configuration so it can be safely ignored." + COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux' PACKAGECONFIG ??= "tcmalloc system-pcre" # gperftools compilation fails for arm below v7 because of missing support of # dmb operation. So we use system-allocator instead of tcmalloc -PACKAGECONFIG_remove_armv6 = "tcmalloc" -PACKAGECONFIG_remove_libc-musl = "tcmalloc" -PACKAGECONFIG_remove_riscv64 = "tcmalloc" -PACKAGECONFIG_remove_riscv32 = "tcmalloc" +PACKAGECONFIG:remove:armv6 = "tcmalloc" +PACKAGECONFIG:remove:libc-musl = "tcmalloc" +PACKAGECONFIG:remove:riscv64 = "tcmalloc" +PACKAGECONFIG:remove:riscv32 = "tcmalloc" PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools," PACKAGECONFIG[shell] = ",--js-engine=none,," PACKAGECONFIG[system-pcre] = "--use-system-pcre,,libpcre," MONGO_ARCH ?= "${HOST_ARCH}" -MONGO_ARCH_powerpc64le = "ppc64le" +MONGO_ARCH:powerpc64le = "ppc64le" WIREDTIGER ?= "off" -WIREDTIGER_x86-64 = "on" -WIREDTIGER_aarch64 = "on" +WIREDTIGER:x86-64 = "on" +WIREDTIGER:aarch64 = "on" + +# ld.gold: fatal error: build/59f4f0dd/mongo/mongod: Structure needs cleaning +LDFLAGS:append:x86:libc-musl = " -fuse-ld=bfd" +LDFLAGS:remove:toolchain-clang = "-fuse-ld=bfd" EXTRA_OESCONS = "PREFIX=${prefix} \ DESTDIR=${D} \ + MAXLINELENGTH='2097152' \ LIBPATH=${STAGING_LIBDIR} \ LINKFLAGS='${LDFLAGS}' \ CXXFLAGS='${CXXFLAGS}' \ @@ -78,50 +91,59 @@ EXTRA_OESCONS = "PREFIX=${prefix} \ --use-system-zlib \ --nostrip \ --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ + --use-hardware-crc32=${@bb.utils.contains('TUNE_FEATURES', 'crc', 'on', 'off', d)} \ --wiredtiger='${WIREDTIGER}' \ --separate-debug \ ${PACKAGECONFIG_CONFARGS}" - USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" - +USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" scons_do_compile() { - ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core || \ + ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core || die "scons build execution failed." } scons_do_install() { - # install binaries - install -d ${D}${bindir} - for i in mongod mongos mongo - do - if [ -f ${B}/build/opt/mongo/${i} ] - then - install -m 0755 ${B}/build/opt/mongo/${i} ${D}${bindir}/${i} - else - bbnote "${i} does not exist" - fi - done - - # install config - install -d ${D}${sysconfdir} - install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir}/ - - # install systemd service - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir} - - # install mongo data folder - install -m 755 -d ${D}${localstatedir}/lib/${BPN} - chown ${PN}:${PN} ${D}${localstatedir}/lib/${BPN} - - # Log files - install -m 755 -d ${D}${localstatedir}/log/${BPN} - chown ${PN}:${PN} ${D}${localstatedir}/log/${BPN} + # install binaries + install -d ${D}${bindir} + for i in mongod mongos mongo; do + if [ -f ${B}/build/*/mongo/$i ]; then + install -m 0755 ${B}/build/*/mongo/$i ${D}${bindir} + else + bbnote "$i does not exist" + fi + done + + # install config + install -d ${D}${sysconfdir} + install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir} + + # install systemd service + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir} + + # install mongo data folder + install -m 755 -d ${D}${localstatedir}/lib/${BPN} + chown ${BPN}:${BPN} ${D}${localstatedir}/lib/${BPN} + + # Create /var/log/mongodb in runtime. + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then + install -d ${D}${nonarch_libdir}/tmpfiles.d + echo "d ${localstatedir}/log/${BPN} 0755 ${BPN} ${BPN} -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf + fi + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then + install -d ${D}${sysconfdir}/default/volatiles + echo "d ${BPN} ${BPN} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN} + fi } -CONFFILES_${PN} = "${sysconfdir}/mongod.conf" +CONFFILES:${PN} = "${sysconfdir}/mongod.conf" + +SYSTEMD_SERVICE:${PN} = "mongod.service" + +FILES:${PN} += "${nonarch_libdir}/tmpfiles.d" + +RDEPENDS:${PN} += "tzdata-core" -SYSTEMD_SERVICE_${PN} = "mongod.service" +SKIP_RECIPE[mongodb] ?= "Needs porting to python 3.12" |