Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

Ported Marvell armhf build on amd64 host for debian buster to use cross-comp… #80

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

gregshpit
Copy link
Contributor

…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.

@@ -48,12 +48,21 @@ go-deps-clean:
$(RM) -r vendor

sonic-telemetry: $(GO_DEPS)
ifeq ($(CROSS_BUILD_ENVIRON),y)
$(GO) build -o ${GOBIN}/telemetry -mod=vendor $(BLD_FLAGS) github.com/Azure/sonic-telemetry/telemetry
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between "go build -o ${GOBIN}/telemetry" and "go $(GO) install"?

Copy link
Contributor Author

@gregshpit gregshpit Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the build purpose these two commands are essentially the same. They both build the package and the result is placed in the same output directory. Somehow when cross-compiling "go install" command fails. So I replaced it with analogous build command that works fine.

@gregshpit
Copy link
Contributor Author

Dear reviewers,

Long time has passed since this PR was raised. Please make progress on the review.

Thanks,

Gregory

@gregshpit
Copy link
Contributor Author

Hi.

Can anyone review and merge this PR asap.
It was raised almost 4 months ago.
Thanks,

Gregory

@lguohan lguohan merged commit 64e516c into sonic-net:master Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants