From 4c6dd3d573dd86c4fb00c1857277effe577c6a2b Mon Sep 17 00:00:00 2001 From: Andrey Lebedev Date: Sat, 25 Jan 2020 12:43:10 +0200 Subject: [PATCH] linux-sunxi: fix compilation issue on gcc-9 Error comes in form of /tmp/ccCGMQmS.s:648: Error: .err encountered Tested on zeus branch of linux-sunxi. --- ...gcc5-fixes.patch => 0003-gcc5-fixes.patch} | 0 .../0004-arm-put-user-asm-fix.patch | 29 +++++++++++++++++++ .../linux-sunxi/0005-silence-warning.patch | 25 ++++++++++++++++ recipes-kernel/linux/linux-sunxi_3.4.bb | 5 +++- 4 files changed, 58 insertions(+), 1 deletion(-) rename recipes-kernel/linux/linux-sunxi/{0001-gcc5-fixes.patch => 0003-gcc5-fixes.patch} (100%) create mode 100644 recipes-kernel/linux/linux-sunxi/0004-arm-put-user-asm-fix.patch create mode 100644 recipes-kernel/linux/linux-sunxi/0005-silence-warning.patch diff --git a/recipes-kernel/linux/linux-sunxi/0001-gcc5-fixes.patch b/recipes-kernel/linux/linux-sunxi/0003-gcc5-fixes.patch similarity index 100% rename from recipes-kernel/linux/linux-sunxi/0001-gcc5-fixes.patch rename to recipes-kernel/linux/linux-sunxi/0003-gcc5-fixes.patch diff --git a/recipes-kernel/linux/linux-sunxi/0004-arm-put-user-asm-fix.patch b/recipes-kernel/linux/linux-sunxi/0004-arm-put-user-asm-fix.patch new file mode 100644 index 0000000..cf9305c --- /dev/null +++ b/recipes-kernel/linux/linux-sunxi/0004-arm-put-user-asm-fix.patch @@ -0,0 +1,29 @@ +From 25a7e85eb0d58479f7d8895b1b29a648bd07d60e Mon Sep 17 00:00:00 2001 +From: Andrey Lebedev +Date: Mon, 20 Jan 2020 23:19:51 +0200 +Subject: [PATCH 2/2] Fix asm error in put_user under gcc version 8 and above + +Fixes these errors during compilation of linux-sunxi-3.4 kernel: +/tmp/ccCGMQmS.s:648: Error: .err encountered + +Taken from https://patchwork.kernel.org/patch/10546809/ +--- + arch/arm/include/asm/uaccess.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h +index b04850fd..abfafbbf 100644 +--- a/arch/arm/include/asm/uaccess.h ++++ b/arch/arm/include/asm/uaccess.h +@@ -159,7 +159,7 @@ extern int __put_user_8(void *, unsigned long long); + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + const typeof(*(p)) __user *__tmp_p = (p); \ +- register const typeof(*(p)) __r2 asm("r2") = (x); \ ++ register typeof(*(p)) __r2 asm("r2") = (x); \ + register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ +-- +2.20.1 + diff --git a/recipes-kernel/linux/linux-sunxi/0005-silence-warning.patch b/recipes-kernel/linux/linux-sunxi/0005-silence-warning.patch new file mode 100644 index 0000000..e0c9291 --- /dev/null +++ b/recipes-kernel/linux/linux-sunxi/0005-silence-warning.patch @@ -0,0 +1,25 @@ +From 302604ee4a2011871cb26deaf69d567cf57d0fe3 Mon Sep 17 00:00:00 2001 +From: Andrey Lebedev +Date: Mon, 20 Jan 2020 23:20:07 +0200 +Subject: [PATCH 1/2] Silence annoying warning + +--- + include/linux/log2.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/log2.h b/include/linux/log2.h +index fd7ff3d9..14458fdd 100644 +--- a/include/linux/log2.h ++++ b/include/linux/log2.h +@@ -18,7 +18,7 @@ + /* + * deal with unrepresentable constant logarithms + */ +-extern __attribute__((const, noreturn)) ++extern __attribute__((const)) + int ____ilog2_NaN(void); + + /* +-- +2.20.1 + diff --git a/recipes-kernel/linux/linux-sunxi_3.4.bb b/recipes-kernel/linux/linux-sunxi_3.4.bb index 69fcef2..80f32b8 100644 --- a/recipes-kernel/linux/linux-sunxi_3.4.bb +++ b/recipes-kernel/linux/linux-sunxi_3.4.bb @@ -14,9 +14,12 @@ MACHINE_KERNEL_PR_append = "a" SRC_URI += "git://github.com/linux-sunxi/linux-sunxi.git;branch=sunxi-3.4;protocol=git \ file://0001-compiler-gcc-integrate-the-various-compiler-gcc-345-.patch \ file://0002-use-static-inline-in-ARM-ftrace.patch \ - file://0001-gcc5-fixes.patch \ + file://0003-gcc5-fixes.patch \ + file://0004-arm-put-user-asm-fix.patch \ + file://0005-silence-warning.patch \ file://defconfig \ " +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" S = "${WORKDIR}/git"