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

Re: packagers note: do not run ld directly



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


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