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

Sergei Golubchik serg at mariadb.org
Sat Jan 26 18:37:14 GMT 2019


Hi, Helmut!

I don't think I understand what's happening.

I would say that when cross-compiling mariadb_config should be built for
the host architecture.

You'll get "Exec format error" if you run'll run it on the target
architecture, but that should not be a problem, as you will not need to
run mariadb_config on the target architecture. Because mariadb_config is
a helper tool to build applications, and you build on the host
architecture for the target architecture. You don't need mariadb_config
to use libmariadb.

Do you mean that you've built libmariadb on one (host) architecture,
copied to another (target) architecture. And then you want to build
various applications (that use libmariadb) directly on the target
architecture? That's confusing, if your target architecture has a
working development environment, why not to build libmariadb there too?

I'm afraid, I don't understand your use case.

Regards,
Sergei

On Jan 24, Otto Kekäläinen wrote:
> 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?



More information about the pkg-mysql-maint mailing list