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

Detect x32 userspace ABI on 64-bit kernel #217

Open
pradyunsg opened this issue Oct 4, 2019 · 6 comments
Open

Detect x32 userspace ABI on 64-bit kernel #217

pradyunsg opened this issue Oct 4, 2019 · 6 comments

Comments

@pradyunsg
Copy link
Member

Given pypa/pip#6908, do we want to put try to get this into pypa/packaging instead?

Originally posted by @chrahunt in pypa/pip#5391 (comment)

This would be a fix related to pypa/pip#4962.

@pradyunsg
Copy link
Member Author

Is this still relevant?

@uranusjr
Copy link
Member

I believe so. packaging.tags still assumes i686 when a 32-bit interpreter is run on a 64-bit platform.

packaging/packaging/tags.py

Lines 419 to 423 in 5984e3b

if is_32bit:
if linux == "linux_x86_64":
linux = "linux_i686"
elif linux == "linux_aarch64":
linux = "linux_armv7l"

@ehashman
Copy link
Member

FWIW I think the right way to do this (back when I was working on a fix) was to look at whatever ELF interpreter Python was called with and use that to pick the arch. This would require parsing the Python ELF...

@uranusjr
Copy link
Member

We are already parsing ELF for both manylinux and musllinux detection so why not :p

@uranusjr
Copy link
Member

How do we start building this? Parsing the ELF is the easy part, but making sense of the data requires more research. Is there a list of machine and ABI information of common platforms available?

@ehashman
Copy link
Member

https://wiki.debian.org/X32Port#Detecting_X32 is the official answer, I think.

The unofficial answer I was going for is looking at the path of the ELF interpreter Python was built with. On an x32 system, there should always be x32 (rather than i386) in the path... either it's in /libx32 or symlinks to something with x32 in the filename in /lib. Hacky but probably reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants