WSL icon indicating copy to clipboard operation
WSL copied to clipboard

64-bit code with 32-bit pointers (-mx32) no longer working

Open harristomy opened this issue 6 months ago • 5 comments

Windows Version

Microsoft Windows [Version 10.0.22631.5335]

WSL Version

2.5.7.0

Are you using WSL 1 or WSL 2?

  • [x] WSL 2
  • [ ] WSL 1

Kernel Version

6.6.87.1-1

Distro Version

Ubuntu 24.04

Other Software

No response

Repro Steps

Write basic C program that is compiled with the -mx32 flag.

Expected Behavior

C Application built with -mx32 flag with either GCC or Clang fails to execute.

Actual Behavior

Image

Diagnostic Logs

No response

harristomy avatar May 28 '25 08:05 harristomy

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

github-actions[bot] avatar May 28 '25 08:05 github-actions[bot]

Previously enabled x32 abi support has now been disabled. https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-5.15.y/arch/x86/configs/config-wsl#L593 https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-6.6.y/arch/x86/configs/config-wsl#L691

0xbadfca11 avatar May 28 '25 10:05 0xbadfca11

Any idea why?

harristomy avatar May 28 '25 10:05 harristomy

@chessturo - can you please take a look?

benhillis avatar May 28 '25 16:05 benhillis

4d72cb5bb5d14e520500e84316a5b7e0f9e572cf was the commit that changed this, if it helps

harristomy avatar May 28 '25 21:05 harristomy

We're planning to fix this issue in the next kernel release. In the meantime, you can build a custom kernel with the config enabled as a workaround.

chessturo avatar Jun 02 '25 20:06 chessturo

Thanks @chessturo!

harristomy avatar Jun 02 '25 21:06 harristomy

Any idea why it was disabled for the previous kernel release?

harristomy avatar Jun 02 '25 21:06 harristomy

Since the item name has changed, make olddefconfig has probably reverted it to "not set" that the default value.

0xbadfca11 avatar Jun 04 '25 12:06 0xbadfca11