-
Notifications
You must be signed in to change notification settings - Fork 278
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
Ported Marvell armhf build on amd64 host for debian buster to use cross-comp… #852
Conversation
python/setup.py.in
Outdated
@@ -3,7 +3,11 @@ from distutils.command.build_ext import build_ext | |||
from distutils.sysconfig import customize_compiler | |||
import os | |||
|
|||
os.environ["CC"] = "g++" | |||
if "CROSS_BUILD_ENVIRON" in os.environ and os.environ["CROSS_BUILD_ENVIRON"] == "y": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please refer to my comment opencomputeproject/SAI#1267 (comment)
…ilation instead of qemu emulation Signed-off-by: marvell <marvell@cpss-build3.marvell.com>
@@ -79,7 +79,11 @@ AC_ARG_ENABLE(redis-test, | |||
esac],[rtest=false]) | |||
AM_CONDITIONAL(RTEST, test x$rtest = xtrue) | |||
|
|||
AM_CONDITIONAL(ARCH64, test `getconf LONG_BIT` = "64") | |||
if test x$CONFIGURED_ARCH = xarmhf && test x$CROSS_BUILD_ENVIRON = xy; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this one ? CROSS_BUILD_ENVIRON ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know exactly how to fix it. We can't run getconf on host machine to determine ARCH64 of the target machine. Do you want me to pass ARCH64 env. variable and check if it is already defined then do nothing otherwise test getconf ? Any other suggestion ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not that familiar with proper way to pass cross compiling flags and whether that approach will be suitable for sonic, are you the only one working on this? maybe this would require some broader audience ?
i found this example for kernel https://www.centennialsoftwaresolutions.com/post/stop-typing-make-arch-arm-cross_compile-arm-linux-gnueabi-o-when-building-the-linux-kernel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working alone, but Antony Rheneus is helping me. What specifically is not good in the current confugure.ac code ? That CONFIGURED_ARCH and CROSS_BUILD_ENVIRON variables from Sonic are exposed ? That it is not generic solution for cross-compilation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing wrong, just wondering that there should be already established some common way to crosscompile in makefiles
…ilation instead of qemu emulation (sonic-net#852) Current armhf Sonic build on amd64 host uses qemu emulation. Due to the nature of the emulation it takes a very long time, about 22-24 hours to complete the build. The change I did to improve the building time ports Sonic armhf build on amd64 host for Marvell platform for debian buster to use cross-compilation on arm64 host for armhf target. The overall Sonic armhf building time using cross-compilation is about 6 hours. The Sonic configure and build for the armhf cross-compilation is as following: NOJESSIE=1 NOSTRETCH=1 BLDENV=buster CROSS_BLDENV=1 make configure PLATFORM=marvell-armhf PLATFORM_ARCH=armhf NOJESSIE=1 NOSTRETCH=1 BLDENV=buster CROSS_BLDENV=1 make target/sonic-marvell-armhf.bin Sonic module should check if $CROSS_BUILD_ENVIRON is 'y' to make sure that it is cross-compilation build.
…ilation instead of qemu emulation
…ilation instead of qemu emulation
Motivation:
Current armhf Sonic build on amd64 host uses qemu emulation. Due to the nature of the emulation it takes a very long time, about 22-24 hours to complete the build. The change I did to improve the building time ports Sonic armhf build on amd64 host for Marvell platform for debian buster to use cross-compilation on arm64 host for armhf target. The overall Sonic armhf building time using cross-compilation is about 6 hours.
The Sonic configure and build for the armhf cross-compilation is as following:
NOJESSIE=1 NOSTRETCH=1 BLDENV=buster CROSS_BLDENV=1 make configure PLATFORM=marvell-armhf PLATFORM_ARCH=armhf
NOJESSIE=1 NOSTRETCH=1 BLDENV=buster CROSS_BLDENV=1 make target/sonic-marvell-armhf.bin
Sonic module should check if $CROSS_BUILD_ENVIRON is 'y' to make sure that it is cross-compilation build.