mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
(cherry picked from commit af216950ca)
Co-authored-by: Gilver <rockgrub@disroot.org>
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
project pkg {
|
||||
rpm {
|
||||
spec = "kmod-nvidia.spec"
|
||||
}
|
||||
labels {
|
||||
subrepo = "nvidia"
|
||||
mock = 1
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
From 38b7e1478b58b983724ec817562301edd5c244a2 Mon Sep 17 00:00:00 2001
|
||||
From: Neal Gompa <ngompa@almalinux.org>
|
||||
Date: Mon, 7 Apr 2025 19:34:49 -0400
|
||||
Subject: [PATCH] src/nvidia/Makefile: Drop broken addition of userspace linker
|
||||
flags
|
||||
|
||||
The Makefile currently causes the package build of the kernel modules
|
||||
to fail with the following error:
|
||||
|
||||
ld: unrecognized option '-Wl,-z,relro'
|
||||
ld: use the --help option for usage information
|
||||
make[1]: *** [Makefile:214: _out/Linux_x86_64/nv-kernel.o] Error 1
|
||||
make: *** [Makefile:34: src/nvidia/_out/Linux_x86_64/nv-kernel.o] Error 2
|
||||
|
||||
Dropping this line fixes this issue.
|
||||
|
||||
Signed-off-by: Neal Gompa <ngompa@almalinux.org>
|
||||
---
|
||||
src/nvidia/Makefile | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/src/nvidia/Makefile b/src/nvidia/Makefile
|
||||
index 931a74c0..423414af 100644
|
||||
--- a/src/nvidia/Makefile
|
||||
+++ b/src/nvidia/Makefile
|
||||
@@ -208,8 +208,6 @@ all: $(NV_KERNEL_O)
|
||||
|
||||
LINKER_SCRIPT = nv-kernel.ld
|
||||
|
||||
-NV_KERNEL_O_LDFLAGS += $(LDFLAGS)
|
||||
-
|
||||
$(NV_KERNEL_O): $(OBJS) $(EXPORTS_LINK_COMMAND) $(LINKER_SCRIPT)
|
||||
$(call quiet_cmd,LD) \
|
||||
$(NV_KERNEL_O_LDFLAGS) \
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
diff -Naur open-gpu-kernel-modules-570.133.07.old/utils.mk open-gpu-kernel-modules-570.133.07/utils.mk
|
||||
--- open-gpu-kernel-modules-570.133.07.old/utils.mk 2025-04-12 15:13:09.368747667 +0200
|
||||
+++ open-gpu-kernel-modules-570.133.07/utils.mk 2025-04-12 15:14:11.297683469 +0200
|
||||
@@ -114,14 +114,8 @@
|
||||
CHMOD ?= chmod
|
||||
OBJCOPY ?= objcopy
|
||||
XZ ?= xz
|
||||
-WHOAMI ?= whoami
|
||||
PKG_CONFIG ?= pkg-config
|
||||
|
||||
-ifndef HOSTNAME
|
||||
- HOSTNAME = $(shell hostname)
|
||||
-endif
|
||||
-
|
||||
-
|
||||
NV_AUTO_DEPEND ?= 1
|
||||
NV_VERBOSE ?= 0
|
||||
|
||||
@@ -551,7 +545,7 @@
|
||||
# g_nvid_string.c depends on all objects except g_nvid_string.o, and version.mk
|
||||
$(NVIDSTRING): $$(filter-out $$(call BUILD_OBJECT_LIST,$$(NVIDSTRING)), $(3)) $$(VERSION_MK)
|
||||
$(at_if_quiet)$$(MKDIR) $$(dir $$@)
|
||||
- $(at_if_quiet)$$(ECHO) "const char $(1)[] = \"nvidia id: NVIDIA $$(strip $(2)) for $$(TARGET_ARCH) $$(NVIDIA_VERSION) $$(NVIDSTRING_BUILD_TYPE_STRING) (`$$(WHOAMI)`@$$(HOSTNAME)) `$$(DATE)`\";" > $$@
|
||||
+ $(at_if_quiet)$$(ECHO) "const char $(1)[] = \"nvidia id: NVIDIA $$(strip $(2)) for $$(TARGET_ARCH) $$(NVIDIA_VERSION) $$(NVIDSTRING_BUILD_TYPE_STRING) `$$(DATE)`\";" > $$@
|
||||
$(at_if_quiet)$$(ECHO) "const char *const p$$(strip $(1)) = $(1) + 11;" >> $$@;
|
||||
endef
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
%global kmod_name nvidia
|
||||
|
||||
%global debug_package %{nil}
|
||||
|
||||
# Generate kernel symbols requirements:
|
||||
%global _use_internal_dependency_generator 0
|
||||
|
||||
%{!?kversion: %global kversion %(uname -r)}
|
||||
|
||||
Name: kmod-%{kmod_name}
|
||||
Version: 575.51.02
|
||||
Release: 1%{?dist}
|
||||
Summary: NVIDIA display driver kernel module
|
||||
Epoch: 3
|
||||
License: NVIDIA License
|
||||
URL: http://www.nvidia.com/
|
||||
ExclusiveArch: x86_64 aarch64
|
||||
|
||||
Source0: https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/%{version}.tar.gz
|
||||
# Kbuild: Convert EXTRA_CFLAGS to ccflags-y (6.15+) + std=gnu17
|
||||
Patch0: nvidia-kernel-ccflags-y.patch
|
||||
# https://git.almalinux.org/ngompa/nvidia-kmod-el-rpm/
|
||||
Patch1: %{name}-ldflags.patch
|
||||
Patch2: %{name}-no-hostname-whoami.patch
|
||||
|
||||
BuildRequires: elfutils-libelf-devel
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: kernel-abi-stablelists
|
||||
BuildRequires: kernel-devel
|
||||
BuildRequires: kernel-rpm-macros
|
||||
BuildRequires: kmod
|
||||
BuildRequires: redhat-rpm-config
|
||||
|
||||
Provides: kabi-modules = %{kversion}
|
||||
Provides: %{kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: module-init-tools
|
||||
|
||||
%description
|
||||
This package provides the proprietary NVIDIA kernel modules. It is built to
|
||||
depend upon the specific ABI provided by a range of releases of the same variant
|
||||
of the Linux kernel and not on any one specific build.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n open-gpu-kernel-modules-%{version}
|
||||
|
||||
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
|
||||
|
||||
%build
|
||||
export SYSSRC=%{_usrsrc}/kernels/%{kversion}
|
||||
export IGNORE_XEN_PRESENCE=1
|
||||
export IGNORE_PREEMPT_RT_PRESENCE=1
|
||||
export IGNORE_CC_MISMATCH=1
|
||||
|
||||
%make_build modules
|
||||
|
||||
%install
|
||||
export INSTALL_MOD_PATH=%{buildroot}%{_prefix}
|
||||
export INSTALL_MOD_DIR=extra/%{kmod_name}
|
||||
|
||||
make -C %{_usrsrc}/kernels/%{kversion} -j$(nproc) modules_install M=$PWD/kernel-open
|
||||
|
||||
install -d %{buildroot}%{_sysconfdir}/depmod.d/
|
||||
install kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
|
||||
# Remove the unrequired files.
|
||||
rm -f %{buildroot}%{_prefix}/lib/modules/%{kversion}/modules.*
|
||||
|
||||
find %{buildroot} -type f -name '*.ko' | xargs %{__strip} --strip-debug
|
||||
find %{buildroot} -type f -name '*.ko' | xargs xz
|
||||
|
||||
%post
|
||||
if [ -e "/boot/System.map-%{kversion}" ]; then
|
||||
%{_sbindir}/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
|
||||
fi
|
||||
modules=( $(find %{_prefix}/lib/modules/%{kversion}/extra/%{kmod_name} | grep '\.ko.xz$') )
|
||||
if [ -x "%{_sbindir}/weak-modules" ]; then
|
||||
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
|
||||
fi
|
||||
|
||||
%preun
|
||||
rpm -ql kmod-%{kmod_name}-%{version}-%{release}.%{_target_cpu} | grep '\.ko.xz$' > %{_var}/run/rpm-kmod-%{kmod_name}-modules
|
||||
|
||||
%postun
|
||||
if [ -e "/boot/System.map-%{kversion}" ]; then
|
||||
%{_sbindir}/depmod -aeF "/boot/System.map-%{kversion}" "%{kversion}" > /dev/null || :
|
||||
fi
|
||||
modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) )
|
||||
rm %{_var}/run/rpm-kmod-%{kmod_name}-modules
|
||||
if [ -x "%{_sbindir}/weak-modules" ]; then
|
||||
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
|
||||
fi
|
||||
|
||||
%files
|
||||
%{_prefix}/lib/modules/%{kversion}/extra/*
|
||||
%config %{_sysconfdir}/depmod.d/kmod-%{kmod_name}.conf
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
@@ -1,117 +0,0 @@
|
||||
diff -Naur open-gpu-kernel-modules-575.51.02.old/kernel-open/Kbuild open-gpu-kernel-modules-575.51.02/kernel-open/Kbuild
|
||||
--- open-gpu-kernel-modules-575.51.02.old/kernel-open/Kbuild 2025-04-22 19:14:10.712973734 +0200
|
||||
+++ open-gpu-kernel-modules-575.51.02/kernel-open/Kbuild 2025-04-22 19:16:40.057981220 +0200
|
||||
@@ -75,21 +75,15 @@
|
||||
$(eval include $(src)/$(_module)/$(_module).Kbuild))
|
||||
|
||||
|
||||
-#
|
||||
-# Define CFLAGS that apply to all the NVIDIA kernel modules. EXTRA_CFLAGS
|
||||
-# is deprecated since 2.6.24 in favor of ccflags-y, but we need to support
|
||||
-# older kernels which do not have ccflags-y. Newer kernels append
|
||||
-# $(EXTRA_CFLAGS) to ccflags-y for compatibility.
|
||||
-#
|
||||
-
|
||||
-EXTRA_CFLAGS += -I$(src)/common/inc
|
||||
-EXTRA_CFLAGS += -I$(src)
|
||||
-EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
|
||||
-EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
|
||||
-EXTRA_CFLAGS += -DNV_VERSION_STRING=\"575.51.02\"
|
||||
+ccflags-y += -std=gnu17
|
||||
+ccflags-y += -I$(src)/common/inc
|
||||
+ccflags-y += -I$(src)
|
||||
+ccflags-y += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
|
||||
+ccflags-y += -D__KERNEL__ -DMODULE -DNVRM
|
||||
+ccflags-y += -DNV_VERSION_STRING=\"575.51.02\"
|
||||
|
||||
ifneq ($(SYSSRCHOST1X),)
|
||||
- EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
|
||||
+ ccflags-y += -I$(SYSSRCHOST1X)
|
||||
endif
|
||||
|
||||
# Some Android kernels prohibit driver use of filesystem functions like
|
||||
@@ -99,57 +93,57 @@
|
||||
PLATFORM_IS_ANDROID ?= 0
|
||||
|
||||
ifeq ($(PLATFORM_IS_ANDROID),1)
|
||||
- EXTRA_CFLAGS += -DNV_FILESYSTEM_ACCESS_AVAILABLE=0
|
||||
+ ccflags-y += -DNV_FILESYSTEM_ACCESS_AVAILABLE=0
|
||||
else
|
||||
- EXTRA_CFLAGS += -DNV_FILESYSTEM_ACCESS_AVAILABLE=1
|
||||
+ ccflags-y += -DNV_FILESYSTEM_ACCESS_AVAILABLE=1
|
||||
endif
|
||||
|
||||
-EXTRA_CFLAGS += -Wno-unused-function
|
||||
+ccflags-y += -Wno-unused-function
|
||||
|
||||
ifneq ($(NV_BUILD_TYPE),debug)
|
||||
- EXTRA_CFLAGS += -Wuninitialized
|
||||
+ ccflags-y += -Wuninitialized
|
||||
endif
|
||||
|
||||
-EXTRA_CFLAGS += -fno-strict-aliasing
|
||||
+ccflags-y += -fno-strict-aliasing
|
||||
|
||||
ifeq ($(ARCH),arm64)
|
||||
- EXTRA_CFLAGS += -mstrict-align
|
||||
+ ccflags-y += -mstrict-align
|
||||
endif
|
||||
|
||||
ifeq ($(NV_BUILD_TYPE),debug)
|
||||
- EXTRA_CFLAGS += -g
|
||||
+ ccflags-y += -g
|
||||
endif
|
||||
|
||||
-EXTRA_CFLAGS += -ffreestanding
|
||||
+ccflags-y += -ffreestanding
|
||||
|
||||
ifeq ($(ARCH),arm64)
|
||||
- EXTRA_CFLAGS += -mgeneral-regs-only -march=armv8-a
|
||||
- EXTRA_CFLAGS += $(call cc-option,-mno-outline-atomics,)
|
||||
+ ccflags-y += -mgeneral-regs-only -march=armv8-a
|
||||
+ ccflags-y += $(call cc-option,-mno-outline-atomics,)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
- EXTRA_CFLAGS += -mno-red-zone -mcmodel=kernel
|
||||
+ ccflags-y += -mno-red-zone -mcmodel=kernel
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),powerpc)
|
||||
- EXTRA_CFLAGS += -mlittle-endian -mno-strict-align
|
||||
+ ccflags-y += -mlittle-endian -mno-strict-align
|
||||
endif
|
||||
|
||||
-EXTRA_CFLAGS += -DNV_UVM_ENABLE
|
||||
-EXTRA_CFLAGS += $(call cc-option,-Werror=undef,)
|
||||
-EXTRA_CFLAGS += -DNV_SPECTRE_V2=$(NV_SPECTRE_V2)
|
||||
-EXTRA_CFLAGS += -DNV_KERNEL_INTERFACE_LAYER
|
||||
+ccflags-y += -DNV_UVM_ENABLE
|
||||
+ccflags-y += $(call cc-option,-Werror=undef,)
|
||||
+ccflags-y += -DNV_SPECTRE_V2=$(NV_SPECTRE_V2)
|
||||
+ccflags-y += -DNV_KERNEL_INTERFACE_LAYER
|
||||
|
||||
#
|
||||
# Detect SGI UV systems and apply system-specific optimizations.
|
||||
#
|
||||
|
||||
ifneq ($(wildcard /proc/sgi_uv),)
|
||||
- EXTRA_CFLAGS += -DNV_CONFIG_X86_UV
|
||||
+ ccflags-y += -DNV_CONFIG_X86_UV
|
||||
endif
|
||||
|
||||
ifdef VGX_FORCE_VFIO_PCI_CORE
|
||||
- EXTRA_CFLAGS += -DNV_VGPU_FORCE_VFIO_PCI_CORE
|
||||
+ ccflags-y += -DNV_VGPU_FORCE_VFIO_PCI_CORE
|
||||
endif
|
||||
|
||||
WARNINGS_AS_ERRORS ?=
|
||||
@@ -183,7 +177,7 @@
|
||||
|
||||
NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_CONFTEST_CMD) build_cflags)
|
||||
|
||||
-NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(EXTRA_CFLAGS) -fno-pie
|
||||
+NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(ccflags-y) -fno-pie
|
||||
NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign)
|
||||
NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,)
|
||||
NV_CONFTEST_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types,)
|
||||
@@ -1 +0,0 @@
|
||||
rpm.version(gh("NVIDIA/open-gpu-kernel-modules"));
|
||||
Reference in New Issue
Block a user