From ff9ea8d5ee9cabc69f4770ca73f7c9dc60cb1da9 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Tue, 5 Jul 2016 17:16:19 +0200 Subject: [PATCH] nvidia_linux 340.90: Fix build error with Linux 4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the error below [1]. ``` […] /scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel/os-mlock.c:48:11: error: too many arguments to function ‘get_user_pages’ ret = get_user_pages(current, mm, (unsigned long)address, ^ In file included from /scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel/nv-linux.h:68:0, from /scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel/os-mlock.c:15: include/linux/mm.h:1266:6: note: declared here long get_user_pages(unsigned long start, unsigned long nr_pages, ^ /scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel/os-mlock.c:61:13: error: implicit declaration of function ‘page_cache_release’ [-Werror=implicit-function-declaration] page_cache_release(user_pages[i]); ^ cc1: some warnings being treated as errors scripts/Makefile.build:291: recipe for target '/scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel/os-mlock.o' failed make[2]: *** [/scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel/os-mlock.o] Error 1 Makefile:1429: recipe for target '_module_/scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel' failed make[1]: *** [_module_/scratch/local/bee-root/nvidia/nvidia_linux-4.6.3-91-340.96-0/source/kernel] Error 2 make[1]: Leaving directory '/scratch/local/linux-4.6.3-91.x86_64/source' NVIDIA: left KBUILD. nvidia.ko failed to build! Makefile:184: recipe for target 'nvidia.ko' failed make: *** [nvidia.ko] Error 1 ``` [1] https://github.com/manjaro/packages-extra/commit/ddae91f20ddf82874fce8604f86c12711f718994 --- nvidia_linux-4.6.3-91-340.96-0.bee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvidia_linux-4.6.3-91-340.96-0.bee b/nvidia_linux-4.6.3-91-340.96-0.bee index a1efa971c..5721d14dc 100755 --- a/nvidia_linux-4.6.3-91-340.96-0.bee +++ b/nvidia_linux-4.6.3-91-340.96-0.bee @@ -71,6 +71,11 @@ mee_extract() { print_info "using kernel sources from ${LINUXSRCDIR} .." } +mee_patch() { + # get_user_pages() to not pass tsk/mm; d4edcf0d56958db0aca0196314ca38a5e730ea92 + sed -i 's|get_user_pages(current, mm, |get_user_pages(|g' "${S}"/os-mlock.c +} + mee_build_pre() { ln -s ${LINUXSRCDIR}/include ${S}/include }