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 and warn about x32 #2622

Merged
merged 1 commit into from
Dec 31, 2020
Merged

Detect and warn about x32 #2622

merged 1 commit into from
Dec 31, 2020

Conversation

nabijaczleweli
Copy link
Contributor

Error message wrapped to eighty columns

@kinnison
Copy link
Contributor

This change looks interesting, thank you for putting the effort in.

Can you suggest an easy way for me to install an x32 system in a VM so that I can test this? Is there a distro you suggest for this?

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Dec 28, 2020

As far as a VM goes, I suggest following this post for doing a x32 installation of Debian, which AFAIK is the only distribution that supports the ABI for the whole userland.

However, a chroot with a procfs mount should work just as well (but you'll need your host kernel to understand x32; if you're on Debian you'll need to boot with syscall.x32=y, if on Gentoo, it should Just Work with default config).

Something like

debootstrap --arch=x32 --variant=minbase --include=debian-ports-archive-keyring --no-check-gpg sid sid-x32/ https://deb.debian.org/debian-ports
mount --bind /proc/ sid-x32/proc/
chroot sid-x32/

should give you a bare-bones x32 userland.

(Technically all you need is an x32 head(1), but that's more of a main in the arse than is worth.)

@kinnison
Copy link
Contributor

I read through those instructions but don't feel comfortable messing around with debootstrap etc. I'm fairly confident that this will work, having reread the shell so I'm going to merge this providing you can confirm you've tried the updated shell script on all of:

  1. x86_64 with 64bit userland (should be entirely unaffected)
  2. x86_64 with real 32bit userland (should be fine by your else clause)
  3. x86_64 with x32 userland (I assume you've tested this already since otherwise you wouldn't have submitted the patch)

Are you able to confirm all of those are good with your change? Sorry I can't get local testing set up but I'm in and out of Windows right now and don't have the time/space to do it.

@nabijaczleweli
Copy link
Contributor Author

As far as I can tell, yes, all of those end up with the right cputype.

@kinnison
Copy link
Contributor

Fantastic, thank you!

@kinnison kinnison merged commit ecd6cb3 into rust-lang:master Dec 31, 2020
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.

2 participants