tests: Add --cross {ARCH} convenience flag#1747
Draft
hanno-becker wants to merge 1 commit into
Draft
Conversation
Add a --cross {ARCH} flag to scripts/tests that expands into the
--cross-prefix, --cflags, --ldflags and --exec-wrapper settings for a
given cross target, so local cross-compilation no longer requires
remembering toolchain prefixes, MLK_FORCE_* defines and QEMU wrappers.
The presets (x86_64, aarch64, aarch64_be, ppc64le, riscv64, riscv32)
mirror the per-arch settings in .github/actions/multi-functest, and are
meant to be run inside the matching `nix develop .#cross-{ARCH}` shell.
Explicit flags still win: cflags/ldflags are appended after the user's
value, while cross-prefix and exec-wrapper are only set when unset (a
conflicting explicit cross-prefix is an error). A non-fatal warning is
printed when the cross toolchain is not on PATH, or when --no-auto would
drop the ISA feature flags that the Makefile otherwise adds.
BUILDING.md documents the flag and lists the per-target defaults.
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
Contributor
Author
|
@mkannwischer This has annoyed me for a while, but the present proposal is not yet ideal because it does not yet cover the baremetal platforms. One could perhaps have |
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.
Add a --cross {ARCH} flag to scripts/tests that expands into the --cross-prefix, --cflags, --ldflags and --exec-wrapper settings for a given cross target, so local cross-compilation no longer requires remembering toolchain prefixes, MLK_FORCE_* defines and QEMU wrappers.
The presets (x86_64, aarch64, aarch64_be, ppc64le, riscv64, riscv32) mirror the per-arch settings in .github/actions/multi-functest, and are meant to be run inside the matching
nix develop .#cross-{ARCH}shell. Explicit flags still win: cflags/ldflags are appended after the user's value, while cross-prefix and exec-wrapper are only set when unset (a conflicting explicit cross-prefix is an error). A non-fatal warning is printed when the cross toolchain is not on PATH, or when --no-auto would drop the ISA feature flags that the Makefile otherwise adds.For now, no attempt is made to use this in CI.
BUILDING.md documents the flag and lists the per-target defaults.