asm: try native binutils before fallback architectures #2669
+19
−9
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.
Some binutils builds support multiple architectures, like the x86_64 assembler supports i386 too in most package builds and vice versa. We support this by trying the other binutils as well when looking for the right tool. That support is optional though and there are packages that don't include the "cross" compilation.
When assembling for the host's native architecture, we still prefer the explicitly named
x86_64-linux-gnu-asinstead of the nativeasbinary. That native binary is tried as a last resort after looking for any other explictly named binary. If the fallback package is installed but compiled without the cross-compiler support, we'd still find thei386-asbinary while looking forx86_64-asbefore trying the nativeasbinary. That would fail to assemble.This patch moves the native
asbinary forward in the list to try it before checking the other fallback architecture ones.This is the suggested fix by @Arusekk in #2510 (comment) and supercedes the stalled PR #2558 by @CuB3y0nd.
Fixes #2509