[nut-Bugs][312617] [patch] nut-2.4.3 fails to build with LDFLAGS="-Wl,--as-needed"

nut-bugs at alioth.debian.org nut-bugs at alioth.debian.org
Sun Jul 4 17:05:45 UTC 2010


Bugs item #312617, was changed at 2010-07-01 15:45 by Charles Lepple
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=411542&aid=312617&group_id=30602

Status: Open
Priority: 3
Submitted By: Samuli Suominen (ssuominen-guest)
Assigned to: Nobody (None)
Summary: [patch] nut-2.4.3 fails to build with LDFLAGS="-Wl,--as-needed" 
Category: None
Group: None
Resolution: None


Initial Comment:
Original bug is here: 

http://bugs.gentoo.org/318481

You shouldn't be using LDFLAGS to pass libraries because with LDFLAGS="-Wl,--as-needed" the linking order is wrong. The fix is cheap and simple, use LIBS instead of LDFLAGS.

You can find it attached.

----------------------------------------------------------------------

>Comment By: Charles Lepple (clepple-guest)
Date: 2010-07-04 13:05

Message:
Sorry about the bad formatting on the previous comment, but the general idea is that the search-and-replace ends up masking some LIBS= lines which seem to be needed on some platforms.

Also, the patch originally included here does not apply cleanly to the trunk (r2459).

I think we need something a little more sophisticated than just search-and-replace, though. Also, a pointer to the rationale behind --as-needed would be nice, since I thought we manually optimized the linker parameters per Debian suggestions a while back. Are there specific tools which are linked to unnecessary libraries?

----------------------------------------------------------------------

Comment By: Charles Lepple (clepple-guest)
Date: 2010-07-04 12:58

Message:
Please double-check the patch. I see a number of things like this which seem incorrect:

        dnl Initial defaults. These are only used if gdlib-config is
        dnl unusable and the user fails to pass better values in --with
        dnl arguments
        CFLAGS=""
-       LDFLAGS="-L/usr/X11R6/lib"
+       LIBS="-L/usr/X11R6/lib"
        LIBS="-lgd -lpng -lz -ljpeg -lfreetype -lm -lXpm -lX11"

In this case, the "-L/usr/X11R6/lib" is masked by the next LIBS= line. 

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=411542&aid=312617&group_id=30602



More information about the NUT-tracker mailing list