How to enable 32 bit binary support on x86-64bit openwrt

Hello all,

How to enable 32 bit binary support on x86-64bit openwrt?
I have a x86-64 openwrt system. For some purpose, I want to compile x86-32 bit application and run on x86-64 openwrt system.

file InitMgr
InitMgr: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-i386.so.1, with debug_info, not stripped

InitMgr

bash: /usr/bin/InitMgr: No such file or directory

As I know, it's the problem of interpreter. On my x86-64 openwrt, it' only have /lib/ld-musl-x86_64.so.1 -> libc.so

Do you know how to enable to support to run 32 bit application on x86-64 openwrt?
Thank you very much!

1 Like

Hi @hemingt

have you found the solution?

I've got the same question. I'm using OpenWRT 21.02 x86_64 and couldn't find any options in menuconfig to get 32-bit binary support...

1 Like

afaik there is no multiarch support on OpenWrt.

I think you can make a chroot with a 32bit OpenWrt rootfs in it to run 32bit applications, see https://openwrt.org/docs/guide-user/services/chroot (and use an OpenWrt rootfs.tar.gz instead of Debian)

assuming the kernel has 32bit-in-64bit support enabled

OpenWrt's kernel does not enable this (why would it), you would have to build from source with adapted configurations.