diff options
| author | Khem Raj <raj.khem@gmail.com> | 2017-09-21 21:08:27 -0700 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-10-02 12:35:39 +0000 |
| commit | 06e8aa6bda49b4c103dcb41b059e3dba168ee37a (patch) | |
| tree | 05e74783041e045f85f7f7f2ebc8ba56652fedc3 | |
| parent | db68fbc7846ae9e950d907c18056d29dcdc81374 (diff) | |
| download | meta-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>
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 0000000000..5da34480e7 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From fbfceebce2121831904f2f7115252dd03b413a6d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 19 Sep 2017 18:52:53 -0700 | ||
| 4 | Subject: [PATCH] IntelRDFPMathLib20U1: Check for __DEFINED_wchar_t | ||
| 5 | |||
| 6 | This is defined by musl if wchar_t is already defined | ||
| 7 | |||
| 8 | avoids errors like | ||
| 9 | |||
| 10 | src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h:46:15: error: typedef redefinition with different types | ||
| 11 | ('int' vs 'unsigned int') | ||
| 12 | typedef int wchar_t; | ||
| 13 | |||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | Upstream-Status: Pending | ||
| 17 | |||
| 18 | src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +- | ||
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | ||
| 22 | index 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 | -- | ||
| 35 | 2.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 0000000000..9046bb2f45 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/arm64-support.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | Add alises for arm64 which is same as aarch64 | ||
| 2 | |||
| 3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | Index: 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__',)}, | ||
| 18 | Index: 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 | ||
| 31 | Index: 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 0000000000..5c5c20ce34 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | imported from debian | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | Index: 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( | ||
| 19 | Index: 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 | ||
| 31 | Index: 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 547f608509..d44d8d3c7f 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 | ||
| 6 | DEPENDS = "openssl libpcre libpcap zlib python boost" | 6 | DEPENDS = "openssl libpcre libpcap zlib python boost" |
| 7 | 7 | ||
| 8 | inherit scons | 8 | inherit scons dos2unix |
| 9 | 9 | ||
| 10 | PV = "3.4.6+git${SRCPV}" | 10 | PV = "3.4.6+git${SRCPV}" |
| 11 | SRCREV = "c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5" | 11 | SRCREV = "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 | " |
| 22 | SRC_URI_append_libc-musl ="\ | 25 | SRC_URI_append_libc-musl ="\ |
| 23 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ | 26 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ |
