Build fails if gold linker is specified it unsafely convert -Wl,-fuse-ld=gold into -ld=gold CFLAGS='-Os -pipe -march=native -mtune=native -fomit-frame-pointer -mfpmath=sse -Wdate-time -Wno-error=implicit-function-declaration -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu' LDFLAGS='-Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu' running build_ext building 'netsnmp.client_intf' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/netsnmp gcc -Os -pipe -march=native -mtune=native -fomit-frame-pointer -mfpmath=sse -Wdate-time -Wno-error=implicit-function-declaration -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -Os -pipe -march=native -mtune=native -fomit-frame-pointer -mfpmath=sse -Wdate-time -Wno-error=implicit-function-declaration -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/5.30.0/x86_64-linux-thread-multi/CORE -D_REENTRANT -DREENTRANT -fPIC -I/var/tmp/portage/net-analyzer/net-snmp-5.8-r2/work/net-snmp-5.8/include -I/usr/lib64/perl5/5.30.0/x86_64-linux-thread-multi/CORE -I/usr/include -I. -I...). -I/usr/include/python2.7 -c netsnmp/client_intf.c -o build/temp.linux-x86_64-2.7/netsnmp/client_intf.o gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-O2 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu -L. -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu -Os -pipe -ma rch=native -mtune=native -fomit-frame-pointer -mfpmath=sse -Wdate-time -Wno-error=implicit-function-declaration -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -Os -pipe -march=native -mtune=native -fomit-frame-pointer -mfpmath=sse -Wdate-time -Wno-error=implicit-function-declaration -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -Wl,--hash-style=gnu -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/5.30.0/x86_64-linux-thread-multi/CORE -D_REENTRANT -DREENTRANT build/temp.linux-x86_64-2.7/netsnmp/client_intf.o -L/var/tmp/portage/net-analyzer/net-snmp-5.8-r2/work/net-snmp-5.8/agent/.libs -L/var/tmp/portage/net-analyzer/net-snmp-5.8-r2/work/net-snmp-5.8/snmplib/.libs -L/usr/lib64 -ld=gold -lpthread -lgomp -lnetsnmp -lcrypto -lm -lpython2.7 -o build/lib.linux-x86_64-2.7/netsnmp/client_intf.so /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: error: cannot find -ld=gold collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 make: *** [Makefile:354: pythonmodules] Error 1
Created attachment 589606 [details] net-snmp-5.8-r2:20190910-061001.log log
Created attachment 589608 [details] emerge --info info
python/setup.py calls `net-snmp-config --libs` which returns the linker flags instead of just the libraries. setup.py then mangles the LDFLAGS.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1dcbc73fd4041c63775fa227e3ba9e92d3a16b61 commit 1dcbc73fd4041c63775fa227e3ba9e92d3a16b61 Author: Jeroen Roovers <jer@gentoo.org> AuthorDate: 2019-09-10 07:34:48 +0000 Commit: Jeroen Roovers <jer@gentoo.org> CommitDate: 2019-09-10 07:35:08 +0000 net-analyzer/net-snmp: Fix `net-snmp-config --libs` Package-Manager: Portage-2.3.75, Repoman-2.3.17 Bug: https://bugs.gentoo.org/693970 Signed-off-by: Jeroen Roovers <jer@gentoo.org> ...snmp-5.8-do-not-conflate-LDFLAGS-and-LIBS.patch | 34 ++++++++++++++++++++++ ...t-snmp-5.8-r3.ebuild => net-snmp-5.8-r4.ebuild} | 1 + 2 files changed, 35 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23ff5f3216bf61aa543bbcf49b2bc509cbdfe9aa commit 23ff5f3216bf61aa543bbcf49b2bc509cbdfe9aa Author: Jeroen Roovers <jer@gentoo.org> AuthorDate: 2019-12-07 13:02:22 +0000 Commit: Jeroen Roovers <jer@gentoo.org> CommitDate: 2019-12-07 13:05:10 +0000 net-analyzer/net-snmp: Revise patches - Add patch for bug net-snmp-config LDFLAGS/LIBS confusion - Use PATCHES instead of eapply calls Package-Manager: Portage-2.3.81, Repoman-2.3.20 Closes: https://bugs.gentoo.org/693970 Signed-off-by: Jeroen Roovers <jer@gentoo.org> net-analyzer/net-snmp/net-snmp-5.8.1_pre1.ebuild | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-)