diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2019-03-15 02:50:06 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-03-15 09:17:11 -0700 |
commit | e51545e4c355fec11b3e4edc3c05cf73c1088cbe (patch) | |
tree | acf74621c10ff8bdb5189a782b77662d11a30ff5 /meta-oe | |
parent | 60f872278dde6156fcf73c19cce3fea295938a06 (diff) | |
download | meta-openembedded-e51545e4c355fec11b3e4edc3c05cf73c1088cbe.tar.gz |
mariadb: fix atomic support on arm
Check to link with libatomic to enable C11
atomics support to fix below build error on arm:
| /build/tmp/work/armv5e-wrs-linux-gnueabi/mariadb/10.3.13-r0/recipe-sysroot-native/usr/bin/arm-wrs-linux-gnueabi/../../libexec/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/8.3.0/ld.bfd: librocksdblib.a(env_posix.cc.o): in function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
| /usr/include/c++/8.3.0/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb.inc | 2 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch | 34 |
2 files changed, 35 insertions, 1 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc index 00a9d668c..fca74d448 100644 --- a/meta-oe/recipes-dbs/mysql/mariadb.inc +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc | |||
@@ -17,6 +17,7 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${BPN}-${PV}/source/${BPN} | |||
17 | file://0001-disable-ucontext-on-musl.patch \ | 17 | file://0001-disable-ucontext-on-musl.patch \ |
18 | file://c11_atomics.patch \ | 18 | file://c11_atomics.patch \ |
19 | file://clang_version_header_conflict.patch \ | 19 | file://clang_version_header_conflict.patch \ |
20 | file://fix-arm-atomic.patch \ | ||
20 | " | 21 | " |
21 | SRC_URI[md5sum] = "603ce42e35b9a688f2cca05275acb5cb" | 22 | SRC_URI[md5sum] = "603ce42e35b9a688f2cca05275acb5cb" |
22 | SRC_URI[sha256sum] = "b2aa857ef5b84f85a7ea60a1eac7b34c0ca5151c71a0d44ce2d7fb028d71459a" | 23 | SRC_URI[sha256sum] = "b2aa857ef5b84f85a7ea60a1eac7b34c0ca5151c71a0d44ce2d7fb028d71459a" |
@@ -63,7 +64,6 @@ PACKAGECONFIG[setupdb] = ", ,,${PN}-setupdb" | |||
63 | # https://mariadb.atlassian.net/browse/MDEV-5982 | 64 | # https://mariadb.atlassian.net/browse/MDEV-5982 |
64 | TARGET_CFLAGS += "-fuse-ld=bfd" | 65 | TARGET_CFLAGS += "-fuse-ld=bfd" |
65 | LDFLAGS += " -pthread" | 66 | LDFLAGS += " -pthread" |
66 | LDFLAGS_append_armv5 = " -latomic" | ||
67 | BUILD_CFLAGS += "-fuse-ld=bfd" | 67 | BUILD_CFLAGS += "-fuse-ld=bfd" |
68 | BUILD_CXXFLAGS += "-fuse-ld=bfd" | 68 | BUILD_CXXFLAGS += "-fuse-ld=bfd" |
69 | 69 | ||
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch b/meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch new file mode 100644 index 000000000..34d31148b --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From ffaaf4d43ebf2ef6d0229a60f407c1f5a06e5c53 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Fri, 15 Mar 2019 01:46:05 -0700 | ||
4 | Subject: [PATCH] build_rocksdb.cmake: fix atomic support on arm | ||
5 | |||
6 | Check to link with libatomic to enable C11 atomics support | ||
7 | to fix below build error on arm: | ||
8 | | /build/tmp/work/armv5e-wrs-linux-gnueabi/mariadb/10.3.13-r0/recipe-sysroot-native/usr/bin/arm-wrs-linux-gnueabi/../../libexec/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/8.3.0/ld.bfd: librocksdblib.a(env_posix.cc.o): in function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)': | ||
9 | | /usr/include/c++/8.3.0/bits/atomic_base.h:374: undefined reference to `__atomic_store_8' | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
14 | --- | ||
15 | storage/rocksdb/build_rocksdb.cmake | 3 +++ | ||
16 | 1 file changed, 3 insertions(+) | ||
17 | |||
18 | diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake | ||
19 | index c36c761..2b539ff 100644 | ||
20 | --- a/storage/rocksdb/build_rocksdb.cmake | ||
21 | +++ b/storage/rocksdb/build_rocksdb.cmake | ||
22 | @@ -424,6 +424,9 @@ list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc) | ||
23 | |||
24 | ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES}) | ||
25 | target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) | ||
26 | +IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) | ||
27 | + TARGET_LINK_LIBRARIES(rocksdblib atomic) | ||
28 | +ENDIF() | ||
29 | IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
30 | set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -frtti") | ||
31 | endif() | ||
32 | -- | ||
33 | 2.17.1 | ||
34 | |||