2020-01-24 20:59:35

by H.J. Lu

[permalink] [raw]
Subject: Re: [PATCH] x86: Don't clare __force_order in kaslr_64.c

On Fri, Jan 24, 2020 at 10:24 AM Andy Lutomirski <[email protected]> wrote:
>
>
>
> > On Jan 24, 2020, at 10:18 AM, H.J. Lu <[email protected]> wrote:
> >
> > GCC 10 changed the default to -fno-common, which leads to
> >
> > LD arch/x86/boot/compressed/vmlinux
> > ld: arch/x86/boot/compressed/pgtable_64.o:(.bss+0x0): multiple definition of `__force_order'; arch/x86/boot/compressed/kaslr_64.o:(.bss+0x0): first defined here
> > make[2]: *** [arch/x86/boot/compressed/Makefile:119: arch/x86/boot/compressed/vmlinux] Error 1
> >
> > Since __force_order is already provided in pgtable_64.c, there is no
> > need to declare __force_order in kaslr_64.c.
>
> Why does anything actually define that variable? Surely any actual references are just an outright bug. Is it needed for LTO?

It is needed by GCC 10 without LTO.

--
H.J.


2020-01-24 21:00:50

by H.J. Lu

[permalink] [raw]
Subject: [PATCH] x86: Don't declare __force_order in kaslr_64.c

On Fri, Jan 24, 2020 at 10:39 AM H.J. Lu <[email protected]> wrote:
>
> On Fri, Jan 24, 2020 at 10:24 AM Andy Lutomirski <[email protected]> wrote:
> >
> >
> >
> > > On Jan 24, 2020, at 10:18 AM, H.J. Lu <[email protected]> wrote:
> > >
> > > GCC 10 changed the default to -fno-common, which leads to
> > >
> > > LD arch/x86/boot/compressed/vmlinux
> > > ld: arch/x86/boot/compressed/pgtable_64.o:(.bss+0x0): multiple definition of `__force_order'; arch/x86/boot/compressed/kaslr_64.o:(.bss+0x0): first defined here
> > > make[2]: *** [arch/x86/boot/compressed/Makefile:119: arch/x86/boot/compressed/vmlinux] Error 1
> > >
> > > Since __force_order is already provided in pgtable_64.c, there is no
> > > need to declare __force_order in kaslr_64.c.
> >
> > Why does anything actually define that variable? Surely any actual references are just an outright bug. Is it needed for LTO?
>
> It is needed by GCC 10 without LTO.
>

This updated patch fixed a typo in Subject: "care" -> "declare".


--
H.J.


Attachments:
0001-x86-Don-t-declare-__force_order-in-kaslr_64.c.patch (1.36 kB)

2020-02-18 10:47:32

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] x86: Don't declare __force_order in kaslr_64.c

On Fri, Jan 24, 2020 at 10:44:30AM -0800, H.J. Lu wrote:
> This updated patch fixed a typo in Subject: "care" -> "declare".
>
> From c8c26194cf5a344cd53763eaaf16c3ab609736f4 Mon Sep 17 00:00:00 2001
> From: "H.J. Lu" <[email protected]>
> Date: Thu, 16 Jan 2020 12:46:51 -0800
> Subject: [PATCH] x86: Don't declare __force_order in kaslr_64.c
>
> GCC 10 changed the default to -fno-common, which leads to
>
> LD arch/x86/boot/compressed/vmlinux
> ld: arch/x86/boot/compressed/pgtable_64.o:(.bss+0x0): multiple definition of `__force_order'; arch/x86/boot/compressed/kaslr_64.o:(.bss+0x0): first defined here
> make[2]: *** [arch/x86/boot/compressed/Makefile:119: arch/x86/boot/compressed/vmlinux] Error 1
>
> Since __force_order is already provided in pgtable_64.c, there is no
> need to declare __force_order in kaslr_64.c.
>
> Signed-off-by: H.J. Lu <[email protected]>
> Signed-off-by: Yu-cheng Yu <[email protected]>

What is Yu-cheng's SOB supposed to mean here?

The only case where it would make sense is if he's sending this patch
but he isn't. So what's up?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

2020-02-18 11:39:53

by H.J. Lu

[permalink] [raw]
Subject: Re: [PATCH] x86: Don't declare __force_order in kaslr_64.c

On Tue, Feb 18, 2020 at 2:45 AM Borislav Petkov <[email protected]> wrote:
>
> On Fri, Jan 24, 2020 at 10:44:30AM -0800, H.J. Lu wrote:
> > This updated patch fixed a typo in Subject: "care" -> "declare".
> >
> > From c8c26194cf5a344cd53763eaaf16c3ab609736f4 Mon Sep 17 00:00:00 2001
> > From: "H.J. Lu" <[email protected]>
> > Date: Thu, 16 Jan 2020 12:46:51 -0800
> > Subject: [PATCH] x86: Don't declare __force_order in kaslr_64.c
> >
> > GCC 10 changed the default to -fno-common, which leads to
> >
> > LD arch/x86/boot/compressed/vmlinux
> > ld: arch/x86/boot/compressed/pgtable_64.o:(.bss+0x0): multiple definition of `__force_order'; arch/x86/boot/compressed/kaslr_64.o:(.bss+0x0): first defined here
> > make[2]: *** [arch/x86/boot/compressed/Makefile:119: arch/x86/boot/compressed/vmlinux] Error 1
> >
> > Since __force_order is already provided in pgtable_64.c, there is no
> > need to declare __force_order in kaslr_64.c.
> >
> > Signed-off-by: H.J. Lu <[email protected]>
> > Signed-off-by: Yu-cheng Yu <[email protected]>
>
> What is Yu-cheng's SOB supposed to mean here?
>
> The only case where it would make sense is if he's sending this patch
> but he isn't. So what's up?
>

I wrote this patch as the part of the previous CET patch set Yu-cheng submitted.
Since this is a standalone patch, he asked me to send it separately. I didn't
remove Yu-cheng's SOB when I submitted this patch.

--
H.J.

2020-02-18 13:38:38

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] x86: Don't declare __force_order in kaslr_64.c

On Tue, Feb 18, 2020 at 03:38:54AM -0800, H.J. Lu wrote:
> I wrote this patch as the part of the previous CET patch set Yu-cheng submitted.
> Since this is a standalone patch, he asked me to send it separately. I didn't
> remove Yu-cheng's SOB when I submitted this patch.

Ok, dropping it.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette