Bug 1223344 - NVidia driver fails to link when using mold
Summary: NVidia driver fails to link when using mold
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X11 3rd Party Driver (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Stefan Dirsch
QA Contact: Stefan Dirsch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-24 11:04 UTC by Christophe Marin
Modified: 2024-04-29 01:29 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
zypper in -f log (68.22 KB, text/plain)
2024-04-24 11:07 UTC, Christophe Marin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Marin 2024-04-24 11:04:26 UTC
The NVidia driver silently fails to build when using the mold linker:

# ll /etc/alternatives/ld 
lrwxrwxrwx 1 root root 16 11 avril 01:02 /etc/alternatives/ld -> /usr/bin/ld.mold


mold: fatal: scripts/module.lds:1: SECTIONS {
                            ^ unknown linker script token
mold: fatal: scripts/module.lds:1: SECTIONS {
                            ^ unknown linker script token
make[4]: *** [/usr/src/linux-6.8.7-1/scripts/Makefile.modfinal:56: /usr/src/kernel-modules/nvidia-550.67-default/nvidia-uvm.ko] Error 1
make[4]: *** Waiting for unfinished jobs....
mold: fatal: scripts/module.lds:1: SECTIONS {
                            ^ unknown linker script token
make[4]: *** [/usr/src/linux-6.8.7-1/scripts/Makefile.modfinal:56: /usr/src/kernel-modules/nvidia-550.67-default/nvidia-drm.ko] Error 1
mold: fatal: scripts/module.lds:1: SECTIONS {
                            ^ unknown linker script token
make[4]: *** [/usr/src/linux-6.8.7-1/scripts/Makefile.modfinal:56: /usr/src/kernel-modules/nvidia-550.67-default/nvidia-peermem.ko] Error 1
make[4]: *** [/usr/src/linux-6.8.7-1/scripts/Makefile.modfinal:56: /usr/src/kernel-modules/nvidia-550.67-default/nvidia.ko] Error 1
mold: fatal: scripts/module.lds:1: SECTIONS {
                            ^ unknown linker script token
make[4]: *** [/usr/src/linux-6.8.7-1/scripts/Makefile.modfinal:56: /usr/src/kernel-modules/nvidia-550.67-default/nvidia-modeset.ko] Error 1
make[3]: *** [/usr/src/linux-6.8.7-1/Makefile:1871: modules] Error 2
make[2]: *** [/usr/src/linux-6.8.7-1/Makefile:240: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-6.8.7-1-obj/x86_64/default'
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-6.8.7-1'
make: *** [Makefile:85: modules] Error 2
Comment 1 Christophe Marin 2024-04-24 11:07:58 UTC
Created attachment 874480 [details]
zypper in -f log

Zypper log with zypper in -f nvidia-driver-G06-kmp-default

The warnings reported in 1212841 were removed from the log file
Comment 2 Stefan Dirsch 2024-04-24 15:34:26 UTC
Never heard about mold linker. Whatever. Unsupported.
Comment 3 Christophe Marin 2024-04-24 15:53:21 UTC
(In reply to Stefan Dirsch from comment #2)
> Never heard about mold linker. Whatever. Unsupported.

Precisely. the nvidia driver package should only try to use what it supports.
Comment 4 Stefan Dirsch 2024-04-24 19:14:04 UTC
You mean I should add a conflicts to mold package?
Comment 5 Christophe Marin 2024-04-25 07:55:26 UTC
(In reply to Stefan Dirsch from comment #4)
> You mean I should add a conflicts to mold package?

The opposite, tell which linker to use.

If I take the nvidia package in X11:Drivers:Video:Redesign as model, adding `export LD=ld.bfd` in kmp-post.sh and kmp-trigger.sh would be sufficient.
Comment 6 Christophe Marin 2024-04-25 07:56:41 UTC
(In reply to Christophe Marin from comment #5)
> (In reply to Stefan Dirsch from comment #4)
> > You mean I should add a conflicts to mold package?
> 
> The opposite, tell which linker to use.
> 
> If I take the nvidia package in X11:Drivers:Video:Redesign as model, adding
> `export LD=ld.bfd` in kmp-post.sh and kmp-trigger.sh would be sufficient.

Tested successfully locally.
Comment 7 Stefan Dirsch 2024-04-25 08:09:55 UTC
Where is this LD env. variable documented?
Comment 8 Christophe Marin 2024-04-25 08:24:35 UTC
/usr/src/kernel-modules/nvidia-550.76-default/Makefile contains: `LD ?= ld`
Comment 9 Stefan Dirsch 2024-04-29 01:28:45 UTC
Ok. Understood.
Comment 10 Stefan Dirsch 2024-04-29 01:29:57 UTC
Fixed. Will be available with package update for 550.78.