← Back to team overview

maria-developers team mailing list archive

Re: crosscompiling in buildroot: cannot find -laio and other link error

 

Hi, Sylvain!

On Oct 02, Sylvain Raybaud wrote:
> > Did you check
> > https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/ ? Regards,
> > Sergei 
> 
> Ooops. For some reason I completely missed this page. Building only the
> host variant of  import_executables target eases cross-compilation a lot
> indeed... and fixes my problems.

This page is quite recent, I wrote it only a couple of weeks ago.

> Appart from that I had figured most of this out, or buildroot was taking
> care of it. I still have a remark: I don't think I can hardcode the
> value of HAVE_IB_GCC_ATOMIC_BUILTINS as suggested in
> https://lists.launchpad.net/maria-discuss/msg02911.html because if I
> want this package accepted in buildroot it must build on all kind of
> architectures. Therefore:
> 
> 1. I disabled building xtradb. I also had to patch
> storage/xtradb/CMakeLists.txt (patch attached) otherwise XTRADB_OK=0
> would abort the build even if the module is not requested.

good point. it's a bug.

https://mariadb.atlassian.net/browse/MDEV-8883

> 2. I patched storage/innobase/CMakeLists.txt (also attached) in order
> to use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS, which
> fails when cross compiling.

I'm not sure we can do that, some of those checks were
CHECK_C_SOURCE_COMPILES before and later changed to CHECK_C_SOURCE_RUNS
because compiling was not enough (in some corner cases).

I think doing CHECK_C_SOURCE_COMPILES in cross-compiling case and
CHECK_C_SOURCE_RUNS otherwise could be a reasonable compromise.

> I'd be happy to have your opinion on these patches.
> 
> However, I'm currently investigating whether or not the value of
> HAVE_IB_GCC_ATOMIC_BUILTINS could be guessed from that of
> BR2_ARCH_HAS_ATOMICS.

Please tell me whether it'll work
(or add a comment directly to MDEV-8883)

Regards,
Sergei


Follow ups

References