New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cross-compile to consider CMAKE_CROSSCOMPILING_EMULATOR. #1805
Conversation
The first line of https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html indicates that this is only on when
Can you give an example of how to test |
Hello @grooverdan , The problem is following in IF NOT CMAKE_CROSSCOMPILING If CROSS_COMPILING IS TRUE THEN the values aren't set for example. But a cross_compiling_emulator works like a real machine, so it still needs it. So IF the emulator is defined then it should set the values even if CMAKE_CROSSCOMPILING is true. example: IF(NOT CMAKE_CROSSCOMPILING)
// code
ENDIF code is only executed if we don't have a crosscompiler here. after: IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
// code
ENDIF code is executed if we don't have a cross compiler or if we have one with a cross compiling emulator. But I tried it without DEFINED before and the cross-compiling-emulator did complain it. So DEFINED should be needed here. |
@grooverdan sorry had to edit the comment because I saw the problem during I wanted to refactor code :-) edit: I have done the patch for following PR in void linux void-linux/void-packages#30143 |
your void linux PR is aiming for 10.5. Did you want to target this for 10.5 so you don't need to carry the patch? on other carried patches: Any tips on using CMAKE_CROSSCOMPILING_EMULATOR welcome. Due to hardware/people contraints we miss things like MariaDB/mariadb-docker#318 and I hope this is a good enabler to facilitating more testing, even if emulated. |
thank you for your review on the void package @grooverdan I did try to remove the disable-failing-unit-patch and it seems to be fine so far. First I have to say that I don't belong to the void team. I am just contributing and hope to help them. Void is my favourite linux distribution. Edit: I know that XBPS is using chroot and qemu. Maybe @Johnnynator wants to join the discussion here. :-) |
Voids cross compile setup is just having a normal system that does all the heavy lifting usually at The normal cmake cross setup is just setting compiler and cflags as appropriate.
A setup like that would already allow to just run e.g. The usualy test suite can be run by just executing |
When CMAKE_CROSSCOMPILING_EMULATOR is defined, a cross-compile can be made, however with native (emulated) execution possible. This commit takes those points in the build system that execute built targets natively and allow these to be executed in a crosscompile if CMAKE_CROSSCOMPILING_EMULATOR is defined. Closes #1805
Thanks @Johnnynator. So it looks like to create a void-linux CI container I'd:
If one of you could point me at the https://build.voidlinux.org/ URL when your mariadb update goes through that might help fill in the gaps for me. Not sure when I'll get to filling that muslc/armv[567] and other gaps, but thanks for providing some parts that will significantly help the process. However @Veganizer, on your PR, 1715fef now merged to 10.5 with expanded commit message. Thank you very much, and thanks for updating Void LInux's package too. |
I do have just pushed it, but I doubt that you would see much interesting things in the logs.
More like armv[67] or armv5 support does not have any binary repo currently (and probably never will). |
@grooverdan Just wanted to inform you that the Update of MariaDB is in the official void repos now :-) |
Author: Justin Jagieniak justin@jagieniak.net, John Zimmermann me@johnnynator.dev
Date: Fri Apr 11 14:19:00 2021 +0200
Fix cross-compile patch to consider CMAKE_CROSSCOMPILING_EMULATOR aswell.