[MDEV-8883] more cross-compiling fixes Created: 2015-10-02  Updated: 2015-10-24  Resolved: 2015-10-23

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 10.0.22, 10.1.9

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Attachments: File mariadb-galera-02-fix_innodb_cmakelist.patch    
Issue Links:
Relates
relates to MDEV-9002 Build failure when crosscompiling for... Closed
Sprint: 10.0.22

 Description   

See patches from this thread

  1. XtraDB aborts compilation when it cannot be compiled (unsupported system), even if XtraDB is disabled from cmake command line.
  2. InnoDB relies on CHECK_C_SOURCE_RUNS which doesn't work when cross-compiling


 Comments   
Comment by Sylvain Raybaud [ 2015-10-14 ]

Hi

It seems BR2_ARCH_HAS_ATOMICS cannot be used, because for example on 32bits architectures some atomic operations may not be available even though BR2_ARCH_HAS_ATOMICS is set to true. Therefore your solution should be used.

However I just realised that CHECK_C_SOURCE_RUNS should never be invoked by this script in buildroot because it's enclosed in

IF(NOT CMAKE_CROSSCOMPILING)
[...]
ENDIF

(https://github.com/MariaDB/server/blob/10.1/storage/innobase/CMakeLists.txt, line #75).

Is -DCMAKE_CROSSCOMPILING supposed to passed when invoking cmake or is it supposed to be determined automatically?

Comment by Sergei Golubchik [ 2015-10-22 ]

I've fixed the "XtraDB not supported" error (it won't be issued if XtraDB is disabled).
Won't do anything about CHECK_C_SOURCE_RUNS because they're under IF(NOT CMAKE_CROSSCOMPILING).

According to https://cmake.org/cmake/help/v3.0/variable/CMAKE_CROSSCOMPILING.html the variable CMAKE_CROSSCOMPILING) is set by CMake automatically.

Comment by Sylvain Raybaud [ 2015-10-23 ]

Hi

Thanks for the fix!

When CMAKE_CROSSCOMPILING is set these tests are skipped indeed and HAVE_IB_GCC_ATOMIC_BUILTINS is not set. It triggers another build failure, at least when crosscompiling for arm in buildroot, that I've filed under MDEV-9002: https://mariadb.atlassian.net/browse/MDEV-9002

Cheers,

Sylvain

Comment by Sylvain Raybaud [ 2015-10-23 ]

I propose the attached patch (the idea of which was suggested by serg) to be able to automatically check for atomic intrinsics event when cross-compiling. mariadb-galera-02-fix_innodb_cmakelist.patch

Comment by Sergei Golubchik [ 2015-10-23 ]

Thanks, I've done that too (not your patch verbatim, but similar).

Generated at Thu Feb 08 07:30:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.