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

Bug#956146: lintian: check for rules enabling --as-needed



Control: tag -1 - moreinfo

On 09/04/2020 01.01, Chris Lamb wrote:
> Any input on whether a brute grep for "-Wl,--as-needed" in debian/
> rules would be sufficient to catch most instances of these? (Feel free

I think you can just grep for '--as-needed', that will catch 
  -Wl,--as-needed (2579 matches)
  dh_autoreconf.* --as-needed (238 matches)
  -Wl,.*,--as-needed (9 matches)

The only 'legitimate' use of --as-needed seems to be in combination
with --no-as-needed. Therefore you should exclude matches that also
have --no-as-needed on the same (logical) line (but include them if
the matches are on different lines), e.g.
nethack:
LIB_x11 = -lncurses -lXaw -Wl,--as-needed -lXmu -lXext -Wl,--no-as-needed -lXt -lXpm -lX11 -Wl,--as-needed -lm -Wl,--no-as-needed
haproxy:
MAKEARGS+= ADDLIB="-Wl,--no-as-needed -lgcc_s -Wl,--as-needed"
grep:
LIBS=-Wl,--no-as-needed -ldl -Wl,--as-needed
graphviz:
CONFIGURE_LIBS    = LIBS="-Wl,--no-as-needed -Wl,-lpthread -Wl,--as-needed"
pnetcdf:
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--no-as-needed -lgfortran -Wl,--as-needed
clazy:
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed

(there are ~26 matches for --no-as-needed, ~2865 for --as-needed
and ~6 for both on one line)


Andreas


Reply to: