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 assembly for x32 ABI #438

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

Conversation

abatyiev
Copy link

@abatyiev abatyiev commented Jan 3, 2025

The x32 ABI is special ABI for long mode on x64, that uses 32 bit integers and pointers instead of 64 bit. This patch fixes assembly code for x32 ABI.

See https://bugs.gentoo.org/942562
https://wiki.debian.org/X32Port

@oconnor663 oconnor663 requested a review from sneves January 3, 2025 19:45
@sneves
Copy link
Collaborator

sneves commented Feb 10, 2025

I'll be honest, I thought x32 had been deprecated years ago. Is this something popular enough to warrant support?

@abatyiev
Copy link
Author

Gentoo does support it and I'm using it.
The problem for me is that mesa uses BLAKE3 now and therefore I need a fix here.

@oconnor663
Copy link
Member

What would be our options for CI testing this? Apart from what GH Actions provides directly, we use QEMU via cross-rs to test esoteric architectures (big endian etc.), but it doesn't look like cross-rs supports x32.

@abatyiev
Copy link
Author

It seems like you are using Ubuntu: it has x32 support in regular x86_64 releases. (There are packages like gcc-13-x86-64-linux-gnux32, libc6-x32, binutils-x86-64-linux-gnux32 etc). One way to provide correct compiler for the build system is to use CMake's toolchain file ( https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html

Basically you need a regular amd64 kernel with CONFIG_X86_X32=y and a toolchain. Regular amd64 ABI and x32 ABI can coexist (together with i686 ABI) on the same machine.

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.

3 participants