diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-12-11 13:41:59 -0500 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-12-11 14:11:29 -0500 |
commit | 1093d6cf18080fded4f22ca5aa04c869fff1c4e7 (patch) | |
tree | f8ba487869086f5a24f362f09cc0edbd419d86e7 /x11-drivers/nvidia-drivers | |
parent | dev-python/gpep517: Bump to v12 (diff) | |
download | gentoo-1093d6cf18080fded4f22ca5aa04c869fff1c4e7.tar.gz gentoo-1093d6cf18080fded4f22ca5aa04c869fff1c4e7.tar.bz2 gentoo-1093d6cf18080fded4f22ca5aa04c869fff1c4e7.zip |
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>
Diffstat (limited to 'x11-drivers/nvidia-drivers')
5 files changed, 21 insertions, 8 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch b/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch new file mode 100644 index 000000000000..0b0d2f1dcb48 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch @@ -0,0 +1,13 @@ +Need to pass ABI flags if LD is ld.lld for USE=kernel-open +ld.lld: error: target emulation unknown: -m or at least one .o file required + +https://bugs.gentoo.org/885483 +https://github.com/NVIDIA/open-gpu-kernel-modules/issues/405 +https://github.com/NVIDIA/open-gpu-kernel-modules/issues/214 +--- a/kernel-module-source/utils.mk ++++ b/utils.mk +@@ -556,3 +556,3 @@ + $(at_if_quiet)cd $$(dir $(1)); \ +- $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \ ++ $$(call quiet_cmd_no_at,LD) $$(RAW_LDFLAGS) -r -z noexecstack --format=binary \ + $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@) diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.25.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.25.ebuild index e5d38d8e51c5..10af2e877f74 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.25.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.25.ebuild @@ -82,6 +82,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch + "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-390.144-desktop.patch "${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch @@ -264,6 +265,7 @@ options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch NV_ARGS=( PREFIX="${EPREFIX}"/usr @@ -299,9 +301,7 @@ src_compile() { if use tools; then # cflags: avoid noisy logs, only use here and set first to let override - # ldflags: abi currently needed if LD=ld.lld CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \ emake "${NV_ARGS[@]}" -C nvidia-settings elif use static-libs; then emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.86.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.86.01.ebuild index a4db984826ff..607b01e7b163 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.86.01.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.86.01.ebuild @@ -82,6 +82,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch + "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-390.144-desktop.patch "${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch @@ -264,6 +265,7 @@ options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch NV_ARGS=( PREFIX="${EPREFIX}"/usr @@ -299,9 +301,7 @@ src_compile() { if use tools; then # cflags: avoid noisy logs, only use here and set first to let override - # ldflags: abi currently needed if LD=ld.lld CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \ emake "${NV_ARGS[@]}" -C nvidia-settings elif use static-libs; then emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.11.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.11.ebuild index 762c644b7499..70f7769f33f5 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.11.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.11.ebuild @@ -82,6 +82,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-drivers-525.23-clang15.patch + "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-390.144-desktop.patch "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch @@ -259,6 +260,7 @@ options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch NV_ARGS=( PREFIX="${EPREFIX}"/usr @@ -295,9 +297,7 @@ src_compile() { if use tools; then # cflags: avoid noisy logs, only use here and set first to let override - # ldflags: abi currently needed if LD=ld.lld CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \ emake "${NV_ARGS[@]}" -C nvidia-settings elif use static-libs; then # pretend GTK+3 is available, not actually used (bug #880879) diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.13.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.13.ebuild index 762c644b7499..70f7769f33f5 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.13.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.60.13.ebuild @@ -82,6 +82,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-drivers-525.23-clang15.patch + "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-390.144-desktop.patch "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch @@ -259,6 +260,7 @@ options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch NV_ARGS=( PREFIX="${EPREFIX}"/usr @@ -295,9 +297,7 @@ src_compile() { if use tools; then # cflags: avoid noisy logs, only use here and set first to let override - # ldflags: abi currently needed if LD=ld.lld CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" \ emake "${NV_ARGS[@]}" -C nvidia-settings elif use static-libs; then # pretend GTK+3 is available, not actually used (bug #880879) |