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
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
|
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
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.