Skip to content

Conversation

@peace-maker
Copy link
Member

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-as instead of the native as binary. 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 the i386-as binary while looking for x86_64-as before trying the native as binary. That would fail to assemble.

This patch moves the native as binary 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

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-as`
instead of the native `as` binary. 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 the `i386-as` binary while looking for `x86_64-as`
before trying the native `as` binary.
That would fail to assemble.

This patch moves the native `as` binary forward in the list
to try it before checking the other fallback architecture ones.

Fixes Gallopsled#2509
@peace-maker peace-maker requested a review from Arusekk January 18, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asm() using the incorrect assembler for amd64 architecture

1 participant