Don't use cross-compile GCC on 32-bit systems #541
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I was trying to compile box86 on a on a RockPro64 in a a 32-bit (armv8l) Arch Linux chroot (the main OS is Manjaro, but I'm using a chroot because AFAIK there isn't an easy way to set up multilib/multiarch on Manjaro).
I ran into trouble if I used
-DRK3399=1
because CMake tries to use a specific gcc binary (arm-linux-gnueabihf-gcc
). To get around this, I modified the CMakeFile to only override theCMAKE_COMPILER
variable if CMake reports that it is running onaarch64
.I used cmake_host_system_information for this, because the
CMAKE_HOST_SYSTEM_PROCESSOR
variable otherwise doesn't get set until after runningproject()
, which seems too late.I was thinking it might even make sense to just do
if(_aarch64) ...
instead of checking all the various flags? If that makes sense, let me know and I can update this PR.I've tested this by:
cmake .. -DRK3399=1
in Manjaro aarch64 and verifying that CMake (for me) errors out because it can't findarm-linux-gnueabihf-gcc
cmake .. -DRK3399=1
in my Arch Linux armv8l chroot and verifying that CMake worksPS, thanks for box86!