Skip to contentSkip to conversation

mongodb: Fix build with musl

PATCH New Khem Raj 1 participant 1 message Sep 15, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 mongodb: Fix build with musl

Add a patch to include ssize_t definition Pass OBJCOPY to scons so it does not use the host objcopy but cross objcopy, which is the right tool to invoke

Fixes
objcopy: Unable to recognise the format of the input file `build/opt/mongo/mongos'

Cc Vincent Prince <[email protected]>
---
 .../recipes-dbs/mongodb/mongodb/ssize_t.patch   | 17 +++++++++++++++++
 .../recipes-dbs/mongodb/mongodb_git.bb          |  2 ++
 2 files changed, 19 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/ssize_t.patch
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/ssize_t.patch new file +17 -0
new file mode 100644
index 0000000000..d297691b69
@@ -0,0 +1,17 @@
+ssize_t is provided by sys/types.h, musl does not like
+it if the header is not included, for glibc it is included
+indirectly.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/src/third_party/kms-message/src/kms_request_str.h
++++ b/src/third_party/kms-message/src/kms_request_str.h
+@@ -24,6 +24,7 @@
+ #include <stdbool.h>
+ #include <stdint.h>
+ #include <string.h>
++#include <sys/types.h>
+ 
+ #if defined(_WIN32)
+ #include <basetsd.h>
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +2 -0
index b8691df9eb..2be7de02a9 100644
@@ -24,6 +24,7 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4 \
            file://0001-Support-deprecated-resolver-functions.patch \
            file://0003-Fix-unknown-prefix-env.patch \
            file://1296.patch \
+           file://ssize_t.patch \
            "
 SRC_URI_append_libc-musl ="\
            file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
@@ -59,6 +60,7 @@ EXTRA_OESCONS = "PREFIX=${prefix} \
                  CXXFLAGS='${CXXFLAGS}' \
                  TARGET_ARCH=${TARGET_ARCH} \
                  MONGO_VERSION=${PV} \
+                 OBJCOPY=${OBJCOPY} \
                  --ssl \
                  --disable-warnings-as-errors \
                  --use-system-zlib \
Signature · 1 line
2.28.0