I have googled this problem, some answers declared that WSL 2 now supports ELF 32 program.
However, a simple test on wsl2 Debian/Ubuntu distro was not passed.
Here is my test:
// install run-time
sudo dpkg --add-architecture i386
sudo apt-get update
// install build tools
sudo apt install build-essential
sudo apt install gcc-multilib
// build
gcc helloworld.c -m32
// run!
./a.out
bash: ./a.out: cannot execute binary file: Exec format error
refers:
https://stackoverflow.com/questions/42120938/exec-format-error-32-bit-executable-windows-subsystem-for-linux
https://superuser.com/questions/1407730/run-32-bit-application-on-ubuntu-on-windows-subsystem-for-linux/1407818#1407818
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…