Description of problem: kudzu-1.2.57.1.24-1, which buildrequires pciutils-devel, fails to build after 5.6 rebase of pciutils (and it's -devel sub-package) on various archs: ‣ i386, ia64, s390x cc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I. -Wall -D_GNU_SOURCE -g -I. -DVERSION=\"1.2.57.1.24\" hwconf.o -o kudzu -L. -lkudzu -L. -lpci -Wl,-Bstatic -lpopt -Wl,-Bdynamic /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libpci.a(names-net.o): In function `pci_id_net_lookup': (.text+0x167): undefined reference to `__res_query' collect2: ld returned 1 exit status make: *** [kudzu] Error 1 ‣ x86_64 kudzumodule.c:68: warning: 'numClassEntries' defined but not used kudzumodule.c:96: warning: 'numBusEntries' defined but not used kudzumodule.c:104: warning: 'numModeEntries' defined but not used /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libpci.a(init.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libpci.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [_kudzumodule.so] Error 1 ‣ ppc - infrastructure problems; result: N/A Building against former pciutils-2.2.3-8.el5 works. Version-Release number of selected component (if applicable): kudzu-1.2.57.1.24-1 pciutils-3.1.7-2.el5 How reproducible: always Steps to Reproduce: 1. rebuild kudzu with new pciutils Additional info: - One might want to do the build in mock. - There may be two problems the one with pci_id_net_lookup() and the one specific to x86_64 re -fPIC, feel free to divide to two bugs.
The one specific to -fPIC certainly needs fixed in pciutils; the library needs to be built with -fPIC. The first could probably be relnoted such that 'any app that links against libpci now needs to link against libresolv'.
1)(.text+0x167): undefined reference to `__res_query' pciutils does not use pkg-config so the way how to fix this is just to append "-lresolv" to build line: cc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I. -Wall -D_GNU_SOURCE -g -I. -DVERSION=\"1.2.57.1.24\" hwconf.o -o kudzu -L. -lkudzu -L. -lpci -lresolv which I tested and it fixed the problem 2)/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libpci.a(init.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC this is also odd, because pciutils provides only static library for which -fPIC should not be needed and also old version of pciutils did not use -fPIC problem can be fixed if -fPIC is added to pciutils build or by modifying following kudzu's build command: cc -o $ver/_kudzumodule.so $ver/kudzumodule.o -shared -Wl,soname,_kudzumodule.so -L. -lkudzu -lpci just swap order of -lkudzu -lpci to -lpci -lkudzu
(In reply to comment #4) > 2)/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libpci.a(init.o): > relocation R_X86_64_32S against `a local symbol' can not be used when making a > shared object; recompile with -fPIC > > this is also odd, because pciutils provides only static library for which -fPIC > should not be needed and also old version of pciutils did not use -fPIC Yes, they did. See the changelog and the patches (pciutils-strip.patch is the one where this was set.)
(In reply to comment #5) > (In reply to comment #4) > > > this is also odd, because pciutils provides only static library for which -fPIC > > should not be needed and also old version of pciutils did not use -fPIC > > Yes, they did. See the changelog and the patches (pciutils-strip.patch is the > one where this was set.) you're right, my bad, I did not expect that strip patch would contain this
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2011-0045.html