cross-compile s390x on x86_64 hosts #262
Merged
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.
This change enable us to compile s390x kernel/bpf samples/bpf selftests on x86_64 hosts, resulting in a 4x improvement in build time.
It piggy-backs on recent changes that passed the target arch to all actions.
matrix.py was modified to return a "build_run_on" field that indicate on what architecture to build. This returns the target arch except for s390x where it returns x86_64.
A small patch was added to force using the target version of bpftool when cross-compiling. This allows us to work around endianess quirks. We rely on the host having binfmt_misc support properly configured to run a binary for a foreign arch.
tar-artifact was also modified to find the location of the kernel image even when dealing with foreign arch.
I squeezed in upgrade to github actions v4 which were causing some deprecation messages, and also promise great improvments.