[4/4] linux-yocto: Fix build with gcc10

Submitted by Khem Raj on Dec. 22, 2019, 4:05 a.m. | Patch ID: 168295

Details

Message ID 20191222040549.286151-4-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj Dec. 22, 2019, 4:05 a.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 ...sed-64-Define-__force_order-only-whe.patch | 42 +++++++++++++++++++
 meta/recipes-kernel/linux/linux-yocto_5.2.bb  |  2 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch

Patch hide | download patch | download mbox

diff --git a/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch b/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
new file mode 100644
index 0000000000..bd48de6dd9
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
@@ -0,0 +1,42 @@ 
+From 199caf12cdbe24796dc31fbd4fe5729ba2acf659 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Dec 2019 17:42:02 -0800
+Subject: [PATCH] x86/boot/compressed/64: Define __force_order only when
+ CONFIG_RANDOMIZE_BASE is unset
+
+kaslr_64.c also defines the same variable, however when both files are
+included into final link, linker complains about multiple definition of
+`__force_order' which is coming from kaslr_64.o and pgtable_64.o, its
+possible that kaslr_64.o is disabled via CONFIG_RANDOMIZE_BASE config
+option, therefore define it conditionally only when
+CONFIG_RANDOMIZE_BASE is not set
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+Cc: Kees Cook <keescook@chromium.org>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: x86-ml <x86@kernel.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+---
+ arch/x86/boot/compressed/pgtable_64.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
+index c8862696a47b..077d19268b0b 100644
+--- a/arch/x86/boot/compressed/pgtable_64.c
++++ b/arch/x86/boot/compressed/pgtable_64.c
+@@ -12,7 +12,9 @@
+  * It is not referenced from the code, but GCC < 5 with -fPIE would fail
+  * due to an undefined symbol. Define it to make these ancient GCCs work.
+  */
++#ifndef CONFIG_RANDOMIZE_BASE
+ unsigned long __force_order;
++#endif
+ 
+ #define BIOS_START_MIN		0x20000U	/* 128K, less than this is insane */
+ #define BIOS_START_MAX		0x9f000U	/* 640K, absolute maximum */
+-- 
+2.24.1
+
diff --git a/meta/recipes-kernel/linux/linux-yocto_5.2.bb b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
index ff0f547399..5af0924808 100644
--- a/meta/recipes-kernel/linux/linux-yocto_5.2.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
@@ -29,6 +29,8 @@  SRCREV_meta ?= "bd0762cd138f1624b5a5f8669cfa3ac2b71cb87b"
 SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.2;destsuffix=${KMETA}"
 
+SRC_URI += "file://0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch"
+
 LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
 LINUX_VERSION ?= "5.2.20"
 

Comments

Bruce Ashfield Dec. 22, 2019, 5:04 p.m.
On Sat, Dec 21, 2019 at 11:06 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Bruce Ashfield <bruce.ashfield@gmail.com>

Thanks Khem!

As usual, please don't merge this patch directly, I'll apply it for
linux-yocto* and linux-yocto-dev so we have full coverage on the
reference kernels.

I can send SRCREV bumps tonight, once I've done some quick build tests.

Bruce

> ---
>  ...sed-64-Define-__force_order-only-whe.patch | 42 +++++++++++++++++++
>  meta/recipes-kernel/linux/linux-yocto_5.2.bb  |  2 +
>  2 files changed, 44 insertions(+)
>  create mode 100644 meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
>
> diff --git a/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch b/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
> new file mode 100644
> index 0000000000..bd48de6dd9
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
> @@ -0,0 +1,42 @@
> +From 199caf12cdbe24796dc31fbd4fe5729ba2acf659 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Fri, 20 Dec 2019 17:42:02 -0800
> +Subject: [PATCH] x86/boot/compressed/64: Define __force_order only when
> + CONFIG_RANDOMIZE_BASE is unset
> +
> +kaslr_64.c also defines the same variable, however when both files are
> +included into final link, linker complains about multiple definition of
> +`__force_order' which is coming from kaslr_64.o and pgtable_64.o, its
> +possible that kaslr_64.o is disabled via CONFIG_RANDOMIZE_BASE config
> +option, therefore define it conditionally only when
> +CONFIG_RANDOMIZE_BASE is not set
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> +Cc: Kees Cook <keescook@chromium.org>
> +Cc: "H. Peter Anvin" <hpa@zytor.com>
> +Cc: Ingo Molnar <mingo@redhat.com>
> +Cc: Thomas Gleixner <tglx@linutronix.de>
> +Cc: x86-ml <x86@kernel.org>
> +Cc: Arnd Bergmann <arnd@arndb.de>
> +---
> + arch/x86/boot/compressed/pgtable_64.c | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
> +index c8862696a47b..077d19268b0b 100644
> +--- a/arch/x86/boot/compressed/pgtable_64.c
> ++++ b/arch/x86/boot/compressed/pgtable_64.c
> +@@ -12,7 +12,9 @@
> +  * It is not referenced from the code, but GCC < 5 with -fPIE would fail
> +  * due to an undefined symbol. Define it to make these ancient GCCs work.
> +  */
> ++#ifndef CONFIG_RANDOMIZE_BASE
> + unsigned long __force_order;
> ++#endif
> +
> + #define BIOS_START_MIN                0x20000U        /* 128K, less than this is insane */
> + #define BIOS_START_MAX                0x9f000U        /* 640K, absolute maximum */
> +--
> +2.24.1
> +
> diff --git a/meta/recipes-kernel/linux/linux-yocto_5.2.bb b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> index ff0f547399..5af0924808 100644
> --- a/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> @@ -29,6 +29,8 @@ SRCREV_meta ?= "bd0762cd138f1624b5a5f8669cfa3ac2b71cb87b"
>  SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
>             git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.2;destsuffix=${KMETA}"
>
> +SRC_URI += "file://0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch"
> +
>  LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
>  LINUX_VERSION ?= "5.2.20"
>
> --
> 2.24.1
>
Bruce Ashfield Dec. 22, 2019, 5:37 p.m.
On Sun, Dec 22, 2019 at 12:04 PM Bruce Ashfield
<bruce.ashfield@gmail.com> wrote:
>
> On Sat, Dec 21, 2019 at 11:06 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> Thanks Khem!
>
> As usual, please don't merge this patch directly, I'll apply it for
> linux-yocto* and linux-yocto-dev so we have full coverage on the
> reference kernels.

FYI: The integrated patch is here:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=zedd/kernel-next

My other -stable bumps are still pending, so I'm waiting for them to
merge, so I can send the patch (since it needs those SRCREV bumps).

Bruce

>
> I can send SRCREV bumps tonight, once I've done some quick build tests.
>
> Bruce
>
> > ---
> >  ...sed-64-Define-__force_order-only-whe.patch | 42 +++++++++++++++++++
> >  meta/recipes-kernel/linux/linux-yocto_5.2.bb  |  2 +
> >  2 files changed, 44 insertions(+)
> >  create mode 100644 meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
> >
> > diff --git a/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch b/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
> > new file mode 100644
> > index 0000000000..bd48de6dd9
> > --- /dev/null
> > +++ b/meta/recipes-kernel/linux/files/0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch
> > @@ -0,0 +1,42 @@
> > +From 199caf12cdbe24796dc31fbd4fe5729ba2acf659 Mon Sep 17 00:00:00 2001
> > +From: Khem Raj <raj.khem@gmail.com>
> > +Date: Fri, 20 Dec 2019 17:42:02 -0800
> > +Subject: [PATCH] x86/boot/compressed/64: Define __force_order only when
> > + CONFIG_RANDOMIZE_BASE is unset
> > +
> > +kaslr_64.c also defines the same variable, however when both files are
> > +included into final link, linker complains about multiple definition of
> > +`__force_order' which is coming from kaslr_64.o and pgtable_64.o, its
> > +possible that kaslr_64.o is disabled via CONFIG_RANDOMIZE_BASE config
> > +option, therefore define it conditionally only when
> > +CONFIG_RANDOMIZE_BASE is not set
> > +
> > +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > +Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > +Cc: Kees Cook <keescook@chromium.org>
> > +Cc: "H. Peter Anvin" <hpa@zytor.com>
> > +Cc: Ingo Molnar <mingo@redhat.com>
> > +Cc: Thomas Gleixner <tglx@linutronix.de>
> > +Cc: x86-ml <x86@kernel.org>
> > +Cc: Arnd Bergmann <arnd@arndb.de>
> > +---
> > + arch/x86/boot/compressed/pgtable_64.c | 2 ++
> > + 1 file changed, 2 insertions(+)
> > +
> > +diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
> > +index c8862696a47b..077d19268b0b 100644
> > +--- a/arch/x86/boot/compressed/pgtable_64.c
> > ++++ b/arch/x86/boot/compressed/pgtable_64.c
> > +@@ -12,7 +12,9 @@
> > +  * It is not referenced from the code, but GCC < 5 with -fPIE would fail
> > +  * due to an undefined symbol. Define it to make these ancient GCCs work.
> > +  */
> > ++#ifndef CONFIG_RANDOMIZE_BASE
> > + unsigned long __force_order;
> > ++#endif
> > +
> > + #define BIOS_START_MIN                0x20000U        /* 128K, less than this is insane */
> > + #define BIOS_START_MAX                0x9f000U        /* 640K, absolute maximum */
> > +--
> > +2.24.1
> > +
> > diff --git a/meta/recipes-kernel/linux/linux-yocto_5.2.bb b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> > index ff0f547399..5af0924808 100644
> > --- a/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> > +++ b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> > @@ -29,6 +29,8 @@ SRCREV_meta ?= "bd0762cd138f1624b5a5f8669cfa3ac2b71cb87b"
> >  SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
> >             git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.2;destsuffix=${KMETA}"
> >
> > +SRC_URI += "file://0001-x86-boot-compressed-64-Define-__force_order-only-whe.patch"
> > +
> >  LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
> >  LINUX_VERSION ?= "5.2.20"
> >
> > --
> > 2.24.1
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II