Bugzilla – Bug 1223344
NVidia driver fails to link when using mold
Last modified: 2024-04-29 01:29:57 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
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
Never heard about mold linker. Whatever. Unsupported.
(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.
You mean I should add a conflicts to mold package?
(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.
(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.
Where is this LD env. variable documented?
/usr/src/kernel-modules/nvidia-550.76-default/Makefile contains: `LD ?= ld`
Ok. Understood.
Fixed. Will be available with package update for 550.78.