libct/dmz: Support compiling on all arches #4076
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 should make compilation work on all arches, doesn't matter if nolibc is supported there or not. If it is not supported, we just use the C stdlib.
Please review the
NOLIBC_GOARCHES
var, as that should have the GOARCH values that nolibc support. If we have a mistake there (i.e. put an arch that is not supported), compilation will fail on that arch.I tried to be conservative on the arches to put there, but not just limit to the ones I can test (386 and amd64). Please review that part.
Fixes: #4037
cc @cyphar @AkihiroSuda
See below the commit msg.
When we added nolibc, we started using it unconditionally. But runc is currently being compiled on more arches than supported by nolibc, like MIPS.
Let's compile using stdlib if the arch we are compiling on is not supported by nolibc.
If compilation is broken in some arch, just removing it from the NOLIBC_GOARCHES variable should fix the compilation, as it will fallback to use the C stdlib.