Created attachment 773702 [details] hwloc-2.7.1 build log Hwloc-2.7.1-r1 build fails with the following error message: error: libXNVCtrl.a(NVCtrl.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC The complete build log is attached. libXNVCtrl is part of the nvidia-drivers package. I don't know what this means. Should nvidia-drivers be built with the "-fpic" compile option? The complete build log is attached.
Created attachment 773705 [details] emerge --info
Hm, I have a potential suspicion of what might have happened, but the only way I see it may be possible is if you forced USE=-pie on gcc through /etc/portage/profile (haven't tried). Is it the case? Albeit there seem to be a lot of other custom things here which could have an impact.
NVIDIA uses -fPIC about everywhere relevant /except/ NVCtrl.o, it looks it meant to use it given the Makefile does += -fPIC, but that Makefile doesn't get used given the library is built by a higher level Makefile. `XNVCTRL_CFLAGS=-fPIC emerge -1 nvidia-drivers` would force it on which I could add to the ebuild. But as I mentioned, gcc defaults to enabling it unless you did USE=-pie on gcc -- just want to confirm if it's really because of that.
(In reply to Ionen Wolkens from comment #3) > But as I mentioned, gcc defaults to enabling it unless you did USE=-pie on > gcc -- just want to confirm if it's really because of that. Well, I tried it and gcc[-pie] did allow me to reproduce. Do wonder why it's an issue /now/ given this -fPIC been always missing, but haven't looked at how hwloc builds. Don't see a problem with adding it to ensure it's used even with -pie anyhow.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f0bbb0b8ac6d146e6d60af267abcccac7072de5 commit 9f0bbb0b8ac6d146e6d60af267abcccac7072de5 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2022-04-24 06:15:45 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2022-04-24 06:42:10 +0000 x11-drivers/nvidia-drivers: use -fPIC for libXNVCtrl.a as well Should revbump but would rather not cause rebuilds over this given this is a no-op unless forced USE=-pie on gcc through profile's package.use.force (clang now also defaults to it). nvidia-drivers already get rebuilt on kernel upgrades which will phase it out for -pie users (please manually rebuild if issues). Legacy 0/390 branch is not affected. Closes: https://bugs.gentoo.org/840389 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> x11-drivers/nvidia-drivers/nvidia-drivers-470.103.01.ebuild | 1 + x11-drivers/nvidia-drivers/nvidia-drivers-470.62.26.ebuild | 1 + x11-drivers/nvidia-drivers/nvidia-drivers-510.60.02.ebuild | 1 + 3 files changed, 3 insertions(+)