[arch-commits] Commit in nvidia-open/repos (3 files)
Sven-Hendrik Haase
svenstaro at gemini.archlinux.org
Thu Jun 30 00:32:56 UTC 2022
Date: Thursday, June 30, 2022 @ 00:32:56
Author: svenstaro
Revision: 449651
archrelease: copy trunk to staging-x86_64
Added:
nvidia-open/repos/staging-x86_64/
nvidia-open/repos/staging-x86_64/PKGBUILD
(from rev 449650, nvidia-open/trunk/PKGBUILD)
nvidia-open/repos/staging-x86_64/nvidia-open-gcc-ibt-sls.patch
(from rev 449650, nvidia-open/trunk/nvidia-open-gcc-ibt-sls.patch)
-------------------------------+
PKGBUILD | 94 ++++++++++++++++++++++++++++++++++++++++
nvidia-open-gcc-ibt-sls.patch | 28 +++++++++++
2 files changed, 122 insertions(+)
Copied: nvidia-open/repos/staging-x86_64/PKGBUILD (from rev 449650, nvidia-open/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD (rev 0)
+++ staging-x86_64/PKGBUILD 2022-06-30 00:32:56 UTC (rev 449651)
@@ -0,0 +1,94 @@
+# Maintainer: Sven-Hendrik Haase <svenstaro at archlinux.org>
+pkgbase=nvidia-open
+pkgname=(nvidia-open nvidia-open-dkms)
+pkgver=515.57
+pkgrel=1
+pkgdesc="NVIDIA open kernel modules"
+arch=('x86_64')
+url="https://github.com/NVIDIA/open-gpu-kernel-modules"
+depends=("nvidia-utils=${pkgver}" 'libglvnd')
+makedepends=('linux-headers')
+license=('GPL')
+options=('!lto' '!buildflags')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${pkgver}.tar.gz"
+ nvidia-open-gcc-ibt-sls.patch)
+sha512sums=('93d59bf0bb1eede40036dd65c8ef956c7b9a79f3a2fe6e87b6f4f16413e52b3c8cdb47aacbcd4c087bd77081a2d35fc1981db93019e352b8a8f85083a9221461'
+ 'a8821f36c7515bfe4f50d7e3d15a6a8464ec833ca19818d674e300199f3867971f6fba35e1a357fa8ced08cc91d36c2f7fb37cb247bcbf18fa706f97916639b5')
+
+prepare() {
+ cd open-gpu-kernel-modules-${pkgver}
+
+ # Fix for https://bugs.archlinux.org/task/74886
+ patch -Np1 --no-backup-if-mismatch -i "$srcdir"/nvidia-open-gcc-ibt-sls.patch
+
+ # Attempt to make this reproducible
+ sed -i "s/^HOSTNAME.*/HOSTNAME = echo archlinux"/ utils.mk
+ sed -i "s/^WHOAMI.*/WHOAMI = echo archlinux-builder"/ utils.mk
+ sed -i "s/^DATE.*/DATE = date -r version.mk"/ utils.mk
+
+ sed -i "s/__VERSION_STRING/${pkgver}/" kernel-open/dkms.conf
+ sed -i 's/__JOBS/`nproc`/' kernel-open/dkms.conf
+ sed -i 's/__EXCLUDE_MODULES//' kernel-open/dkms.conf
+ sed -i 's/__DKMS_MODULES//' kernel-open/dkms.conf
+ sed -i '$i\
+BUILT_MODULE_NAME[0]="nvidia"\
+BUILT_MODULE_LOCATION[0]="kernel-open"\
+DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\
+BUILT_MODULE_NAME[1]="nvidia-uvm"\
+BUILT_MODULE_LOCATION[1]="kernel-open"\
+DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\
+BUILT_MODULE_NAME[2]="nvidia-modeset"\
+BUILT_MODULE_LOCATION[2]="kernel-open"\
+DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\
+BUILT_MODULE_NAME[3]="nvidia-drm"\
+BUILT_MODULE_LOCATION[3]="kernel-open"\
+DEST_MODULE_LOCATION[3]="/kernel/drivers/video"\
+BUILT_MODULE_NAME[4]="nvidia-peermem"\
+BUILT_MODULE_LOCATION[4]="kernel-open"\
+DEST_MODULE_LOCATION[4]="/kernel/drivers/video"' kernel-open/dkms.conf
+
+ # Clean version for later copying for DKMS
+ cp -r ../open-gpu-kernel-modules-${pkgver} "$srcdir"/open-gpu-kernel-modules-dkms
+}
+
+build() {
+ cd open-gpu-kernel-modules-${pkgver}
+ make SYSSRC="/usr/src/linux"
+}
+
+package_nvidia-open() {
+ depends+=('linux')
+ conflicts=('NVIDIA-MODULE')
+ provides=('NVIDIA-MODULE')
+
+ cd open-gpu-kernel-modules-${pkgver}
+ _extradir="/usr/lib/modules/$(</usr/src/linux/version)/extramodules"
+ install -Dt "${pkgdir}${_extradir}" -m644 kernel-open/*.ko
+ find "${pkgdir}" -name '*.ko' -exec strip --strip-debug {} +
+ find "${pkgdir}" -name '*.ko' -exec xz {} +
+
+ # Force module to load even on unsupported GPUs
+ mkdir -p "$pkgdir"/usr/lib/modprobe.d
+ echo "options nvidia NVreg_OpenRmEnableUnsupportedGpus=1" > "$pkgdir"/usr/lib/modprobe.d/nvidia-open.conf
+
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname
+}
+
+package_nvidia-open-dkms() {
+ depends+=('dkms')
+ conflicts=('nvidia-open' 'NVIDIA-MODULE')
+ provides=('nvidia-open' 'NVIDIA-MODULE')
+
+ install -dm 755 "${pkgdir}"/usr/src
+ # cp -dr --no-preserve='ownership' kernel-open "${pkgdir}/usr/src/nvidia-$pkgver"
+ cp -dr --no-preserve='ownership' open-gpu-kernel-modules-dkms "${pkgdir}/usr/src/nvidia-$pkgver"
+ mv "${pkgdir}/usr/src/nvidia-$pkgver/kernel-open/dkms.conf" "${pkgdir}/usr/src/nvidia-$pkgver/dkms.conf"
+
+ # Force module to load even on unsupported GPUs
+ mkdir -p "$pkgdir"/usr/lib/modprobe.d
+ echo "options nvidia NVreg_OpenRmEnableUnsupportedGpus=1" > "$pkgdir"/usr/lib/modprobe.d/nvidia-open.conf
+
+ install -Dm644 open-gpu-kernel-modules-${pkgver}/COPYING "$pkgdir"/usr/share/licenses/$pkgname
+}
+
+# vim:set sw=2 et:
Copied: nvidia-open/repos/staging-x86_64/nvidia-open-gcc-ibt-sls.patch (from rev 449650, nvidia-open/trunk/nvidia-open-gcc-ibt-sls.patch)
===================================================================
--- staging-x86_64/nvidia-open-gcc-ibt-sls.patch (rev 0)
+++ staging-x86_64/nvidia-open-gcc-ibt-sls.patch 2022-06-30 00:32:56 UTC (rev 449651)
@@ -0,0 +1,28 @@
+diff --git a/src/nvidia-modeset/Makefile b/src/nvidia-modeset/Makefile
+index c63b86b..a67d2fc 100644
+--- a/src/nvidia-modeset/Makefile
++++ b/src/nvidia-modeset/Makefile
+@@ -95,7 +95,8 @@ CFLAGS += -ffunction-sections
+ CFLAGS += -fdata-sections
+ CFLAGS += -ffreestanding
+
+-CONDITIONAL_CFLAGS := $(call TEST_CC_ARG, -fcf-protection=none)
++CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=branch)
++CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
+ CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -Wformat-overflow=2)
+ CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -Wformat-truncation=1)
+ ifeq ($(TARGET_ARCH),x86_64)
+diff --git a/src/nvidia/Makefile b/src/nvidia/Makefile
+index 9bdb826..3f1e330 100644
+--- a/src/nvidia/Makefile
++++ b/src/nvidia/Makefile
+@@ -119,7 +119,8 @@ CFLAGS += -fdata-sections
+ NV_KERNEL_O_LDFLAGS += --gc-sections
+ EXPORTS_LINK_COMMAND = exports_link_command.txt
+
+-CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=none)
++CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=branch -mindirect-branch-register)
++CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
+
+ ifeq ($(TARGET_ARCH),x86_64)
+ CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
More information about the arch-commits
mailing list