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

Support using cross-compiler #7922

Open
cpackham-atlnz opened this issue Jun 21, 2021 · 4 comments
Open

Support using cross-compiler #7922

cpackham-atlnz opened this issue Jun 21, 2021 · 4 comments
Labels
Triaged this issue has been triaged

Comments

@cpackham-atlnz
Copy link

Description

It seems to take a really long time to build for a different architecture. This appears to be because the cross-compilation is done by making use of the qemu-user-static support for running foreign binaries which is several orders of magnitude slower that using a cross-compiler.

Steps to reproduce the issue:

  1. make configure PLATFORM=marvell-armhf PLATFORM_ARCH=armhf
  2. make target/sonic-marvell-armhf.bin

Describe the results you received:

Build takes a really long time

Describe the results you expected:

Build time should be comparable to a native build

Output of show version:

N/A

Output of show techsupport:

N/A

Additional information you deem important (e.g. issue happens only occasionally):

It makes sense to be able to re-use the pre-built debian packages for the non-SONiC bits of the OS but things that are built from source should be able to make use of a cross-compiler.

@lguohan
Copy link
Collaborator

lguohan commented Jun 21, 2021

wander if you can fine a arm64 machine as the build environment?

@cpackham-atlnz
Copy link
Author

cpackham-atlnz commented Jun 21, 2021

I think arm64 -> armhf would still technically be a cross-build. There may be some speed-ups that qemu-user-static can do since the instruction sets are more compatible but it'd still be slower than apt install gcc-8-arm-linux-gnueabihf; export CROSS_COMPILE=arm-linux-gnueabihf-; make ...

@zhangyanzhao zhangyanzhao added the Triaged this issue has been triaged label Jun 23, 2021
@zhangyanzhao
Copy link
Collaborator

@xumia please take a look and evaluate

@xumia
Copy link
Collaborator

xumia commented Jun 23, 2021

@cpackham-atlnz , armhf can be built on arm64, should not a cross-build, it supports tests in the debian:armhf slave container. It takes time similar to amd64, about 5 hours, the same build takes 30+ hours using qemu. See armhf on arm64 build https://dev.azure.com/mssonic/build/_build/results?buildId=16912&view=results

See instruction: https://thegeeklab.de/posts/run-arm32-docker-daemon-on-arm64-servers/
Draft PR: #7731

For cross build, it is another approach to reduce the build time. We have several meetings for the topic, we need to disable tests and do some change to support the feature.

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

No branches or pull requests

4 participants