Ok - thanks.

For #1, if I build with --static, then no libraries can be linked in dynamically at runtime... I need to do this for some custom Qt libraries and plugins, so I can't just make a completely static executable. This is unfortunate - the resulting binaries would be big, but they'd work on any distro.

#2 - I'd never heard of LSB or lsbcc... I've just done a google and turned up an article on an IBM website on building binary-compatible Linux applications... Thanks for the pointer on this one - it looks like this may be the way to go.

Mark

----- Original Message ----- From: "Daniel Kegel" <[EMAIL PROTECTED]>
To: <gcc@gcc.gnu.org>; "Mark Cuss" <[EMAIL PROTECTED]>
Sent: Thursday, July 14, 2005 4:07 PM
Subject: How to make an application look somewhere other than /lib for ld-linux.so.2


"Mark Cuss" <[EMAIL PROTECTED]> wrote:
I'm trying to get myself a group of libraries that I can distribute with my program so that they'll run on any distro.
> I run into problems all the time when different distros have different > versions of system libraries like libstdc++, libgcc, libc, etc.
...
Is there a way to somehow configure gcc build executables that look elsewhere for ld-linux.so.2, or is what I'm trying to do simply not possible? I'd really like to have a set of libraries with my program so that it's binary compatible with other distros... there must be a way. If anyone has any tips or advice I'd appreciate it.

There are two official ways to go:

1) Build static binaries.  (If your apps use libnss*.a, you may want to
   configure your toolchain's glibc with --enable-static-nss; I'm
   doing that now for one project.  Don't tell drepper.)
2) Build your apps with lsbcc.  That will link to the LSB's
   frozen version of libstdc++, etc.

#1 is doable right now.  #2 is, too, but requires your users to
install your distro's LSB runtime package.

- Dan




Reply via email to