Re: Static linking considered harmful

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 22, 2006 at 11:39:35AM +0100, Patrice Dumas wrote:
> On Wed, Nov 22, 2006 at 11:34:14AM +0100, Arjan van de Ven wrote:
> > 
> > actually static linking DECREASES that portability !!
> 
> Are you saying that you can compile a program dynamically and run it
> on old redhat, centos, old debian, mandrake and fedora core boxes?
> I tried, it fails, while statically linked programs are fine (at least 
> numerical models).

Yes and no.

Assuming if you link statically on very recent distro that your program
will work on any old Linux distro is just very bad assumption.
E.g. each glibc is configured for some minimal kernel version, if you
attempt to run the program on older kernel some functions will crash,
misbehave or the program won't start at all.  E.g. FC5+ glibc is
configured for 2.6.9 and later kernels, so running it on say FC1
just isn't going to fly.

If you want to create a program that will work on older distributions
(within reasonable limits, e.g. glibc 2.0 or libc5 or a.out stuff
isn't supported anymore in recent FCs), just compile/link against
the oldest glibc etc. you want to support, whether by installing
an old distro in the chroot or by installing and linking against
something like compat-glibc (these days only present in RHEL,
but could very well be revived for FC as well), using compat-gcc
(on FC6 that has e.g. a side-effect of using -Wl,--hash-style=sysv
etc.).

	Jakub

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux