Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 840389 - sys-apps/hwloc-2.7.1-r1 build fails with libXNVCtrl.a reloc error
Summary: sys-apps/hwloc-2.7.1-r1 build fails with libXNVCtrl.a reloc error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-23 19:43 UTC by LAP
Modified: 2022-04-24 06:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
hwloc-2.7.1 build log (sys-apps:hwloc-2.7.1-r1:20220423-192017.log,68.23 KB, text/plain)
2022-04-23 19:43 UTC, LAP
Details
emerge --info (emerge--info.txt,6.14 KB, text/plain)
2022-04-23 19:43 UTC, LAP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LAP 2022-04-23 19:43:20 UTC
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.
Comment 1 LAP 2022-04-23 19:43:59 UTC
Created attachment 773705 [details]
emerge --info
Comment 2 Ionen Wolkens gentoo-dev 2022-04-24 04:30:31 UTC
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.
Comment 3 Ionen Wolkens gentoo-dev 2022-04-24 05:00:01 UTC
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.
Comment 4 Ionen Wolkens gentoo-dev 2022-04-24 06:31:07 UTC
(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.
Comment 5 Larry the Git Cow gentoo-dev 2022-04-24 06:42:20 UTC
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(+)