-
Notifications
You must be signed in to change notification settings - Fork 822
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
multilib ABIs don't work #711
Comments
Pretty sure this is because they are not supporting the 32-bit ABIs at all. They're only aiming for 64-bit compatibility, not legacy stuff. |
Fine, although x32 is not legacy. x86 is. |
@tycho -- curious -- did you encounter this because you were just playing around, or do you have examples of programs that depend on it? |
@aseering I develop programs against those ABIs and use it for servers. In the server context, I basically build any application that shouldn't reasonably consume more than 4GB of memory using the x32 ABI. This effectively caps its memory utilization. If an application leaks memory or is manipulated in some way to cause its memory usage to balloon too much, only the responsible process is killed by exhausting its own 4GB address space, instead of exhausting all of system memory and invoking the OOM killer which haphazardly kills arbitrary processes. There are other benefits of the ABI, but that's a pretty important one. One nice thing for Microsoft on this issue is that a big chunk of the hard work (compiler, linking, packaging) are already done. They just need to implement the kernel side of it. Obviously not an easy piece of work, but easier than owning the userspace side in addition to that... |
@tycho -- interesting; good to know about. I've had to deal with similar things, but have usually needed more control over the memory cap (more than 4gb or much less than 4gb) so have used |
I thought that most (desktop) Linux distros announced x86-32 support as legacy before 2015. |
@fpqc -- you're correct. But x32 != x86_32. I have seen x32 is kind of a specialty/niche tool in the past (though it sounds like there are more use cases for it): It has the benefits of most of the new 64-bit instruction set without the overhead of larger pointers. |
I got this problem when cross-compile luajit with mingw for 32bit |
I also see this issue. This is a show stopper for me. The issue is not only with this toolchain - I cannot run ANY 32-bit application which runs OK under Ubuntu on virtual machine After trying to fix this issue for 2 days I finally gave up, installed Virtual Box and compile my project under Ubuntu on Virtual Machine. Hope this will be fixed. |
@yuri-vashchenko -- thanks for posting your experience. Just for your and others' information, the current expected behavior is that no 32-bit binaries will execute at all. That functionality is entirely absent in the current release, as far as I know. That's obviously a major limitation for applications that need it. If it's something that you'd like, feel free to vote for it in the UserVoice forum: |
Thank you @aseering . voted |
It is almost possible to get this working in a cheaty way via qemu-user on a Debian WSL install, but there are some problems with that (#2620). Obviously slow-as-balls userspace emulation would be far less desirable than native execution, though. |
iirc, once qemu caches the JIT code, execution is full-speed because x64 emulation of x86 doesn't change the code that much. |
"full speed" is kind of a misnomer, given that the JIT isn't very smart about the code it emits. |
One final possibility, would be a compile or link (or multilib) option, that did the same job as -mx32 but also put in a 32<->64 bit translation layer (shim ?) for system calls, thus ensuring the binary as seen from the OS was wholly 64-bit. This would finally allow mx32-style programs to run under WSL. |
This issue seems to be fixed by WSL2, since the Microsoft-vended WSL2 kernel supports the other ABIs:
And output from the test case shows it executes fine:
|
Please use the following bug reporting template to help produce actionable and reproducible issues:
A brief description
The two non-primary ABIs supported by Ubuntu are not functional under the Linux subsystem:
gcc -m32
.gcc -mx32
. More info about the ABI here and here.Expected results
Applications built against the two ABIs should run.
Actual results (with terminal output if applicable)
Your Windows build number
14393.10
Required packages and commands to install
The
gcc-multilib
package is sufficient to get started building i386 and x32 test applications.The text was updated successfully, but these errors were encountered: