summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-09-21 21:08:27 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-10-02 12:35:39 +0000
commit06e8aa6bda49b4c103dcb41b059e3dba168ee37a (patch)
tree05e74783041e045f85f7f7f2ebc8ba56652fedc3
parentdb68fbc7846ae9e950d907c18056d29dcdc81374 (diff)
downloadmeta-openembedded-06e8aa6bda49b4c103dcb41b059e3dba168ee37a.tar.gz
mongodb: Fix build on aarch64
Inherit dos2unix since some files patched are in dos format Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch36
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/arm64-support.patch43
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch50
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb_git.bb5
4 files changed, 133 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch b/meta-oe/recipes-support/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch
new file mode 100644
index 000000000..5da34480e
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch
@@ -0,0 +1,36 @@
1From fbfceebce2121831904f2f7115252dd03b413a6d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 19 Sep 2017 18:52:53 -0700
4Subject: [PATCH] IntelRDFPMathLib20U1: Check for __DEFINED_wchar_t
5
6This is defined by musl if wchar_t is already defined
7
8avoids errors like
9
10src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h:46:15: error: typedef redefinition with different types
11 ('int' vs 'unsigned int')
12typedef int wchar_t;
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16Upstream-Status: Pending
17
18 src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
22index 2b3f76db86..cc80305775 100755
23--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
24+++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
25@@ -42,7 +42,7 @@
26 #include <ctype.h>
27
28 // Fix system header issue on Sun solaris and define required type by ourselves
29-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
30+#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) && !defined(__DEFINED_wchar_t)
31 typedef int wchar_t;
32 #endif
33
34--
352.14.1
36
diff --git a/meta-oe/recipes-support/mongodb/mongodb/arm64-support.patch b/meta-oe/recipes-support/mongodb/mongodb/arm64-support.patch
new file mode 100644
index 000000000..9046bb2f4
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/arm64-support.patch
@@ -0,0 +1,43 @@
1Add alises for arm64 which is same as aarch64
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6Index: git/SConstruct
7===================================================================
8--- git.orig/SConstruct
9+++ git/SConstruct
10@@ -990,6 +990,7 @@ elif endian == "big":
11 processor_macros = {
12 'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
13 'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
14+ 'arm64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
15 'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
16 'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
17 's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
18Index: git/src/third_party/IntelRDFPMathLib20U1/SConscript
19===================================================================
20--- git.orig/src/third_party/IntelRDFPMathLib20U1/SConscript
21+++ git/src/third_party/IntelRDFPMathLib20U1/SConscript
22@@ -301,7 +301,7 @@ if processor == 'i386':
23 elif processor == 'arm':
24 cpp_defines['IA32'] = '1'
25 cpp_defines['ia32'] = '1'
26-elif processor == "aarch64":
27+elif processor == "aarch64" or processor == 'arm64':
28 cpp_defines['efi2'] = '1'
29 cpp_defines['EFI2'] = '1'
30 # Using 64 bit little endian
31Index: git/src/third_party/wiredtiger/SConscript
32===================================================================
33--- git.orig/src/third_party/wiredtiger/SConscript
34+++ git/src/third_party/wiredtiger/SConscript
35@@ -139,7 +139,7 @@ condition_map = {
36 'POSIX_HOST' : not env.TargetOSIs('windows'),
37 'WINDOWS_HOST' : env.TargetOSIs('windows'),
38
39- 'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64',
40+ 'ARM64_HOST' : env['TARGET_ARCH'] in ('aarch64', 'arm64'),
41 'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le',
42 'X86_HOST' : env['TARGET_ARCH'] == 'x86_64',
43 'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x',
diff --git a/meta-oe/recipes-support/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch b/meta-oe/recipes-support/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch
new file mode 100644
index 000000000..5c5c20ce3
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch
@@ -0,0 +1,50 @@
1imported from debian
2
3Upstream-Status: Pending
4Index: git/src/third_party/wiredtiger/SConscript
5===================================================================
6--- git.orig/src/third_party/wiredtiger/SConscript
7+++ git/src/third_party/wiredtiger/SConscript
8@@ -169,7 +169,9 @@ if useSnappy:
9 # If not available at runtime, we fall back to software in some cases.
10 #
11 # On zSeries we may disable because SLES 11 kernel doe not support the instructions.
12-if not (env['TARGET_ARCH'] == 's390x' and get_option("use-s390x-crc32") == "off"):
13+# Debian: disable hardware-assisted crc32 on s390x and arm64, as at least the
14+# buildd's do not support the instructions.
15+if env['TARGET_ARCH'] not in ('s390x', 'arm64', 'aarch64'):
16 env.Append(CPPDEFINES=["HAVE_CRC32_HARDWARE"])
17
18 wtlib = env.Library(
19Index: git/src/third_party/wiredtiger/dist/filelist
20===================================================================
21--- git.orig/src/third_party/wiredtiger/dist/filelist
22+++ git/src/third_party/wiredtiger/dist/filelist
23@@ -54,7 +54,6 @@ src/checksum/power8/crc32_wrapper.c POWE
24 src/checksum/software/checksum.c
25 src/checksum/x86/crc32-x86.c X86_HOST
26 src/checksum/zseries/crc32-s390x.c ZSERIES_HOST
27-src/checksum/zseries/crc32le-vx.sx ZSERIES_HOST
28 src/config/config.c
29 src/config/config_api.c
30 src/config/config_check.c
31Index: git/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c
32===================================================================
33--- git.orig/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c
34+++ git/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c
35@@ -78,6 +78,7 @@ unsigned int __wt_crc32c_le(unsigned int
36 return crc; \
37 }
38
39+#if defined(HAVE_CRC32_HARDWARE)
40 /* Main CRC-32 functions */
41 DEFINE_CRC32_VX(__wt_crc32c_le_vx, __wt_crc32c_le_vgfm_16, __wt_crc32c_le)
42
43@@ -90,6 +91,7 @@ __wt_checksum_hw(const void *chunk, size
44 {
45 return (~__wt_crc32c_le_vx(0xffffffff, chunk, len));
46 }
47+#endif
48
49 #endif
50
diff --git a/meta-oe/recipes-support/mongodb/mongodb_git.bb b/meta-oe/recipes-support/mongodb/mongodb_git.bb
index 547f60850..d44d8d3c7 100644
--- a/meta-oe/recipes-support/mongodb/mongodb_git.bb
+++ b/meta-oe/recipes-support/mongodb/mongodb_git.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://GNU-AGPL-3.0.txt;md5=73f1eb20517c55bf9493b7dd6e480788
5 5
6DEPENDS = "openssl libpcre libpcap zlib python boost" 6DEPENDS = "openssl libpcre libpcap zlib python boost"
7 7
8inherit scons 8inherit scons dos2unix
9 9
10PV = "3.4.6+git${SRCPV}" 10PV = "3.4.6+git${SRCPV}"
11SRCREV = "c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5" 11SRCREV = "c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5"
@@ -18,6 +18,9 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v3.4 \
18 file://0001-Use-strerror_r-only-on-glibc-systems.patch \ 18 file://0001-Use-strerror_r-only-on-glibc-systems.patch \
19 file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \ 19 file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \
20 file://0003-Conditionalize-glibc-specific-strerror_r.patch \ 20 file://0003-Conditionalize-glibc-specific-strerror_r.patch \
21 file://arm64-support.patch \
22 file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \
23 file://disable-hw-crc32-on-arm64-s390x.patch \
21 " 24 "
22SRC_URI_append_libc-musl ="\ 25SRC_URI_append_libc-musl ="\
23 file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ 26 file://0004-wiredtiger-Disable-strtouq-on-musl.patch \