packagers note: do not run ld directly
Tom "spot" Callaway
tcallawa at redhat.com
Wed Aug 8 20:04:25 UTC 2007
On Wed, 2007-08-08 at 12:46 -0700, Roland McGrath wrote:
> An easy mistake sometimes made in packages' build setup is to run ld
> directly rather than via gcc, e.g. when creating a shared library.
> It is always wrong to run ld directly when a linking user-mode
> executable or shared library. This rule is not Fedora-specific, so
> be sure to get the makefile fixes upstream.
>
> e.g. a makefile line:
>
> $(LD) -shared -o $@ $(objs)
>
> should be:
>
> $(CC) -shared -o $@ $(objs)
>
> Best practice is to use consistently the flags otherwise passed to
> the compiler, and also use LDFLAGS, i.e.:
>
> $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $(objs)
This fix will also fix sparc64, we've been sending patches to fix this
upstream for some time now (but only for core libs).
~spot
More information about the devel
mailing list