On 64 bit host I am trying to build shared libraries with -m32
option. Is it possible for these libraries to be linked with regular 64 bit libraries?
I
It's not possible to link 32 bit applications against 64 bit libraries and vice versa. The problem is that pointers and types in general can't be passed between them. Normally the workaround is to spawn a child process of the other size and use IPC to communicate with that process.
Think about it this way: If I have a C trivial function:
extern void foo(void*);
If it's in a 64bit library and I try and call it from a 32bit library where does the other half of the pointer come from?
Conversely if it's in a 32bit library and I call it from a 64bit application what happens to the other half of the pointer which I would have to lose to call it?