FS#28817 - net-snmp-config --libs includes NON library information causing subsequent builds to fail

Attached to Project: Arch Linux
Opened by David C. Rankin (drankinatty) - Wednesday, 07 March 2012, 20:38 GMT
Last edited by Allan McRae (Allan) - Thursday, 08 March 2012, 22:01 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version 4.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

net-snmp-config --libs includes NON library information which causes packages built later that depend on it (eg: sane) to fail to link due to extraneous library information. (eg: sane-conf --libs) The current output of net-snmp-config --libs is:

-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -L/usr/lib -lnetsnmp -lcrypto -lm

This is wrong according to the man page which specifies the following for the --libs flag:

--libs lists libraries needed for building applications

There are separate flags responsible for returning link flags:

--ldflags link flags for external libraries

This behavior causes subsequent CMake builds (eg: that require libsane) to fail due to incorrect run-together library and linker flags:

/usr/bin/ld: cannot find
-lsane-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu-L/usr/lib
collect2: ld returned 1 exit status

See: '-lsane-Wl' above.

Steps to Reproduce:

(1) Install net-snmp
(2) issue: 'net-snmp-config --libs'
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 08 March 2012, 22:01 GMT
Reason for closing:  Not a bug
Comment by Dan McGee (toofishes) - Wednesday, 07 March 2012, 20:43 GMT
  • Field changed: Attached to Project (Pacman → Arch Linux)
Not a pacman bug.
Comment by Allan McRae (Allan) - Wednesday, 07 March 2012, 20:47 GMT
That is actually fine... It would be the application you are building that has the issue of not putting a space there.
Comment by David C. Rankin (drankinatty) - Thursday, 08 March 2012, 19:08 GMT
OK, thanks Allan & Dan,

It looks like this is all related to the following cmake policy:

CMake Error at cmake/modules/TDEMacros.cmake:662 (add_library):
Target "kscan-shared" links to item "v4l1 " which has leading or trailing
whitespace. This is now an error according to policy CMP0004.
Call Stack (most recent call first):
libkscan/CMakeLists.txt:38 (tde_add_library)

In the past, it looks like a leading/trailing whitespace was provided in $LIBS and $LDFLAGS so that concatenating ${LIBS}{$LDFLAGS} would work. Imposing policy CMP0004 breaks this and seems to be what brought this problem to light.

Thanks again.

Loading...