Best way of compiling applications to run on older linux distros

Tom Quarendon tom.quarendon@teamwpc.co.uk
Tue Nov 4 17:41:00 GMT 2008


> but isn't it sufficient to copy ALL new libraries with which your application is dynamically linked 

That's what we'd hoped.
The problem seems to be with the change in the dynamic linker hash 
style. We write in C++, so we link to libstdc++. So we have to ship 
libstdc++ for this approach to work.
However if you build on a version of fedora later than about 5, the 
dynamic libraries are not compatible with eariler versions, unless you 
pass the --hash-style=sysv linker option. This is fine for our code, we 
can easily just configure that in our makefiles. The difficulty is that 
libstdc++ isn't built like that, so you can't ship the libstdc++ that 
comes is part of the compiler. It's not clear whether if I rebuilt gcc 
with perhaps CFLAGS=-Wl,--hash-style=sysv in the environment that would 
get me a gcc with a libstdc++ that was linked in a suitable way.

The version of glibc that you link to seems a critical issue as it 
sounds like it's not possible, or at least recommended, to upgrade 
glibc. I had hoped that I'd be able to pass a compiler option, or set a 
#define that limited the functions available in the header files, and 
thus restricted the version of glibc that was required. This is what I'd 
do on windows, or AIX. Can't find any documentation on how I'd do that 
in gcc though, but I'm probably just missing something.

Doesn't seem that simple though.


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________



More information about the Gcc-help mailing list