diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-08-17 16:43:43 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-08-17 16:54:40 -0700 |
commit | 4cfdfa16f2491708142fc7d0ec58a4ec67fa1996 (patch) | |
tree | 1bac37aa03cb752fffe5147421850ba6a96a42de | |
parent | 6c68c22d7321f5135ea9ab07f768557e1e191cd5 (diff) | |
download | meta-openembedded-4cfdfa16f2491708142fc7d0ec58a4ec67fa1996.tar.gz |
mariadb: Fix build with libfmt 10.1+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Markus Volk <f_l_k@t-online.de>
Cc: Wang Mingyu <wangmy@fujitsu.com>
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb.inc | 1 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch | 68 |
2 files changed, 69 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc index ee3fe0a32..d64d5b0e4 100644 --- a/meta-oe/recipes-dbs/mysql/mariadb.inc +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc | |||
@@ -23,6 +23,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ | |||
23 | file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \ | 23 | file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \ |
24 | file://lfs64.patch \ | 24 | file://lfs64.patch \ |
25 | file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ | 25 | file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ |
26 | file://libfmt_make_fmt.patch \ | ||
26 | " | 27 | " |
27 | SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch" | 28 | SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch" |
28 | SRC_URI[sha256sum] = "4c9484048d4d0c71dd076ab33fc2a9ce8510bdf762886de0d63fe52496f3dbbb" | 29 | SRC_URI[sha256sum] = "4c9484048d4d0c71dd076ab33fc2a9ce8510bdf762886de0d63fe52496f3dbbb" |
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch b/meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch new file mode 100644 index 000000000..4d5f4a611 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | Make make_arg work with libfmt 10.1+ | ||
2 | |||
3 | This ensures that compiler can find the correct template to use | ||
4 | Fixes | ||
5 | |||
6 | mariadb-10.11.5/sql/item_strfunc.cc:1429:22: error: no matching functi | ||
7 | on for call to 'make_arg' | ||
8 | | 1429 | vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_int()); | ||
9 | | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
10 | | /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/mariadb/10.11.5/recipe-sysroot/usr/include/fmt/core.h:1588:20: note: candidate functio | ||
11 | n [with Context = fmt::basic_format_context<fmt::appender, char>, T = long long] not viable: expects an lvalue for 1st argument | ||
12 | | 1588 | FMT_CONSTEXPR auto make_arg(T& val) -> basic_format_arg<Context> { | ||
13 | | | ^ ~~~~~~ | ||
14 | | /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/mariadb/10.11.5/recipe-sysroot/usr/include/fmt/core.h:1559:31: note: candidate templat | ||
15 | e ignored: invalid explicitly-specified argument for template parameter 'PACKED' | ||
16 | | 1559 | FMT_CONSTEXPR FMT_INLINE auto make_arg(T& [ 46%] Building C object mysys/CMakeFiles/mysys.dir/my_likely.c.o | ||
17 | | val) -> value<Context> { | ||
18 | | | ^ | ||
19 | | /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/mariadb/10.11.5/recipe-sysroot/usr/include/fmt/core.h:1596:27: note: candidate templat | ||
20 | e ignored: invalid explicitly-specified argument for template parameter 'PACKED' | ||
21 | | 1596 | FMT_CONSTEXPR inline auto make_arg(T& val) -> basic_format_arg<Context> { | ||
22 | | | ^ | ||
23 | |||
24 | Upstream-Status: Pending | ||
25 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
26 | |||
27 | --- a/cmake/libfmt.cmake | ||
28 | +++ b/cmake/libfmt.cmake | ||
29 | @@ -33,8 +33,9 @@ MACRO (CHECK_LIBFMT) | ||
30 | #include <fmt/format-inl.h> | ||
31 | #include <iostream> | ||
32 | int main() { | ||
33 | + int val = 42; | ||
34 | fmt::format_args::format_arg arg= | ||
35 | - fmt::detail::make_arg<fmt::format_context>(42); | ||
36 | + fmt::detail::make_arg<fmt::format_context>(val); | ||
37 | std::cout << fmt::vformat(\"The answer is {}.\", | ||
38 | fmt::format_args(&arg, 1)); | ||
39 | }" HAVE_SYSTEM_LIBFMT) | ||
40 | --- a/sql/item_strfunc.cc | ||
41 | +++ b/sql/item_strfunc.cc | ||
42 | @@ -1426,14 +1426,22 @@ String *Item_func_sformat::val_str(Strin | ||
43 | switch (args[carg]->result_type()) | ||
44 | { | ||
45 | case INT_RESULT: | ||
46 | - vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_int()); | ||
47 | + int intval; | ||
48 | + intval = args[carg]->val_int(); | ||
49 | + vargs[carg-1]= fmt::detail::make_arg<ctx>(intval); | ||
50 | break; | ||
51 | case DECIMAL_RESULT: // TODO | ||
52 | case REAL_RESULT: | ||
53 | + float fval; | ||
54 | + int val; | ||
55 | if (args[carg]->field_type() == MYSQL_TYPE_FLOAT) | ||
56 | - vargs[carg-1]= fmt::detail::make_arg<ctx>((float)args[carg]->val_real()); | ||
57 | - else | ||
58 | - vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_real()); | ||
59 | + { | ||
60 | + fval = (float)args[carg]->val_real(); | ||
61 | + vargs[carg-1]= fmt::detail::make_arg<ctx>(fval); | ||
62 | + } else { | ||
63 | + val = args[carg]->val_real(); | ||
64 | + vargs[carg-1]= fmt::detail::make_arg<ctx>(val); | ||
65 | + } | ||
66 | break; | ||
67 | case STRING_RESULT: | ||
68 | if (!(parg= args[carg]->val_str(&val_arg[carg-1]))) | ||