Help with multiarch i386 on x86_64 system (x32 legacy arch compatibility missing.)

I have two x86_64 systems with UM 22.04.3.

One started at 14.04 and has been upgrade all the way to 22.04 the other is a fresh install.

The upgrade system did have multiarch support for i386 installed and working but within the last year that has stopped working. I stopped work on my Tandy Color Computer cross development for just one year and come back and find this :pensive:

The fresh install also doesn't run any of the previous 32 bit executables.

My systems show :

dpkg --print-foreign-architectures 
i386
apt list --installed 'libc6*'
Listing... Done
libc6-dbg/jammy-updates,jammy-security,now 2.35-0ubuntu3.6 amd64 [installed,automatic]
libc6-dev-i386-cross/jammy,jammy,now 2.35-0ubuntu1cross3 all [installed,automatic]
libc6-dev/jammy-updates,jammy-security,now 2.35-0ubuntu3.6 amd64 [installed,automatic]
libc6-dev/jammy-updates,jammy-security,now 2.35-0ubuntu3.6 i386 [installed,automatic]
libc6-i386-cross/jammy,jammy,now 2.35-0ubuntu1cross3 all [installed,automatic]
libc6-x32/jammy-updates,jammy-security,now 2.35-0ubuntu3.6 amd64 [installed]
libc6/jammy-updates,jammy-security,now 2.35-0ubuntu3.6 amd64 [installed,automatic]
libc6/jammy-updates,jammy-security,now 2.35-0ubuntu3.6 i386 [installed]
file ./dcc
./dcc: ELF 32-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=f013fd779c051af94c5c89349cabbb6f3b279379, for GNU/Linux 3.4.0, with debug_info, not stripped
ls -l /libx32/ld-linux-x32.so.2
-rwxr-xr-x 1 root root 225864 Jan  2 21:22 /libx32/ld-linux-x32.so.2
readelf -d ./dcc | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
ls -l /libx32/libc.so.6
-rwxr-xr-x 1 root root 2280756 Jan  2 21:22 /libx32/libc.so.6

So everything that is require seems to be present but it no longer works on either the upgraded system or the fresh install.

I can't seem to find official Ubuntu (Mate) documentation for MultiArch so I'm not sure what I'm missing or what to diagnose check.

Might help if I show the error:

./dcc
bash: ./dcc: cannot execute binary file: Exec format error

Or if I try manually:

/libx32/ld-linux-x32.so.2 ./dcc
./dcc: error while loading shared libraries: ./dcc: cannot open shared object file: No such file or directory
cat /etc/ld.so.conf.d/*.conf
/usr/lib/x86_64-linux-gnu/libfakeroot
# Multiarch support
/usr/local/lib/i386-linux-gnu
/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu
/usr/local/lib/i686-linux-gnu       <-- doesn't exist
/lib/i686-linux-gnu                 <-- doesn't exist
/usr/lib/i686-linux-gnu             <-- doesn't exist
# libc default configuration
/usr/local/lib
# Multiarch support
/usr/local/lib/x86_64-linux-gnu     <-- doesn't exist
/lib/x86_64-linux-gnu               <-- doesn't exist
/usr/lib/x86_64-linux-gnu
# Legacy biarch compatibility support
/lib32
/usr/lib32
# Legacy biarch compatibility support
/libx32
/usr/libx32

And I have a fresh install of Armbian X64 which can run the 32 executables that were compiled on the Ubuntu Mate system. Eliminating the 32 bit binaries have somehow become corrupted.

Any ideas?

Not sure about this but I think the problem may be a mismatch in arch naming between what it was and what it is now.

If i do this :

arch-test
amd64
i386
elf-arch ./dcc
x32

There is a difference between i386 and x32 which is probably why I get this when attempting to run:

./dcc
bash: ./dcc: cannot execute binary file: Exec format error

On my working Armbian X64 system test-arch also lists x32 !!!!!!

arch-test
amd64
i386
x32

I found the issue. x32 has been removed from Ubuntu Mate. Now to to check vanilla Ubuntu.

Update :

Vanilla Ubuntu is the same.

Next question at what version version/update did this occur.

Update :

Works on Focal 20.04.6. All I had to do to get it get it going was install libc6-x32.

So that confirms bi-arch x32 support has been broken or dropped.

I down graded my Ubuntu Mate 22.04 kernel from 6.5 to 5.15 and I now have 32 binaries working again.

When I issue the command arch-test on the 515 kernel it includes "x32" but not on the 6.5 kernel.

I wonder if this is intentional. If not maybe somebody should be informed. But who?

How should I raise this?

Hi, @Walter_ZAMBOTTI :slight_smile:

(Usual disclaimer: please note that I'm just another Forum user here. I'm NOT an Ubuntu Developer and/or Ubuntu MATE Developer and/or MATE Developer).

You wrote:

I'm afraid that I have some bad news :frowning: I've found a related Bug in Launchpad for "https://launchpad.net/ubuntu/+source/linux" - "Bug #1994516 “Kernels after 5.16 cannot execute x32-ABI binaries” : Bugs : linux package : Ubuntu" - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1994516 - that was opened/reported, on October 2022 by Sven Hartrumpf - but, as I'll explain later in this reply of mine, that Bug has been marked as "Won't Fix" - and that I believe answers your question:

In that bug, there's a comment - "https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1994516/comments/21" - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1994516/comments/21 - posted on 24th April 2023, by Dimitri John Ledkov (xnox) who, in LinkedIn, appears as being a "Staff Software Engineer" working for "Canonical" - "Dimitri John Ledkov - Staff Software Engineer - Chainguard | LinkedIn" - that marks that Bug as "Won't Fix" with the following explanation:

Comment 21 for bug 1994516

Dimitri John Ledkov (xnox) wrote on 2023-04-24: #21

"Hi Sven & doko,

Nice to hear from you Sven again, you always pop-up on x32 kernel mailing lists threads, great to hear you use Ubuntu.

Debian also has ports that provide x32 binaries, whereas Ubuntu doesn't. We did do preliminary work to enable x32 over sixteen years ago in gutsy, but since then no demand has materialised to actually ever support this. It is probably a mistake and oversight that we have kept this config option on for so long; and continue to have portions of toolchain available too (triarch). From the investigations I did, it appears this config was dropped as part of the kernel config review, when a few other obsolete execution formats were dropped. Note that no ubuntu certification, tooling, or assertions enforce or test x32 binaries on ubuntu kernels, and imho shouldn't gonig forward. I spoke to a few people about this, and consenus infofar is this opens an attack vector even when simply complied in and not enabled at runtime. Other distributions also do not have this on (fedora, suse). I will use this bug report, to document that x32 should be off and not turned back on. If you use 22.04 LTS you can use linux-generic (v5.15) based kernel, which will continue to have existing config as is. Or alternatively you can build your own kernel, or use Debian one."

tags: added: rls-kk-notfixing rls-ll-notfixing
removed: rls-kk-incoming rls-ll-incoming
Changed in linux (Ubuntu):
status: Confirmed → Won't Fix

2 Likes