I want to call a code that uses 32-bit integers (and hence calls libraries compiled for 32-bit integers) from within an application that works primarily with 64-bit integers (and hence calls libraries compiled for 64-bit integers).
I want my 32-bit codes to call 32-bit library routines and my 64-bit codes to call 64-bit library routines.
I would like something like
g++ -shared --export-dynamic -o c32lib.so c32bit.o /usr/lib/libc-32.a ...
g++ -shared --export-dynamic -o c64lib.so c64bit.o /usr/lib/libc-64.a ...
g++ -o a.out main_routine_calls_c32bit_and_c64bit.o c32lib.so c64lib.so
It there any chance that I can make this work? Or am I out of my mind? I realize that the two libc.a libraries will have multiple identical entry points. I just hope that somehow these could be resolved when the .so files are created.