Created attachment 841489 [details] emerge --info The build of nvidia-drivers[kernel-open] aborts with mkdir -p _out/Linux_x86_64 cd _out/Linux_x86_64/; ld.lld -r -z noexecstack --format=binary turing_shaders.xz -o /var/tmp/portage/x11-drivers/nvidia-drivers-525.60.13/work/kernel-module-source/src/nvidia-modeset/_out/Linux_x86_64/turing_shaders.xz.o ld.lld: error: target emulation unknown: -m or at least one .o file required make[1]: *** [Makefile:192: _out/Linux_x86_64/turing_shaders.xz.o] Error 1 Linux is compiled using clang-15.0.5 with LTO (gentoo-sources-6.0.12). A similar issue was discussed on nvidia's github (https://github.com/NVIDIA/open-gpu-kernel-modules/issues/405), however it turned out to be a different problem. The fix proposed during the discussion fixes this issue for me. It does not seem like it was further considered for merging. I adjusted the proposed to Gentoo's folder structure and attached it below. Not sure if it should be fixed on Nvidia's side or (also) here. It does not seem like the Makefile is considering LDFLAGS in general. In the ebuild I can see that adding the -m flag has been done for compiling the tools.
Created attachment 841491 [details] nvidia-drivers build.log
Created attachment 841493 [details, diff] ld.lld gentoo patch
(In reply to Frederik Pfautsch from comment #2) > Created attachment 841493 [details, diff] [details, diff] > ld.lld gentoo patch >- $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \ >+ $$(call quiet_cmd_no_at,LD) -r -z noexecstack -m elf_x86_64 --format=binary \ That wouldn't quite work for aarch64 (nvidia-drivers is available there). But not the first of this issue, just have to copy what previously did for nvidia-settings until nvidia comes up with their own solution.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1093d6cf18080fded4f22ca5aa04c869fff1c4e7 commit 1093d6cf18080fded4f22ca5aa04c869fff1c4e7 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2022-12-11 18:41:59 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2022-12-11 19:11:29 +0000 x11-drivers/nvidia-drivers: pass raw-ldflags for USE=kernel-open too Same as nvidia-settings-390.144-raw-ldflags.patch, but applied to kernel-module-source. Not a perfect fix given profiles don't define LDFLAGS_arm64, but that's not a high priority and can wait for nvidia's fix. Note that modules are still generally fragile and untested with llvm toolchain. Closes: https://bugs.gentoo.org/885483 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> .../nvidia-kernel-module-source-515.86.01-raw-ldflags.patch | 13 +++++++++++++ x11-drivers/nvidia-drivers/nvidia-drivers-515.49.25.ebuild | 4 ++-- x11-drivers/nvidia-drivers/nvidia-drivers-515.86.01.ebuild | 4 ++-- x11-drivers/nvidia-drivers/nvidia-drivers-525.60.11.ebuild | 4 ++-- x11-drivers/nvidia-drivers/nvidia-drivers-525.60.13.ebuild | 4 ++-- 5 files changed, 21 insertions(+), 8 deletions(-)