Support CC_FOR_BUILD for cross-compilation#484
Open
chrisburr wants to merge 1 commit intobellard:masterfrom
Open
Support CC_FOR_BUILD for cross-compilation#484chrisburr wants to merge 1 commit intobellard:masterfrom
chrisburr wants to merge 1 commit intobellard:masterfrom
Conversation
Add support for cross-compilation environments that set CC_FOR_BUILD to specify the build machine compiler. This complements the existing CROSS_PREFIX approach and enables building host-qjsc with the native compiler when CC targets a different architecture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for cross-compilation environments that set
CC_FOR_BUILDto specify the build machine compiler, complementing the existingCROSS_PREFIXapproach.Motivation
When cross-compiling (e.g., building arm64 binaries on x86_64), the build needs to run
qjscto generaterepl.c. The currentCROSS_PREFIXmechanism works when the cross-compiler follows the<prefix>gccnaming convention, but many cross-compilation environments setCCdirectly and provideCC_FOR_BUILDfor the native compiler.Changes
CC_FOR_BUILDand buildhost-qjscusing the native compilerHOST_CFLAGSandHOST_LDFLAGSto avoid passing target-specific flags (like-mcpu=power8) to the host compilerqjscto generate target executables)Testing
Tested cross-compiling for osx-arm64 and linux-ppc64le from x86_64 build machines.