0

I'm trying to setup a native Debian X32 virtual machine. Note that X32 is different than X86 and X64. For details, see Difference between x86, x32, and x64 architectures? on Stack Overflow. Some other distros, like Red Hat, offer a X32 build for servers.

Debian does not provide an X32 ISO. I have Debian 8.2 amd64 installed, and the kernel is booting into the 32-bit configuration:

$ dmesg | grep -i x32
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=69773d98-b9fa-4695-8392-92759d8e6094 ro syscall.x32=y syscall.x32=y quiet
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=69773d98-b9fa-4695-8392-92759d8e6094 ro syscall.x32=y syscall.x32=y quiet
[    0.316500] Enabled x32 syscalls

Debian's X32-port wiki tells me the next step is to setup a QEMU chroot. I want to avoid the QEMU chroot and turn this into a native X32 installation.

Question: How do I turn this installation into a native X32 installation?


Though I am booting the kernel configured for X32, the userland tools are not configured that way. For example, the compiler is probably most important to me, but its not configured for X32:

$ g++ -march=native -dM -E - </dev/null | egrep "(x86_64|amd64|ilp)"
#define __x86_64 1
#define __amd64 1
#define __x86_64__ 1
#define __amd64__ 1

I don't see ILP32 or __ILP32__, which I means I'm not in X32 mode. Changing -march=native to -mx32 makes no difference.


Here is the machine:

$ uname -a
Linux debian8-x32q 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

Here is my sources.list. But its not obvious what I should enable to get the X32 binaries rather than the X64 binaries:

deb http://ftp.us.debian.org/debian/ jessie main
deb-src http://ftp.us.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ jessie-updates main
deb-src http://ftp.us.debian.org/debian/ jessie-updates main

The following works:

$ sudo dpkg --add-architecture x32

But it breaks APT:

$ sudo apt-get update
Ign http://ftp.us.debian.org jessie InRelease
Hit http://ftp.us.debian.org jessie-updates InRelease 
Hit http://ftp.us.debian.org jessie Release.gpg                        
Hit http://ftp.us.debian.org jessie Release                            
Hit http://security.debian.org jessie/updates InRelease              
Hit http://ftp.us.debian.org jessie-updates/main Sources             
Get:1 http://ftp.us.debian.org jessie-updates/main amd64 Packages/DiffIndex [367 B]
Get:2 http://ftp.us.debian.org jessie/main Sources [7,058 kB]
Hit http://security.debian.org jessie/updates/main Sources
Hit http://security.debian.org jessie/updates/main amd64 Packages     
Hit http://ftp.us.debian.org jessie/main amd64 Packages 
Fetched 7,058 kB in 3s (2,066 kB/s)          
W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  Unable to find expected entry 'main/binary-x32/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ftp.us.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/binary-x32/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ftp.us.debian.org/debian/dists/jessie/Release  Unable to find expected entry 'main/binary-x32/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

If it matters, I SSH into the box. I don't care about window managers and other GUI programs that have not been ported. I basically need the kernel, base installation and build tools to be in X32 mode so I can test my software under X32.

2
  • 1
    en.wikipedia.org/wiki/X32_ABI leaving this link here since I got confused. bugs.debian.org/cgi-bin/… seems to suggest that some of the things you need to directly run x32 might not be supported yet, like a bootloader.
    – Journeyman Geek
    Feb 1, 2016 at 0:12
  • Thanks Journeyman. "x32 might not be supported yet, like a bootloader..." - OK, thanks. I'm not sure if this is a problem in practice because we can boot the kernel with syscall.x32=y. I've found its userland that is causing the pain, like the compiler.
    – jww
    Feb 1, 2016 at 0:18

0

You must log in to answer this question.

Browse other questions tagged .