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

arm64 issue when compiling on M1 #59

Open
bvoq opened this issue Nov 3, 2022 · 4 comments
Open

arm64 issue when compiling on M1 #59

bvoq opened this issue Nov 3, 2022 · 4 comments

Comments

@bvoq
Copy link

bvoq commented Nov 3, 2022

Hi, I've created a Dockerfile to reproduce this issue and you can find it here: https://github.com/bvoq/FlutterMetaDockerfile/tree/main/fluttergcc11wayland
You only need Docker installed and you can run build.sh and the rest should be taken care of.

The code runs successfully on an older Mac with x86_64 architecture but not on arm64 Macs.
The reason is that gcc-multilib is not supported for arm64 architecture.
Installing just g++-11 and gcc-11 separately leads to the following issue:

My build platform is aarch64-linux, since I'm using M1 Mac with Docker.
Failing build configuration:

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "aarch64-linux"
NATIVELSBSTRING      = "ubuntu-22.04"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "qemuarm64"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.4"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa57"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "<unknown>:<unknown>"
meta-clang           = "kirkstone:c728c3f9168c8a4ed05163a51dd48ca1ad8ac21d"
meta-flutter         = "main:3c6ba93ad2de2ae1d9c71a9b34c55fc93d8ef024"
@bvoq bvoq changed the title GOMA issue when building testgl / GOMA issue when building Nov 3, 2022
@bvoq bvoq changed the title testgl / GOMA issue when building arm64 issue when compiling on M1 Nov 4, 2022
@HidenoriMatsubayashi
Copy link
Contributor

HidenoriMatsubayashi commented Nov 4, 2022

Thanks for the issue, but I have never tried to build flutter/engine on aarch64 machines. I'm not sure flutter/engine builds are supported on aarch64 arch.

https://github.com/sony/flutter-embedded-linux/wiki/Building-Flutter-Engine-from-source shows how to build on x64 CPUs basically.

@bvoq
Copy link
Author

bvoq commented Nov 6, 2022

Ok I have more info regarding this.
The main issue is that gcc-multilib is not supported by arm64 and it is not sufficient to install just gcc-11 and g++11.
image

You can simulate x86_64 architecture on Docker on M1 MacBooks but you will into the known inotify issue, described here:
https://docs.docker.com/desktop/mac/apple-silicon/

Maybe the code would have to be refactored with clang support to support arm?
Anyways, I'm happy with my working version on x86_64, thanks!

@HidenoriMatsubayashi
Copy link
Contributor

Maybe the code would have to be refactored with clang support to support arm?

What do you mean? meta-flutter doesn't require GCC, it just uses only clang.

@bvoq
Copy link
Author

bvoq commented Nov 6, 2022

What do you mean? meta-flutter doesn't require GCC, it just uses only clang.

hmm maybe yocto then? because gcc-multilib is a requirement for yocto. It might however be another issue related to arm64.

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

No branches or pull requests

2 participants