From 59d62b3092bde3e3862ae2882c6054e918d8cd84 Mon Sep 17 00:00:00 2001 From: Helmut Pozimski Date: Wed, 27 Sep 2017 14:11:35 +0200 Subject: [PATCH] nvidia340: fix build issues on x86_64 re-introduce compatibility patch for nvidia-uvm_lite needed due to changes in vm_operations_struct in linux-4.11 and above. Closes: #7844 [via git-merge-pr] --- srcpkgs/nvidia340/files/kernel-4.11.patch | 38 +++++++++++++++++++++++ srcpkgs/nvidia340/template | 7 ++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/nvidia340/files/kernel-4.11.patch diff --git a/srcpkgs/nvidia340/files/kernel-4.11.patch b/srcpkgs/nvidia340/files/kernel-4.11.patch new file mode 100644 index 00000000000..b2b3a7a9d95 --- /dev/null +++ b/srcpkgs/nvidia340/files/kernel-4.11.patch @@ -0,0 +1,38 @@ +--- kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:50:46.334075042 +0200 ++++ kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:56:06.358041280 +0200 +@@ -818,7 +818,11 @@ + } + + #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + int _fault(struct vm_area_struct *vma, struct vm_fault *vmf) ++#else ++int _fault(struct vm_fault *vmf) ++#endif + { + #if defined(NV_VM_FAULT_HAS_ADDRESS) + unsigned long vaddr = vmf->address; +@@ -828,7 +832,11 @@ + struct page *page = NULL; + int retval; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + retval = _fault_common(vma, vaddr, &page, vmf->flags); ++#else ++ retval = _fault_common(NULL, vaddr, &page, vmf->flags); ++#endif + + vmf->page = page; + +@@ -866,7 +874,11 @@ + // it's dealing with anonymous mapping (see handle_pte_fault). + // + #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ++#else ++int _sigbus_fault(struct vm_fault *vmf) ++#endif + { + vmf->page = NULL; + return VM_FAULT_SIGBUS; diff --git a/srcpkgs/nvidia340/template b/srcpkgs/nvidia340/template index 7aba09590bb..f62f5f753cd 100644 --- a/srcpkgs/nvidia340/template +++ b/srcpkgs/nvidia340/template @@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)" pkgname=nvidia340 version=340.104 -revision=1 +revision=2 maintainer="Juan RP " license="Proprietary NVIDIA license" homepage="http://www.nvidia.com" @@ -38,6 +38,11 @@ do_extract() { rm -f ${_pkg}.run } +do_configure() { + cd ${_pkg} + patch -p0 < ${FILESDIR}/kernel-4.11.patch +} + do_install() { cd ${_pkg}