简体   繁体   中英

Building 32 bit app on ubuntu and running it using a 64 bit lib

I need to build a 32 bit version of my program (no options to build it 64 bitly), but there is a certain lib (nvidia provided gles) that is of 64 bit. I wonder if there is a way to link the 32bit program against the 64 bit lib. Or if I can simply use the 64 bit lib with it. It's an nvidia tx1 with 64 bit kernel and userspace (latter used to be 32 bit but not anymore) running ubuntu 16.04 . I'm using arm-linux-gnueabihf-g++.

Thanks in advance :)

No, that simply cannot work. There are simply far too many problems for that to work.

A 64 bit kernel can work with 32 bits programs because the kernel doesn't trust programs anyway. Every argument is carefully checked and marshalled, which works for a small and fixed interface.

However, a compiler has no effective way to determine the exact API of a library. Is that char* an input argument, output or both? You need to know, in order to do the 32/64 marshalling. (And I'm ignoring efficiency here)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM