Don't use cross-compile GCC on 32-bit systems#541
Merged
ptitSeb merged 1 commit intoptitSeb:masterfrom Jan 5, 2022
Merged
Conversation
If the OS is not aarch64, then use the normal GCC. This allows compilation for work on devices like the RK3399 when running in a 32-bit chroot, instead of using a multilib setup.
|
Having the same issue when compiling from aatch64 inside armv7h container :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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=1because CMake tries to use a specific gcc binary (arm-linux-gnueabihf-gcc). To get around this, I modified the CMakeFile to only override theCMAKE_COMPILERvariable if CMake reports that it is running onaarch64.I used cmake_host_system_information for this, because the
CMAKE_HOST_SYSTEM_PROCESSORvariable 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=1in Manjaro aarch64 and verifying that CMake (for me) errors out because it can't findarm-linux-gnueabihf-gcccmake .. -DRK3399=1in my Arch Linux armv8l chroot and verifying that CMake worksPS, thanks for box86!