64 bits hardware platform support both 32 bits and 64 bits application

Does 64 bits hardware OpenWrt platform compile 32 bits and 64 bits toolchains to support 32 bits and 64 bits application? Now I only can build toolchain with pefix aarch64-openwrt-xx. if so, how can do it? Thanks

the specific requirement is, I have a 32 bits applicaiton, how can I compile it and run on 64 bits OpenWrt system? Does OpenWrt support it? Thanks

Usually, compiling is done on a PC using Cross-Compiling, not on OpenWrt devices themselves. Most devices do not have enough resources to compile software.

If you have the source code, how is your application 32-bits?

It's not even compiled...just compile it for the device you're using - using the available SDK/toolchain.

See: https://openwrt.org/docs/guide-developer/crosscompile

hi Ileachii,

Thanks. I have built the OpenWrt toolchain with prefix aarch64-openwrt-xx. this toolchain has no problem to compile the application with 64 bits supported. Now, there is an only 32 bits supported application, how can I generate one 32 bits cross compile OpenWrt toolchain to compile this application? the issue is like 32 bits application can run 64 bits system on Ubuntu platform. Does OpenWrt also can support like Ubuntu? if so, how can I generate cross compile toolchain with 32 bits compatible?

Please explain how uncompiled source code is either 32 or 64 bit?

Uncompiled code is obviously not 32 or 64 bits, but some code is not prepared to be compiled as 64 bits, and works only when compiled as 32 bits.

1 Like

I'm not certain you can cross compile (since there are no cross libraries); but you should be able to compile and use a 32-bit version of OpenWrt (and hence, compile your software).

http://downloads.openwrt.org/releases/18.06.1/targets/x86/legacy/openwrt-sdk-18.06.1-x86-legacy_gcc-7.3.0_musl.Linux-x86_64.tar.xz