diff options
3 files changed, 32 insertions, 31 deletions
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch new file mode 100644 index 0000000000..5337fcdbfd --- /dev/null +++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From ca004968b8d2149f72d4edcfe029489a8c5e10ca Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 23 Sep 2019 12:31:31 -0700 | ||
4 | Subject: [PATCH] Mark one of strerror_r implementation glibc specific | ||
5 | |||
6 | glibc has two incompatible strerror_r definitions, one of them is | ||
7 | specific to glibc, mark this one so | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | src/mongo/util/errno_util.cpp | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/src/mongo/util/errno_util.cpp b/src/mongo/util/errno_util.cpp | ||
17 | index 564c0071ea..4f7e1d3a38 100644 | ||
18 | --- a/src/mongo/util/errno_util.cpp | ||
19 | +++ b/src/mongo/util/errno_util.cpp | ||
20 | @@ -61,7 +61,7 @@ std::string errnoWithDescription(int errNumber) { | ||
21 | char buf[kBuflen]; | ||
22 | char* msg{nullptr}; | ||
23 | |||
24 | -#if defined(__GNUC__) && defined(_GNU_SOURCE) && \ | ||
25 | +#if defined(__GNUC__) && defined(_GNU_SOURCE) && defined(__GLIBC__) && \ | ||
26 | (!defined(__ANDROID_API__) || !(__ANDROID_API__ <= 22)) && !defined(EMSCRIPTEN) | ||
27 | msg = strerror_r(errNumber, buf, kBuflen); | ||
28 | #elif defined(_WIN32) | ||
29 | -- | ||
30 | 2.23.0 | ||
31 | |||
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0003-fix-musl-strerror_r.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0003-fix-musl-strerror_r.patch deleted file mode 100644 index c6035894ed..0000000000 --- a/meta-oe/recipes-dbs/mongodb/mongodb/0003-fix-musl-strerror_r.patch +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | Index: git/src/mongo/util/errno_util.cpp | ||
2 | =================================================================== | ||
3 | --- git.orig/src/mongo/util/errno_util.cpp | ||
4 | +++ git/src/mongo/util/errno_util.cpp | ||
5 | @@ -49,6 +49,16 @@ const char kUnknownMsg[] = "Unknown erro | ||
6 | const int kBuflen = 256; // strerror strings in non-English locales can be large. | ||
7 | } // namespace | ||
8 | |||
9 | +inline char const * strerror_r_helper( char const * r, char const * ) | ||
10 | +{ | ||
11 | + return r; | ||
12 | +} | ||
13 | + | ||
14 | +inline char const * strerror_r_helper( int r, char const * buffer ) | ||
15 | +{ | ||
16 | + return r == 0? buffer: "Unknown error"; | ||
17 | +} | ||
18 | + | ||
19 | std::string errnoWithDescription(int errNumber) { | ||
20 | #if defined(_WIN32) | ||
21 | if (errNumber == -1) | ||
22 | @@ -63,7 +73,7 @@ std::string errnoWithDescription(int err | ||
23 | |||
24 | #if defined(__GNUC__) && defined(_GNU_SOURCE) && \ | ||
25 | (!defined(__ANDROID_API__) || !(__ANDROID_API__ <= 22)) && !defined(EMSCRIPTEN) | ||
26 | - msg = strerror_r(errNumber, buf, kBuflen); | ||
27 | + msg = strerror_r_helper(strerror_r(errNumber, buf, kBuflen)); | ||
28 | #elif defined(_WIN32) | ||
29 | |||
30 | LPWSTR errorText = nullptr; | ||
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/recipes-dbs/mongodb/mongodb_git.bb index d3c19d6c4c..3e77ac32f3 100644 --- a/meta-oe/recipes-dbs/mongodb/mongodb_git.bb +++ b/meta-oe/recipes-dbs/mongodb/mongodb_git.bb | |||
@@ -25,8 +25,8 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.2 \ | |||
25 | file://0003-Fix-unknown-prefix-env.patch \ | 25 | file://0003-Fix-unknown-prefix-env.patch \ |
26 | " | 26 | " |
27 | SRC_URI_append_libc-musl ="\ | 27 | SRC_URI_append_libc-musl ="\ |
28 | file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \ | ||
28 | file://0002-Fix-default-stack-size-to-256K.patch \ | 29 | file://0002-Fix-default-stack-size-to-256K.patch \ |
29 | file://0003-fix-musl-strerror_r.patch \ | ||
30 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ | 30 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ |
31 | " | 31 | " |
32 | 32 | ||