Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: asm() using incorrect assembler for amd64 architecture #2510

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

CuB3y0nd
Copy link

I cannot find something like i386-elf-as, such as x86_64-elf-as, but amd64 should just use as for the default assembler. This could fix #2509.

@Arusekk
Copy link
Member

Arusekk commented Jan 7, 2025

Thanks for the fix! Although it might work for you, I have some feedback.

x:x mapping is already considered, so this change is wrong (better drop i386 if so). There are some systems where i386-*-as speaks amd64 as well as x86. The thing is as should be tried before it, because there might be some broken setup. Please try to adjust the search logic to consider the ordering.

Does your system have *86*64*-*-as anywhere in PATH (there are many places)? If I understand correctly, it does it have as but no native as with explicit name; I had no idea this was possible, please check this, as it seems very unlikely.

@Arusekk
Copy link
Member

Arusekk commented Jan 7, 2025

(Note that some people have a different host arch, like arm or riscv. Please do not assume that as is good for any particular arch by itself.)

@CuB3y0nd
Copy link
Author

CuB3y0nd commented Jan 7, 2025

Thanks for the fix! Although it might work for you, I have some feedback.

x:x mapping is already considered, so this change is wrong (better drop i386 if so). There are some systems where i386-*-as speaks amd64 as well as x86. The thing is as should be tried before it, because there might be some broken setup. Please try to adjust the search logic to consider the ordering.

Does your system have *86*64*-*-as anywhere in PATH (there are many places)? If I understand correctly, it does it have as but no native as with explicit name; I had no idea this was possible, please check this, as it seems very unlikely.

I found that Arch Linux does not provide *86*64*-*-as by default, but instead provides host architecture support via as. I had to manually install x86_64-elf-binutils and x86_64-elf-gcc via yay to get *86*64*-*-as. So i think this problem should not be solved by prioritizing *86*64*-*-as, if Arch Linux does not detect *86*64*-*-as, as should be used by default to provide amd64 support.

Or one could also assume that this problem is a matter of me not having the appropriate tools installed, maybe?

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
2 participants