package/mariadb: patch mariadb_config to add sysroot path
PATCH v4 1/1 package/mariadb: patch mariadb_config to add sysroot path
This patch adds @CMAKE_SYSROOT@ to mariadb_config.c.in. Without it, mariadb_config and mysql_config incorrectly returns host paths for include paths and library paths.
Upstream report and status:
https://jira.mariadb.org/browse/CONC-454
https://github.com/mariadb-corporation/mariadb-connector-c/pull/127
---
Changes v3 -> v4:
- add upstream status (suggested by Peter)
Changes v2 -> v3:
- remove extra slash between CMAKE_SYSROOT and CMAKE_INSTALL_PREFIX
Changes v1 -> v2:
- no change
--- ...2-add-sysroot-path-to-mariadb_config.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001 +From: Ryan Coe <[email protected]> +Date: Fri, 13 Dec 2019 17:13:26 -0800 +Subject: [PATCH 1/1] add sysroot path to mariadb_config + +Upstream report and status: +https://jira.mariadb.org/browse/CONC-454 +https://github.com/mariadb-corporation/mariadb-connector-c/pull/127 + +Signed-off-by: Ryan Coe <[email protected]> +--- + libmariadb/mariadb_config/mariadb_config.c.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmariadb/mariadb_config/mariadb_config.c.in b/libmariadb/mariadb_config/mariadb_config.c.in +index 703c9466a1d9214a85f3638d2e3b4ecfef0c7bd6..f5513333e670373f060a3c2574d1d42facfd0337 100644 +--- a/libmariadb/mariadb_config/mariadb_config.c.in ++++ b/libmariadb/mariadb_config/mariadb_config.c.in +@@ -5,8 +5,8 @@ + + static char *mariadb_progname; + +-#define INCLUDE "-I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql" +-#define LIBS "-L at CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb" ++#define INCLUDE "-I at CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql" ++#define LIBS "-L at CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb" + #define LIBS_SYS "@extra_dynamic_LDFLAGS@" + #define CFLAGS INCLUDE + #define VERSION "@MARIADB_CLIENT_VERSION@" +-- +2.24.1 +
Signature · 1 line
2.25.0
Thomas Petazzoni
AppliedPATCH v4 1/1 package/mariadb: patch mariadb_config to add sysroot path
Quoted 17 lines · On Thu, 13 Feb 2020 09:46:55 -0800 Ryan Coe <[email protected]> wrote:
This patch adds @CMAKE_SYSROOT@ to mariadb_config.c.in. Without it,
mariadb_configandmysql_configincorrectly returns host paths for include paths and library paths.Upstream report and status:
https://jira.mariadb.org/browse/CONC-454
https://github.com/mariadb-corporation/mariadb-connector-c/pull/127Reported-by Alexey Lukyanchuk <[email protected]>Signed-off-by Ryan Coe <[email protected]>---
Changes v3 -> v4:
- add upstream status (suggested by Peter)
Changes v2 -> v3:
- remove extra slash betweenCMAKE_SYSROOTandCMAKE_INSTALL_PREFIX
Changes v1 -> v2:
- no change
Quoted 4 lines
--- ...2-add-sysroot-path-to-mariadb_config.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
Applied to master, thanks. I have updated the upstream status, since the patch has been accepted upstream. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 1/1 package/mariadb: patch mariadb_config to add sysroot path
In reply to Ryan CoeHello Ryan,
Quoted 10 lines · On Thu, 13 Feb 2020 09:46:55 -0800 Ryan Coe <[email protected]> wrote:
This patch adds @CMAKE_SYSROOT@ to mariadb_config.c.in. Without it,
mariadb_configandmysql_configincorrectly returns host paths for include paths and library paths.Upstream report and status:
https://jira.mariadb.org/browse/CONC-454
https://github.com/mariadb-corporation/mariadb-connector-c/pull/127Reported-by Alexey Lukyanchuk <[email protected]>Signed-off-by Ryan Coe <[email protected]>
I am getting back to this older e-mail, because today I tried to use mysql_config when MariaDB is the MySQL provider, and it doesn't work, because it calls mariadb_config, which itself is a program compiled for the target:
$ ./output/staging/usr/bin/mysql_config --cflags /lib/ld-uClibc.so.0: No such file or directory /lib/ld-uClibc.so.0: No such file or directory /lib/ld-uClibc.so.0: No such file or directory /lib/ld-uClibc.so.0: No such file or directory
And indeed:
$ file output/staging/usr/bin/mariadb_config output/staging/usr/bin/mariadb_config: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not stripped
In other projects, the <something>_config program is a script, so it works fine on the host.
How have you been using mariadb_config ?
Here, the issue is that we don't have a consistent behavior between oracle-mysql (which installs a working $(STAGING_DIR)/usr/bin/mysql_config) and mariadb (which doesn't install a working $(STAGING_DIR)/usr/bin/mysql_config).
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 1/1 package/mariadb: patch mariadb_config to add sysroot path
Thomas,
Good morning.
Quoted 28 lines · Thomas Petazzoni
Hello Ryan,
Quoted 10 lines · On Thu, 13 Feb 2020 09:46:55 -0800 Ryan Coe <[email protected]> wrote:
This patch adds @CMAKE_SYSROOT@ to mariadb_config.c.in. Without it,
mariadb_configandmysql_configincorrectly returns host paths for include paths and library paths.Upstream report and status:
https://jira.mariadb.org/browse/CONC-454
https://github.com/mariadb-corporation/mariadb-connector-c/pull/127Reported-by Alexey Lukyanchuk <[email protected]>Signed-off-by Ryan Coe <[email protected]>I am getting back to this older e-mail, because today I tried to use
mysql_configwhen MariaDB is the MySQL provider, and it doesn't work, because it callsmariadb_config, which itself is a program compiled for the target:$ ./output/staging/usr/bin/mysql_config --cflags /lib/ld-uClibc.so.0: No such file or directory /lib/ld-uClibc.so.0: No such file or directory /lib/ld-uClibc.so.0: No such file or directory /lib/ld-uClibc.so.0: No such file or directoryAnd indeed:
Quoted 7 lines
$ file output/staging/usr/bin/mariadb_config output/staging/usr/bin/mariadb_config: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not strippedIn other projects, the <something>_config program is a script, so it works fine on the host.
How have you been using
mariadb_config?
I actually haven't used mariadb_config for anything.? My typical usage would include MariaDB and PHP mysqlnd.
Quoted 5 lines
Here, the issue is that we don't have a consistent behavior between oracle-mysql (which installs a working $(STAGING_DIR)/usr/bin/mysql_config) and mariadb (which doesn't install a working $(STAGING_DIR)/usr/bin/mysql_config).
Makes sense.? Do you have an opinion on how to proceed?? Thanks.
Quoted 4 lines
Thanks!
Thomas