Skip to content
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

Don't use cross-compile GCC on 32-bit systems #541

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

asppsa
Copy link
Contributor

@asppsa asppsa commented Jan 5, 2022

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 the CMAKE_COMPILER variable if CMake reports that it is running on aarch64.

I used cmake_host_system_information for this, because the CMAKE_HOST_SYSTEM_PROCESSOR variable otherwise doesn't get set until after running project(), 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:

  • running cmake .. -DRK3399=1 in Manjaro aarch64 and verifying that CMake (for me) errors out because it can't find arm-linux-gnueabihf-gcc
  • running cmake .. -DRK3399=1 in my Arch Linux armv8l chroot and verifying that CMake works

PS, thanks for box86!

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.
@ptitSeb ptitSeb merged commit 77257e2 into ptitSeb:master Jan 5, 2022
@Shatur
Copy link

Shatur commented May 22, 2023

Having the same issue when compiling from aatch64 inside armv7h container :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants