[debian-mysql] Bug#920365: mariadb_config: improve cross compilation support

Helmut Grohne helmut at subdivi.de
Thu Jan 24 19:05:14 GMT 2019


Package: libmariadb-dev
Version: 1:10.3.12-1
Severity: wishlist

Hi,

I'm seeing that very many packages fail to cross build when using
mysql/mariadb. Many of those packages use mysql_config (rarely
mariadb_config). During cross building, there are essentially two ways
to use mysql_config: Either you have the build architecture
mariadb_config. In this case, you can run it, but the values it outputs
are wrong. Or you have the host architecture mariadb_config. In this
case, running mariadb_config fails with "Exec format error", because it
is an ELF binary. In neither case, do you get useful results.

This is very unfortunate and we've had the exact same situation with
postgresql/pg_config. Then Christoph (Cced) came up with a crazy idea:
Run pg_config at build time, capture all of its output and generate a
shell script from it. Then he turned the packaged pg_config into a perl
script. How does that help? When running the host architecture
pg_config, it is run via /usr/bin/perl, which is a build architecture
executable. The "Exec format error" goes away. One gets the right
results.

Can we do the same for mariadb_config? I'm attaching a generator script.
If you run sh mysql_config_generator.sh path/to/mariadb_config, it will
output a new shell script to stdout. This new shell script should behave
exactly the same as the original mariadb_config except that it works for
cross compilation.

The key here is turning mariadb_config from an ELF executable into some
interpreted script. That's what makes it useful for cross compilation.

What do you think about this?

Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mysql_config_generator.sh
Type: application/x-sh
Size: 529 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-mysql-maint/attachments/20190124/bede8d84/attachment.sh>


More information about the pkg-mysql-maint mailing list