summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs
diff options
context:
space:
mode:
authorZoltán Böszörményi <zboszor@gmail.com>2021-07-06 08:57:48 +0200
committerKhem Raj <raj.khem@gmail.com>2021-07-08 09:21:40 -0700
commit6f05b2463a20f99d43c5a7db190dfe3490929247 (patch)
treeac5641d957104c0f7f84b386f0a476c9b6964de7 /meta-oe/recipes-dbs
parent4c35a3276e1ec66c6d0ae2e2b4f034a435eb0b66 (diff)
downloadmeta-openembedded-6f05b2463a20f99d43c5a7db190dfe3490929247.tar.gz
mariadb: Use qemu to run cross-compiled binaries
This way, mariadb does not depend on mariadb-native anymore. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-dbs')
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb.inc27
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch25
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch67
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb_10.5.10.bb4
4 files changed, 15 insertions, 108 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index 18b025070..7b1f537fb 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -12,7 +12,6 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${BP}/source/${BP}.tar.gz
12 file://mysql-systemd-start \ 12 file://mysql-systemd-start \
13 file://configure.cmake-fix-valgrind.patch \ 13 file://configure.cmake-fix-valgrind.patch \
14 file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \ 14 file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \
15 file://sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
16 file://0001-disable-ucontext-on-musl.patch \ 15 file://0001-disable-ucontext-on-musl.patch \
17 file://c11_atomics.patch \ 16 file://c11_atomics.patch \
18 file://clang_version_header_conflict.patch \ 17 file://clang_version_header_conflict.patch \
@@ -21,7 +20,6 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${BP}/source/${BP}.tar.gz
21 file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \ 20 file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \
22 file://0001-aio_linux-Check-if-syscall-exists-before-using-it.patch \ 21 file://0001-aio_linux-Check-if-syscall-exists-before-using-it.patch \
23 file://sys_futex.patch \ 22 file://sys_futex.patch \
24 file://cross-compiling.patch \
25 file://ssize_t.patch \ 23 file://ssize_t.patch \
26 file://mm_malloc.patch \ 24 file://mm_malloc.patch \
27 " 25 "
@@ -60,8 +58,6 @@ SYSTEMD_AUTO_ENABLE_${PN}-setupdb ?= "enable"
60ALLOW_EMPTY_${PN}-setupdb ?= "1" 58ALLOW_EMPTY_${PN}-setupdb ?= "1"
61FILES_${PN}-setupdb = "${sysconfdir}/init.d/install_db" 59FILES_${PN}-setupdb = "${sysconfdir}/init.d/install_db"
62 60
63EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
64
65PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb" 61PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb"
66PACKAGECONFIG_class-native = "" 62PACKAGECONFIG_class-native = ""
67PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam" 63PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
@@ -95,6 +91,8 @@ EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \
95 -DCAT_EXECUTABLE=`which cat` \ 91 -DCAT_EXECUTABLE=`which cat` \
96 -DCMAKE_AR:FILEPATH=${AR}" 92 -DCMAKE_AR:FILEPATH=${AR}"
97 93
94EXTRA_OECMAKE_prepend_class-target = "-DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper "
95
98# With Ninja it fails with: 96# With Ninja it fails with:
99# make: *** No rule to make target `install'. Stop. 97# make: *** No rule to make target `install'. Stop.
100OECMAKE_GENERATOR = "Unix Makefiles" 98OECMAKE_GENERATOR = "Unix Makefiles"
@@ -117,12 +115,18 @@ do_generate_toolchain_file_append_class-native () {
117 sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake 115 sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake
118} 116}
119 117
120do_compile_prepend_class-target () { 118do_configure_prepend_class-target () {
121 # These need to be in-tree or make will think they need to be built, 119 # Write out a qemu wrapper that will be used by cmake
122 # and since we're cross-compiling that is disabled 120 # so that it can run target helper binaries through that.
123 cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra 121 qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
124 cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts 122 cat > ${WORKDIR}/qemuwrapper << EOF
123#!/bin/sh
124$qemu_binary "\$@"
125EOF
126 chmod +x ${WORKDIR}/qemuwrapper
127}
125 128
129do_compile_prepend_class-target () {
126 if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then 130 if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then
127 if ! [ -e ${B}/include/openssl/kssl.h ] ; then 131 if ! [ -e ${B}/include/openssl/kssl.h ] ; then
128 mkdir -p ${B}/include/openssl 132 mkdir -p ${B}/include/openssl
@@ -132,11 +136,6 @@ do_compile_prepend_class-target () {
132 echo "#endif" >>${B}/include/openssl/kssl.h 136 echo "#endif" >>${B}/include/openssl/kssl.h
133 fi 137 fi
134 fi 138 fi
135 # workaround to handle out-of-source build from source package
136 yacc_files="sql_yacc.hh sql_yacc.cc sql_yacc_ora.hh sql_yacc_ora.cc"
137 for yacc_file in ${yacc_files}; do
138 cp ${S}/sql/${yacc_file} ${B}/sql/${yacc_file}
139 done
140} 139}
141 140
142SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess" 141SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess"
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch b/meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch
deleted file mode 100644
index 0f4815b18..000000000
--- a/meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1This is not needed for OE builds
2
3building failed since native does not generate import_executables.cmake
4In fact, our building system will export the needed commands
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Roy Li <rongqing.li@windriver.com>
9Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12--- a/CMakeLists.txt
13+++ b/CMakeLists.txt
14@@ -392,11 +392,6 @@ CHECK_PCRE()
15
16 CHECK_SYSTEMD()
17
18-IF(CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
19- SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
20- INCLUDE(${IMPORT_EXECUTABLES})
21-ENDIF()
22-
23 #
24 # Setup maintainer mode options. Platform checks are
25 # not run with the warning options as to not perturb fragile checks
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch b/meta-oe/recipes-dbs/mysql/mariadb/sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch
deleted file mode 100644
index 4cb044339..000000000
--- a/meta-oe/recipes-dbs/mysql/mariadb/sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From cfce1491827e5a581878b5e166bf4d30e6d90e07 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Thu, 23 Jul 2020 00:08:16 -0700
4Subject: [PATCH] sql/CMakeLists.txt: fix gen_lex_hash not found
5
6Fix the below do_compile issue in cross-compiling env.
7| make[2]: *** No rule to make target '/build/tmp/work/aarch64-poky-linux/mariadb/10.3.13-r0/mariadb-10.3.13/sql/gen_lex_hash', needed by 'sql/lex_hash.h'. Stop.
8| make[2]: *** No rule to make target '/build/tmp/work/aarch64-poky-linux/mariadb/10.3.13-r0/mariadb-10.3.13/sql/gen_lex_token', needed by 'sql/lex_token.h'. Stop.
9
10Upstream-Status: Inappropriate [oe build specific]
11
12Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
13---
14 sql/CMakeLists.txt | 30 ++++++++++++++++++++----------
15 1 file changed, 20 insertions(+), 10 deletions(-)
16
17diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
18index 0dc3caa..616017b 100644
19--- a/sql/CMakeLists.txt
20+++ b/sql/CMakeLists.txt
21@@ -52,11 +52,16 @@ ${CMAKE_BINARY_DIR}/sql
22 ${CMAKE_SOURCE_DIR}/tpool
23 )
24
25-ADD_CUSTOM_COMMAND(
26- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
27- COMMAND gen_lex_token > lex_token.h
28- DEPENDS gen_lex_token
29-)
30+IF(NOT CMAKE_CROSSCOMPILING)
31+ ADD_CUSTOM_COMMAND(
32+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
33+ COMMAND gen_lex_token > lex_token.h
34+ DEPENDS gen_lex_token)
35+ELSE()
36+ ADD_CUSTOM_COMMAND(
37+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
38+ COMMAND gen_lex_token > lex_token.h)
39+ENDIF()
40
41 ADD_CUSTOM_COMMAND(
42 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.yy
43@@ -345,11 +350,16 @@ IF(NOT CMAKE_CROSSCOMPILING)
44 ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
45 ENDIF()
46
47-ADD_CUSTOM_COMMAND(
48- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
49- COMMAND gen_lex_hash > lex_hash.h
50- DEPENDS gen_lex_hash
51-)
52+IF(NOT CMAKE_CROSSCOMPILING)
53+ ADD_CUSTOM_COMMAND(
54+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
55+ COMMAND gen_lex_hash > lex_hash.h
56+ DEPENDS gen_lex_hash)
57+ELSE()
58+ ADD_CUSTOM_COMMAND(
59+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
60+ COMMAND gen_lex_hash > lex_hash.h)
61+ENDIF()
62
63 MYSQL_ADD_EXECUTABLE(mariadb-tzinfo-to-sql tztime.cc COMPONENT Server)
64 SET_TARGET_PROPERTIES(mariadb-tzinfo-to-sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
65--
662.17.1
67
diff --git a/meta-oe/recipes-dbs/mysql/mariadb_10.5.10.bb b/meta-oe/recipes-dbs/mysql/mariadb_10.5.10.bb
index 8ae8241b0..57d7736ea 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb_10.5.10.bb
+++ b/meta-oe/recipes-dbs/mysql/mariadb_10.5.10.bb
@@ -1,8 +1,8 @@
1require mariadb.inc 1require mariadb.inc
2 2
3EXTRA_OECMAKE += "-DSTACK_DIRECTION=-1" 3inherit qemu
4 4
5DEPENDS += "mariadb-native bison-native boost libpcre2 curl openssl ncurses zlib libaio libedit libevent libxml2" 5DEPENDS += "qemu-native bison-native boost libpcre2 curl openssl ncurses zlib libaio libedit libevent libxml2"
6 6
7PROVIDES += "mysql5 libmysqlclient" 7PROVIDES += "mysql5 libmysqlclient"
8 8