install package/library for both 64-bit and 32-bit Linux systems
My HOME at a server is loaded into a local computer via NFS. My server is a 64-bit Linux while my local is a 32-bit Linux.
Is it true that: If I compiled my C/C++ program on 64-bit OS, then it can be linked to either 64-bit library or 32-bit library and if I compiled my program on 32-bit OS, then it can be linked only to 32-bit library, regardless static or shared library?
So if I want to build some C/C++ libraries from source under my HOME so that they can be linked to my program running on either my server or local, I have to build them on the 32-bit local but not on the 64-bit server?
What will the difference be if my program on the 64-bit server is linked to a 32-bit library compared to being linked to a 64-bit library? Is the former slower than the latter?
I installed emacs under my HOME on the 32-bit local and it can be run on both 32-bit local and 64-bit server. I used ldd to see what shared libraries it is linked to. The output is different on the local side and on the server side. There is one more .so file for the server than for my local. For the rest common 20 .so files, the numbers I assume to be addresses are different, e.g.on the server:
and on my local:
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x00d26000)
Is it true that each of these .so files each has two parts inside itself: one for 32-bit local and one for 64-bit server, which can be linked to using different addresses? How can I build C/C++ libraries so that the .so files can act like that?
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x00a46000)
Thanks and regards!