* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
@ 2023-01-03 11:45 ` Conor Dooley
2023-01-03 12:22 ` Guenter Roeck
` (5 subsequent siblings)
6 siblings, 0 replies; 24+ messages in thread
From: Conor Dooley @ 2023-01-03 11:45 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Linus Torvalds, Guenter Roeck, Jason A. Donenfeld,
Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Masahiro Yamada, Palmer Dabbelt
[-- Attachment #1: Type: text/plain, Size: 3298 bytes --]
On Tue, Jan 03, 2023 at 11:58:48AM +0100, Ard Biesheuvel wrote:
> On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > ... and reverting commit 99cb0d917ff indeed fixes the problem.
> >
> > Hmm. My gut feel is that this just exposes some bug in binutils.
> >
> > That said, maybe that commit should not have added its own /DISCARDS/
> > thing, and instead just added that "*(.note.GNU-stack)" to the general
> > /DISCARDS/ thing that is defined by the
> >
> > #define DISCARDS ..
> >
> > a little bit later, so that we only end up with one single DISCARD
> > list. Something like this (broken patch on purpose):
> >
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -897,5 +897,4 @@
> > */
> > #define NOTES \
> > - /DISCARD/ : { *(.note.GNU-stack) } \
> > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > BOUNDED_SECTION_BY(.note.*, _notes) \
> > @@ -1016,4 +1015,5 @@
> > #define DISCARDS \
> > /DISCARD/ : { \
> > + *(.note.GNU-stack) \
> > EXIT_DISCARDS \
> > EXIT_CALL \
> >
> > But maybe that DISCARDS macrop ends up being used too late?
> >
>
> Masahiro's v1 did something like this, and it caused an issue on
> RISC-V, which is why we ended up with this approach instead.
FWIW, I gave this one a go & it didn't produce the link failures that
Masahiro's v1 did on RISC-V...
> > It really shouldn't matter, but here we are, with a build problem with
> > some random old binutils on an odd platform..
> >
>
> AIUI, the way ld.bfd used to combine output sections may also affect
> the /DISCARD/ pseudo-section, and so introducing it much earlier
> results in these discards to be interpreted in a different order.
>
> The purpose of this change is to prevent .note.GNU-stack from deciding
> the section type of the .notes output section, and so keeping it in
> its own section should be sufficient. E.g.,
>
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -896,7 +896,7 @@
> * Otherwise, the type of .notes section would become PROGBITS
> instead of NOTES.
> */
> #define NOTES \
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
> .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> BOUNDED_SECTION_BY(.note.*, _notes) \
> } NOTES_HEADERS \
>
> The .note.GNU-stack has zero size, so the result should be the same.
...and this one doesn't move DISCARDS around either, so also shouldn't
hit that issue. Famous last words, so I did run it through a config that
produced the link failures before & it was fine.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
2023-01-03 11:45 ` Conor Dooley
@ 2023-01-03 12:22 ` Guenter Roeck
2023-01-03 18:26 ` Nathan Chancellor
` (4 subsequent siblings)
6 siblings, 0 replies; 24+ messages in thread
From: Guenter Roeck @ 2023-01-03 12:22 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Linus Torvalds, Jason A. Donenfeld, Yoshinori Sato, Rich Felker,
Arnd Bergmann, Linux Kernel Mailing List, Masahiro Yamada,
Palmer Dabbelt
On Tue, Jan 03, 2023 at 11:58:48AM +0100, Ard Biesheuvel wrote:
> On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > ... and reverting commit 99cb0d917ff indeed fixes the problem.
> >
> > Hmm. My gut feel is that this just exposes some bug in binutils.
> >
> > That said, maybe that commit should not have added its own /DISCARDS/
> > thing, and instead just added that "*(.note.GNU-stack)" to the general
> > /DISCARDS/ thing that is defined by the
> >
> > #define DISCARDS ..
> >
> > a little bit later, so that we only end up with one single DISCARD
> > list. Something like this (broken patch on purpose):
> >
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -897,5 +897,4 @@
> > */
> > #define NOTES \
> > - /DISCARD/ : { *(.note.GNU-stack) } \
> > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > BOUNDED_SECTION_BY(.note.*, _notes) \
> > @@ -1016,4 +1015,5 @@
> > #define DISCARDS \
> > /DISCARD/ : { \
> > + *(.note.GNU-stack) \
> > EXIT_DISCARDS \
> > EXIT_CALL \
> >
> > But maybe that DISCARDS macrop ends up being used too late?
> >
>
> Masahiro's v1 did something like this, and it caused an issue on
> RISC-V, which is why we ended up with this approach instead.
>
> > It really shouldn't matter, but here we are, with a build problem with
> > some random old binutils on an odd platform..
> >
>
> AIUI, the way ld.bfd used to combine output sections may also affect
> the /DISCARD/ pseudo-section, and so introducing it much earlier
> results in these discards to be interpreted in a different order.
>
> The purpose of this change is to prevent .note.GNU-stack from deciding
> the section type of the .notes output section, and so keeping it in
> its own section should be sufficient. E.g.,
>
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -896,7 +896,7 @@
> * Otherwise, the type of .notes section would become PROGBITS
> instead of NOTES.
> */
> #define NOTES \
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
> .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> BOUNDED_SECTION_BY(.note.*, _notes) \
> } NOTES_HEADERS \
>
> The .note.GNU-stack has zero size, so the result should be the same.
The above fixes the problem for sh.
Guenter
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
2023-01-03 11:45 ` Conor Dooley
2023-01-03 12:22 ` Guenter Roeck
@ 2023-01-03 18:26 ` Nathan Chancellor
2023-01-03 18:34 ` Linus Torvalds
` (3 subsequent siblings)
6 siblings, 0 replies; 24+ messages in thread
From: Nathan Chancellor @ 2023-01-03 18:26 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Linus Torvalds, Guenter Roeck, Jason A. Donenfeld,
Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Masahiro Yamada, Palmer Dabbelt
On Tue, Jan 03, 2023 at 11:58:48AM +0100, Ard Biesheuvel wrote:
> On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > ... and reverting commit 99cb0d917ff indeed fixes the problem.
> >
> > Hmm. My gut feel is that this just exposes some bug in binutils.
> >
> > That said, maybe that commit should not have added its own /DISCARDS/
> > thing, and instead just added that "*(.note.GNU-stack)" to the general
> > /DISCARDS/ thing that is defined by the
> >
> > #define DISCARDS ..
> >
> > a little bit later, so that we only end up with one single DISCARD
> > list. Something like this (broken patch on purpose):
> >
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -897,5 +897,4 @@
> > */
> > #define NOTES \
> > - /DISCARD/ : { *(.note.GNU-stack) } \
> > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > BOUNDED_SECTION_BY(.note.*, _notes) \
> > @@ -1016,4 +1015,5 @@
> > #define DISCARDS \
> > /DISCARD/ : { \
> > + *(.note.GNU-stack) \
> > EXIT_DISCARDS \
> > EXIT_CALL \
> >
> > But maybe that DISCARDS macrop ends up being used too late?
> >
>
> Masahiro's v1 did something like this, and it caused an issue on
> RISC-V, which is why we ended up with this approach instead.
>
> > It really shouldn't matter, but here we are, with a build problem with
> > some random old binutils on an odd platform..
> >
>
> AIUI, the way ld.bfd used to combine output sections may also affect
> the /DISCARD/ pseudo-section, and so introducing it much earlier
> results in these discards to be interpreted in a different order.
>
> The purpose of this change is to prevent .note.GNU-stack from deciding
> the section type of the .notes output section, and so keeping it in
> its own section should be sufficient. E.g.,
This appears to work for me. It fixes the build failures that
ClangBuiltLinux's CI reported and I still see a build ID for arm64's
vmlinux:
Tested-by: Nathan Chancellor <nathan@kernel.org>
I will throw this into the ClangBuiltLinux CI to make sure there are no
additional surprises but I do not expect to find anything.
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -896,7 +896,7 @@
> * Otherwise, the type of .notes section would become PROGBITS
> instead of NOTES.
> */
> #define NOTES \
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
> .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> BOUNDED_SECTION_BY(.note.*, _notes) \
> } NOTES_HEADERS \
>
> The .note.GNU-stack has zero size, so the result should be the same.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
` (2 preceding siblings ...)
2023-01-03 18:26 ` Nathan Chancellor
@ 2023-01-03 18:34 ` Linus Torvalds
2023-01-05 13:44 ` Masahiro Yamada
2023-01-04 10:34 ` Michael Ellerman
` (2 subsequent siblings)
6 siblings, 1 reply; 24+ messages in thread
From: Linus Torvalds @ 2023-01-03 18:34 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Guenter Roeck, Jason A. Donenfeld, Yoshinori Sato, Rich Felker,
Arnd Bergmann, Linux Kernel Mailing List, Masahiro Yamada,
Palmer Dabbelt
On Tue, Jan 3, 2023 at 2:59 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> The purpose of this change is to prevent .note.GNU-stack from deciding
> the section type of the .notes output section, and so keeping it in
> its own section should be sufficient. E.g.,
>
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
This seems to work for everybody, so let's go with this. Masahiro?
Linus
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 18:34 ` Linus Torvalds
@ 2023-01-05 13:44 ` Masahiro Yamada
0 siblings, 0 replies; 24+ messages in thread
From: Masahiro Yamada @ 2023-01-05 13:44 UTC (permalink / raw)
To: Linus Torvalds
Cc: Ard Biesheuvel, Guenter Roeck, Jason A. Donenfeld,
Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
On Wed, Jan 4, 2023 at 3:34 AM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Tue, Jan 3, 2023 at 2:59 AM Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > The purpose of this change is to prevent .note.GNU-stack from deciding
> > the section type of the .notes output section, and so keeping it in
> > its own section should be sufficient. E.g.,
> >
> > - /DISCARD/ : { *(.note.GNU-stack) } \
> > + .note.GNU-stack : { *(.note.GNU-stack) } \
>
> This seems to work for everybody, so let's go with this. Masahiro?
>
> Linus
Sorry for the delay, I completely missed this thread.
Tested-by: Masahiro Yamada <masahiroy@kernel.org>
It works for me, but the comment block above should be
changed accordingly, for example:
/*
- * Discard .note.GNU-stack, which is emitted as PROGBITS by the compiler.
+ * Separte note.GNU-stack, which is emitted as PROGBITS by the compiler.
* Otherwise, the type of .notes section would become PROGBITS
instead of NOTES.
*/
This change, however, leaves an empty .note.GNU-stack section in vmlinux.
I personally prefer discarding .note.GNU-stack entirely because
GNU linker does not leave empty .note.GNU-stack when linking
user-space programs.
Because I did not notice the discussion was happening in this thread,
I submitted a different approach for fixing s390, and it was quickly merged:
https://lore.kernel.org/lkml/20230105031306.1455409-1-masahiroy@kernel.org/
This approach requires RUNTIME_DISCARD_EXIT for each architecture, though.
I do not know how Michael will fix powerpc.
While I was looking into this issue,
I noticed the real issue is,
how to discard sections is up to arch maintainers.
[1] Most architectures discard .exit.* sections at run-time.
Just run
git grep EXIT_TEXT
or
find . -name vmlinux.lds.S | xargs grep "at runtime"
[2] If .exit.* is allocated, then later discarded, it is kept.
(the first occurrence wins, in other words,
the sections defined in /DISCARD/ are not necessarily discarded)
[3] Despite the fact of [1], many architectures forget to
define RUNTIME_DISCARD_EXIT.
They still work because they put DISCARD
at the end of their linker scripts.
[4] arm64 puts DISCARD at the beginning of the linker
script, and defines RUNTIME_DISCARD_EXIT because otherwise
.exit* are discarded due to the "first wins" rule.
[5] If we really want to discard more sections, we often end
up with moving DISCARD up, and at this point, we realize
that RUNTIME_DISCARD_EXIT is missing.
I think it is unreadable (and fragile)
to keep/discard sections depending on the particular
order in the linker scripts.
Is there any better approach to make sure to discard
sections defined in DISCARDS?
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
` (3 preceding siblings ...)
2023-01-03 18:34 ` Linus Torvalds
@ 2023-01-04 10:34 ` Michael Ellerman
2023-01-10 0:32 ` SeongJae Park
2023-01-13 14:59 ` Tom Saeger
6 siblings, 0 replies; 24+ messages in thread
From: Michael Ellerman @ 2023-01-04 10:34 UTC (permalink / raw)
To: Ard Biesheuvel, Linus Torvalds
Cc: Guenter Roeck, Jason A. Donenfeld, Yoshinori Sato, Rich Felker,
Arnd Bergmann, Linux Kernel Mailing List, Masahiro Yamada,
Palmer Dabbelt, linuxppc-dev
Ard Biesheuvel <ardb@kernel.org> writes:
> On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
>> >
>> > ... and reverting commit 99cb0d917ff indeed fixes the problem.
>>
>> Hmm. My gut feel is that this just exposes some bug in binutils.
...
>> It really shouldn't matter, but here we are, with a build problem with
>> some random old binutils on an odd platform..
>>
>
> AIUI, the way ld.bfd used to combine output sections may also affect
> the /DISCARD/ pseudo-section, and so introducing it much earlier
> results in these discards to be interpreted in a different order.
>
> The purpose of this change is to prevent .note.GNU-stack from deciding
> the section type of the .notes output section, and so keeping it in
> its own section should be sufficient. E.g.,
>
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -896,7 +896,7 @@
> * Otherwise, the type of .notes section would become PROGBITS
> instead of NOTES.
> */
> #define NOTES \
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
> .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> BOUNDED_SECTION_BY(.note.*, _notes) \
> } NOTES_HEADERS \
This also fixes errors seen in the powerpc build with binutils <= 2.35.
Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
cheers
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
` (4 preceding siblings ...)
2023-01-04 10:34 ` Michael Ellerman
@ 2023-01-10 0:32 ` SeongJae Park
2023-01-10 18:39 ` Masahiro Yamada
2023-01-13 14:59 ` Tom Saeger
6 siblings, 1 reply; 24+ messages in thread
From: SeongJae Park @ 2023-01-10 0:32 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Linus Torvalds, Guenter Roeck, Jason A. Donenfeld,
Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Masahiro Yamada, Palmer Dabbelt,
SeongJae Park
On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
[...]
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -896,7 +896,7 @@
> * Otherwise, the type of .notes section would become PROGBITS
> instead of NOTES.
> */
> #define NOTES \
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
> .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> BOUNDED_SECTION_BY(.note.*, _notes) \
> } NOTES_HEADERS \
>
> The .note.GNU-stack has zero size, so the result should be the same.
>
This also fixes ARCH=um build error on my system.
Tested-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-10 0:32 ` SeongJae Park
@ 2023-01-10 18:39 ` Masahiro Yamada
2023-01-10 19:14 ` SeongJae Park
0 siblings, 1 reply; 24+ messages in thread
From: Masahiro Yamada @ 2023-01-10 18:39 UTC (permalink / raw)
To: SeongJae Park
Cc: Ard Biesheuvel, Linus Torvalds, Guenter Roeck,
Jason A. Donenfeld, Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
On Tue, Jan 10, 2023 at 9:32 AM SeongJae Park <sj@kernel.org> wrote:
>
> On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
>
> > On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> > >
> > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > >
> [...]
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -896,7 +896,7 @@
> > * Otherwise, the type of .notes section would become PROGBITS
> > instead of NOTES.
> > */
> > #define NOTES \
> > - /DISCARD/ : { *(.note.GNU-stack) } \
> > + .note.GNU-stack : { *(.note.GNU-stack) } \
> > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > BOUNDED_SECTION_BY(.note.*, _notes) \
> > } NOTES_HEADERS \
> >
> > The .note.GNU-stack has zero size, so the result should be the same.
> >
>
> This also fixes ARCH=um build error on my system.
>
> Tested-by: SeongJae Park <sj@kernel.org>
I am able to build ARCH=um defconfig at least.
Can you provide the steps to reproduce the build error?
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-10 18:39 ` Masahiro Yamada
@ 2023-01-10 19:14 ` SeongJae Park
2023-01-23 9:09 ` Masahiro Yamada
0 siblings, 1 reply; 24+ messages in thread
From: SeongJae Park @ 2023-01-10 19:14 UTC (permalink / raw)
To: Masahiro Yamada
Cc: SeongJae Park, Ard Biesheuvel, Linus Torvalds, Guenter Roeck,
Jason A. Donenfeld, Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
Hi Masahiro,
On Wed, 11 Jan 2023 03:39:58 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
> On Tue, Jan 10, 2023 at 9:32 AM SeongJae Park <sj@kernel.org> wrote:
> >
> > On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > > On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> > > <torvalds@linux-foundation.org> wrote:
> > > >
> > > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > > >
> > [...]
> > > --- a/include/asm-generic/vmlinux.lds.h
> > > +++ b/include/asm-generic/vmlinux.lds.h
> > > @@ -896,7 +896,7 @@
> > > * Otherwise, the type of .notes section would become PROGBITS
> > > instead of NOTES.
> > > */
> > > #define NOTES \
> > > - /DISCARD/ : { *(.note.GNU-stack) } \
> > > + .note.GNU-stack : { *(.note.GNU-stack) } \
> > > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > > BOUNDED_SECTION_BY(.note.*, _notes) \
> > > } NOTES_HEADERS \
> > >
> > > The .note.GNU-stack has zero size, so the result should be the same.
> > >
> >
> > This also fixes ARCH=um build error on my system.
> >
> > Tested-by: SeongJae Park <sj@kernel.org>
>
>
>
> I am able to build ARCH=um defconfig at least.
>
> Can you provide the steps to reproduce the build error?
I do the build for kunit test, like below.
mkdir ../kunit.out
echo "
CONFIG_KUNIT=y
CONFIG_DAMON=y
CONFIG_DAMON_KUNIT_TEST=y
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_VADDR_KUNIT_TEST=y
CONFIG_DEBUG_FS=y
CONFIG_DAMON_DBGFS=y
CONFIG_DAMON_DBGFS_KUNIT_TEST=y
CONFIG_DAMON_PADDR=y" > ../kunit.out/.kunitconfig
./tools/testsing/kunit/kunit.py run --build_dir ../kunit.out
[19:12:37] Configuring KUnit Kernel ...
[19:12:37] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=../kunit.out/ olddefconfig
Building with:
$ make ARCH=um O=../kunit.out/ --jobs=36
ERROR:root:`.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o
collect2: error: ld returned 1 exit status
make[2]: *** [/home/sjpark/linux/scripts/Makefile.vmlinux:34: vmlinux] Error 1
make[1]: *** [/home/sjpark/linux/Makefile:1252: vmlinux] Error 2
make: *** [Makefile:242: __sub-make] Error 2
Thanks,
SJ
>
>
>
>
> --
> Best Regards
> Masahiro Yamada
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-10 19:14 ` SeongJae Park
@ 2023-01-23 9:09 ` Masahiro Yamada
2023-01-23 18:27 ` SeongJae Park
0 siblings, 1 reply; 24+ messages in thread
From: Masahiro Yamada @ 2023-01-23 9:09 UTC (permalink / raw)
To: SeongJae Park
Cc: Ard Biesheuvel, Linus Torvalds, Guenter Roeck,
Jason A. Donenfeld, Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
On Wed, Jan 11, 2023 at 4:14 AM SeongJae Park <sj@kernel.org> wrote:
>
> Hi Masahiro,
>
> On Wed, 11 Jan 2023 03:39:58 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> > On Tue, Jan 10, 2023 at 9:32 AM SeongJae Park <sj@kernel.org> wrote:
> > >
> > > On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> > >
> > > > On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> > > > <torvalds@linux-foundation.org> wrote:
> > > > >
> > > > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > > > >
> > > [...]
> > > > --- a/include/asm-generic/vmlinux.lds.h
> > > > +++ b/include/asm-generic/vmlinux.lds.h
> > > > @@ -896,7 +896,7 @@
> > > > * Otherwise, the type of .notes section would become PROGBITS
> > > > instead of NOTES.
> > > > */
> > > > #define NOTES \
> > > > - /DISCARD/ : { *(.note.GNU-stack) } \
> > > > + .note.GNU-stack : { *(.note.GNU-stack) } \
> > > > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > > > BOUNDED_SECTION_BY(.note.*, _notes) \
> > > > } NOTES_HEADERS \
> > > >
> > > > The .note.GNU-stack has zero size, so the result should be the same.
> > > >
> > >
> > > This also fixes ARCH=um build error on my system.
> > >
> > > Tested-by: SeongJae Park <sj@kernel.org>
> >
> >
> >
> > I am able to build ARCH=um defconfig at least.
> >
> > Can you provide the steps to reproduce the build error?
>
> I do the build for kunit test, like below.
>
> mkdir ../kunit.out
> echo "
> CONFIG_KUNIT=y
>
> CONFIG_DAMON=y
> CONFIG_DAMON_KUNIT_TEST=y
>
> CONFIG_DAMON_VADDR=y
> CONFIG_DAMON_VADDR_KUNIT_TEST=y
>
> CONFIG_DEBUG_FS=y
> CONFIG_DAMON_DBGFS=y
> CONFIG_DAMON_DBGFS_KUNIT_TEST=y
> CONFIG_DAMON_PADDR=y" > ../kunit.out/.kunitconfig
> ./tools/testsing/kunit/kunit.py run --build_dir ../kunit.out
> [19:12:37] Configuring KUnit Kernel ...
> [19:12:37] Building KUnit Kernel ...
> Populating config with:
> $ make ARCH=um O=../kunit.out/ olddefconfig
> Building with:
> $ make ARCH=um O=../kunit.out/ --jobs=36
> ERROR:root:`.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o
> collect2: error: ld returned 1 exit status
> make[2]: *** [/home/sjpark/linux/scripts/Makefile.vmlinux:34: vmlinux] Error 1
> make[1]: *** [/home/sjpark/linux/Makefile:1252: vmlinux] Error 2
> make: *** [Makefile:242: __sub-make] Error 2
>
>
> Thanks,
> SJ
>
I did not see the error, though.
The test seems to have succeeded.
masahiro@zoe:~/ref/linux(master)$ cat ../kunit.out/.kunitconfig
CONFIG_KUNIT=y
CONFIG_DAMON=y
CONFIG_DAMON_KUNIT_TEST=y
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_VADDR_KUNIT_TEST=y
CONFIG_DEBUG_FS=y
CONFIG_DAMON_DBGFS=y
CONFIG_DAMON_DBGFS_KUNIT_TEST=y
CONFIG_DAMON_PADDR=y
masahiro@zoe:~/ref/linux(master)$ ./tools/testing/kunit/kunit.py run
--build_dir ../kunit.out
[18:05:19] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=../kunit.out olddefconfig
[18:05:22] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=../kunit.out olddefconfig
Building with:
$ make ARCH=um O=../kunit.out --jobs=16
[18:05:47] Starting KUnit Kernel (1/1)...
[18:05:47] ============================================================
[18:05:47] ==================== damon (9 subtests) ====================
[18:05:47] [PASSED] damon_test_target
[18:05:47] [PASSED] damon_test_regions
[18:05:47] [PASSED] damon_test_aggregate
[18:05:47] [PASSED] damon_test_split_at
[18:05:47] [PASSED] damon_test_merge_two
[18:05:47] [PASSED] damon_test_merge_regions_of
[18:05:47] [PASSED] damon_test_split_regions_of
[18:05:47] [PASSED] damon_test_ops_registration
[18:05:47] [PASSED] damon_test_set_regions
[18:05:47] ====================== [PASSED] damon ======================
[18:05:47] ============== damon-operations (6 subtests) ===============
[18:05:47] [PASSED] damon_test_three_regions_in_vmas
[18:05:47] [PASSED] damon_test_apply_three_regions1
[18:05:47] [PASSED] damon_test_apply_three_regions2
[18:05:47] [PASSED] damon_test_apply_three_regions3
[18:05:47] [PASSED] damon_test_apply_three_regions4
[18:05:47] [PASSED] damon_test_split_evenly
[18:05:47] ================ [PASSED] damon-operations =================
[18:05:47] ================= damon-dbgfs (3 subtests) =================
[18:05:47] [PASSED] damon_dbgfs_test_str_to_ints
[18:05:47] [PASSED] damon_dbgfs_test_set_targets
[18:05:47] [PASSED] damon_dbgfs_test_set_init_regions
[18:05:47] =================== [PASSED] damon-dbgfs ===================
[18:05:47] ============================================================
[18:05:47] Testing complete. Ran 18 tests: passed: 18
[18:05:47] Elapsed time: 28.194s total, 3.017s configuring, 25.058s
building, 0.086s running
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-23 9:09 ` Masahiro Yamada
@ 2023-01-23 18:27 ` SeongJae Park
2023-02-06 22:56 ` SeongJae Park
0 siblings, 1 reply; 24+ messages in thread
From: SeongJae Park @ 2023-01-23 18:27 UTC (permalink / raw)
To: Masahiro Yamada
Cc: SeongJae Park, Ard Biesheuvel, Linus Torvalds, Guenter Roeck,
Jason A. Donenfeld, Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
On Mon, 23 Jan 2023 18:09:27 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
> On Wed, Jan 11, 2023 at 4:14 AM SeongJae Park <sj@kernel.org> wrote:
> >
> > Hi Masahiro,
> >
> > On Wed, 11 Jan 2023 03:39:58 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > > On Tue, Jan 10, 2023 at 9:32 AM SeongJae Park <sj@kernel.org> wrote:
> > > >
> > > > On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> > > >
> > > > > On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> > > > > <torvalds@linux-foundation.org> wrote:
> > > > > >
> > > > > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > > > > >
> > > > [...]
> > > > > --- a/include/asm-generic/vmlinux.lds.h
> > > > > +++ b/include/asm-generic/vmlinux.lds.h
> > > > > @@ -896,7 +896,7 @@
> > > > > * Otherwise, the type of .notes section would become PROGBITS
> > > > > instead of NOTES.
> > > > > */
> > > > > #define NOTES \
> > > > > - /DISCARD/ : { *(.note.GNU-stack) } \
> > > > > + .note.GNU-stack : { *(.note.GNU-stack) } \
> > > > > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > > > > BOUNDED_SECTION_BY(.note.*, _notes) \
> > > > > } NOTES_HEADERS \
> > > > >
> > > > > The .note.GNU-stack has zero size, so the result should be the same.
> > > > >
> > > >
> > > > This also fixes ARCH=um build error on my system.
> > > >
> > > > Tested-by: SeongJae Park <sj@kernel.org>
> > >
> > >
> > >
> > > I am able to build ARCH=um defconfig at least.
> > >
> > > Can you provide the steps to reproduce the build error?
> >
> > I do the build for kunit test, like below.
> >
> > mkdir ../kunit.out
> > echo "
> > CONFIG_KUNIT=y
> >
> > CONFIG_DAMON=y
> > CONFIG_DAMON_KUNIT_TEST=y
> >
> > CONFIG_DAMON_VADDR=y
> > CONFIG_DAMON_VADDR_KUNIT_TEST=y
> >
> > CONFIG_DEBUG_FS=y
> > CONFIG_DAMON_DBGFS=y
> > CONFIG_DAMON_DBGFS_KUNIT_TEST=y
> > CONFIG_DAMON_PADDR=y" > ../kunit.out/.kunitconfig
> > ./tools/testsing/kunit/kunit.py run --build_dir ../kunit.out
> > [19:12:37] Configuring KUnit Kernel ...
> > [19:12:37] Building KUnit Kernel ...
> > Populating config with:
> > $ make ARCH=um O=../kunit.out/ olddefconfig
> > Building with:
> > $ make ARCH=um O=../kunit.out/ --jobs=36
> > ERROR:root:`.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o
> > collect2: error: ld returned 1 exit status
> > make[2]: *** [/home/sjpark/linux/scripts/Makefile.vmlinux:34: vmlinux] Error 1
> > make[1]: *** [/home/sjpark/linux/Makefile:1252: vmlinux] Error 2
> > make: *** [Makefile:242: __sub-make] Error 2
> >
> >
> > Thanks,
> > SJ
> >
>
>
> I did not see the error, though.
>
> The test seems to have succeeded.
>
>
>
>
> masahiro@zoe:~/ref/linux(master)$ cat ../kunit.out/.kunitconfig
> CONFIG_KUNIT=y
>
> CONFIG_DAMON=y
> CONFIG_DAMON_KUNIT_TEST=y
>
> CONFIG_DAMON_VADDR=y
> CONFIG_DAMON_VADDR_KUNIT_TEST=y
>
> CONFIG_DEBUG_FS=y
> CONFIG_DAMON_DBGFS=y
> CONFIG_DAMON_DBGFS_KUNIT_TEST=y
> CONFIG_DAMON_PADDR=y
> masahiro@zoe:~/ref/linux(master)$ ./tools/testing/kunit/kunit.py run
> --build_dir ../kunit.out
> [18:05:19] Configuring KUnit Kernel ...
> Regenerating .config ...
> Populating config with:
> $ make ARCH=um O=../kunit.out olddefconfig
> [18:05:22] Building KUnit Kernel ...
> Populating config with:
> $ make ARCH=um O=../kunit.out olddefconfig
> Building with:
> $ make ARCH=um O=../kunit.out --jobs=16
> [18:05:47] Starting KUnit Kernel (1/1)...
> [18:05:47] ============================================================
> [18:05:47] ==================== damon (9 subtests) ====================
> [18:05:47] [PASSED] damon_test_target
> [18:05:47] [PASSED] damon_test_regions
> [18:05:47] [PASSED] damon_test_aggregate
> [18:05:47] [PASSED] damon_test_split_at
> [18:05:47] [PASSED] damon_test_merge_two
> [18:05:47] [PASSED] damon_test_merge_regions_of
> [18:05:47] [PASSED] damon_test_split_regions_of
> [18:05:47] [PASSED] damon_test_ops_registration
> [18:05:47] [PASSED] damon_test_set_regions
> [18:05:47] ====================== [PASSED] damon ======================
> [18:05:47] ============== damon-operations (6 subtests) ===============
> [18:05:47] [PASSED] damon_test_three_regions_in_vmas
> [18:05:47] [PASSED] damon_test_apply_three_regions1
> [18:05:47] [PASSED] damon_test_apply_three_regions2
> [18:05:47] [PASSED] damon_test_apply_three_regions3
> [18:05:47] [PASSED] damon_test_apply_three_regions4
> [18:05:47] [PASSED] damon_test_split_evenly
> [18:05:47] ================ [PASSED] damon-operations =================
> [18:05:47] ================= damon-dbgfs (3 subtests) =================
> [18:05:47] [PASSED] damon_dbgfs_test_str_to_ints
> [18:05:47] [PASSED] damon_dbgfs_test_set_targets
> [18:05:47] [PASSED] damon_dbgfs_test_set_init_regions
> [18:05:47] =================== [PASSED] damon-dbgfs ===================
> [18:05:47] ============================================================
> [18:05:47] Testing complete. Ran 18 tests: passed: 18
> [18:05:47] Elapsed time: 28.194s total, 3.017s configuring, 25.058s
> building, 0.086s running
Thank you for sharing your results. I think it may depend on the compiler
version, because I use a quite old compiler.
$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-23 18:27 ` SeongJae Park
@ 2023-02-06 22:56 ` SeongJae Park
2023-02-08 1:27 ` Masahiro Yamada
0 siblings, 1 reply; 24+ messages in thread
From: SeongJae Park @ 2023-02-06 22:56 UTC (permalink / raw)
To: SeongJae Park
Cc: Masahiro Yamada, Ard Biesheuvel, Linus Torvalds, Guenter Roeck,
Jason A. Donenfeld, Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
On Mon, 23 Jan 2023 18:27:32 +0000 SeongJae Park <sj@kernel.org> wrote:
> On Mon, 23 Jan 2023 18:09:27 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> > On Wed, Jan 11, 2023 at 4:14 AM SeongJae Park <sj@kernel.org> wrote:
> > >
> > > Hi Masahiro,
> > >
> > > On Wed, 11 Jan 2023 03:39:58 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
> > >
> > > > On Tue, Jan 10, 2023 at 9:32 AM SeongJae Park <sj@kernel.org> wrote:
> > > > >
> > > > > On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> > > > >
> > > > > > On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> > > > > > <torvalds@linux-foundation.org> wrote:
> > > > > > >
> > > > > > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > > > > > >
> > > > > [...]
> > > > > > --- a/include/asm-generic/vmlinux.lds.h
> > > > > > +++ b/include/asm-generic/vmlinux.lds.h
> > > > > > @@ -896,7 +896,7 @@
> > > > > > * Otherwise, the type of .notes section would become PROGBITS
> > > > > > instead of NOTES.
> > > > > > */
> > > > > > #define NOTES \
> > > > > > - /DISCARD/ : { *(.note.GNU-stack) } \
> > > > > > + .note.GNU-stack : { *(.note.GNU-stack) } \
> > > > > > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > > > > > BOUNDED_SECTION_BY(.note.*, _notes) \
> > > > > > } NOTES_HEADERS \
> > > > > >
> > > > > > The .note.GNU-stack has zero size, so the result should be the same.
> > > > > >
> > > > >
> > > > > This also fixes ARCH=um build error on my system.
> > > > >
> > > > > Tested-by: SeongJae Park <sj@kernel.org>
> > > >
> > > >
> > > >
> > > > I am able to build ARCH=um defconfig at least.
> > > >
> > > > Can you provide the steps to reproduce the build error?
> > >
> > > I do the build for kunit test, like below.
> > >
> > > mkdir ../kunit.out
> > > echo "
> > > CONFIG_KUNIT=y
> > >
> > > CONFIG_DAMON=y
> > > CONFIG_DAMON_KUNIT_TEST=y
> > >
> > > CONFIG_DAMON_VADDR=y
> > > CONFIG_DAMON_VADDR_KUNIT_TEST=y
> > >
> > > CONFIG_DEBUG_FS=y
> > > CONFIG_DAMON_DBGFS=y
> > > CONFIG_DAMON_DBGFS_KUNIT_TEST=y
> > > CONFIG_DAMON_PADDR=y" > ../kunit.out/.kunitconfig
> > > ./tools/testsing/kunit/kunit.py run --build_dir ../kunit.out
> > > [19:12:37] Configuring KUnit Kernel ...
> > > [19:12:37] Building KUnit Kernel ...
> > > Populating config with:
> > > $ make ARCH=um O=../kunit.out/ olddefconfig
> > > Building with:
> > > $ make ARCH=um O=../kunit.out/ --jobs=36
> > > ERROR:root:`.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o
> > > collect2: error: ld returned 1 exit status
> > > make[2]: *** [/home/sjpark/linux/scripts/Makefile.vmlinux:34: vmlinux] Error 1
> > > make[1]: *** [/home/sjpark/linux/Makefile:1252: vmlinux] Error 2
> > > make: *** [Makefile:242: __sub-make] Error 2
> > >
[...]
>
> Thank you for sharing your results. I think it may depend on the compiler
> version, because I use a quite old compiler.
>
> $ gcc --version
> gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
I'm still getting the failure on my setup with latest mainline. Could we merge
the fix for now? Or, was there some updates that I was missing?
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-02-06 22:56 ` SeongJae Park
@ 2023-02-08 1:27 ` Masahiro Yamada
0 siblings, 0 replies; 24+ messages in thread
From: Masahiro Yamada @ 2023-02-08 1:27 UTC (permalink / raw)
To: SeongJae Park
Cc: Ard Biesheuvel, Linus Torvalds, Guenter Roeck,
Jason A. Donenfeld, Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Palmer Dabbelt
On Tue, Feb 7, 2023 at 7:56 AM SeongJae Park <sj@kernel.org> wrote:
>
> On Mon, 23 Jan 2023 18:27:32 +0000 SeongJae Park <sj@kernel.org> wrote:
>
> > On Mon, 23 Jan 2023 18:09:27 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > > On Wed, Jan 11, 2023 at 4:14 AM SeongJae Park <sj@kernel.org> wrote:
> > > >
> > > > Hi Masahiro,
> > > >
> > > > On Wed, 11 Jan 2023 03:39:58 +0900 Masahiro Yamada <masahiroy@kernel.org> wrote:
> > > >
> > > > > On Tue, Jan 10, 2023 at 9:32 AM SeongJae Park <sj@kernel.org> wrote:
> > > > > >
> > > > > > On Tue, 3 Jan 2023 11:58:48 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> > > > > >
> > > > > > > On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> > > > > > > <torvalds@linux-foundation.org> wrote:
> > > > > > > >
> > > > > > > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > > > > > > >
> > > > > > [...]
> > > > > > > --- a/include/asm-generic/vmlinux.lds.h
> > > > > > > +++ b/include/asm-generic/vmlinux.lds.h
> > > > > > > @@ -896,7 +896,7 @@
> > > > > > > * Otherwise, the type of .notes section would become PROGBITS
> > > > > > > instead of NOTES.
> > > > > > > */
> > > > > > > #define NOTES \
> > > > > > > - /DISCARD/ : { *(.note.GNU-stack) } \
> > > > > > > + .note.GNU-stack : { *(.note.GNU-stack) } \
> > > > > > > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > > > > > > BOUNDED_SECTION_BY(.note.*, _notes) \
> > > > > > > } NOTES_HEADERS \
> > > > > > >
> > > > > > > The .note.GNU-stack has zero size, so the result should be the same.
> > > > > > >
> > > > > >
> > > > > > This also fixes ARCH=um build error on my system.
> > > > > >
> > > > > > Tested-by: SeongJae Park <sj@kernel.org>
> > > > >
> > > > >
> > > > >
> > > > > I am able to build ARCH=um defconfig at least.
> > > > >
> > > > > Can you provide the steps to reproduce the build error?
> > > >
> > > > I do the build for kunit test, like below.
> > > >
> > > > mkdir ../kunit.out
> > > > echo "
> > > > CONFIG_KUNIT=y
> > > >
> > > > CONFIG_DAMON=y
> > > > CONFIG_DAMON_KUNIT_TEST=y
> > > >
> > > > CONFIG_DAMON_VADDR=y
> > > > CONFIG_DAMON_VADDR_KUNIT_TEST=y
> > > >
> > > > CONFIG_DEBUG_FS=y
> > > > CONFIG_DAMON_DBGFS=y
> > > > CONFIG_DAMON_DBGFS_KUNIT_TEST=y
> > > > CONFIG_DAMON_PADDR=y" > ../kunit.out/.kunitconfig
> > > > ./tools/testsing/kunit/kunit.py run --build_dir ../kunit.out
> > > > [19:12:37] Configuring KUnit Kernel ...
> > > > [19:12:37] Building KUnit Kernel ...
> > > > Populating config with:
> > > > $ make ARCH=um O=../kunit.out/ olddefconfig
> > > > Building with:
> > > > $ make ARCH=um O=../kunit.out/ --jobs=36
> > > > ERROR:root:`.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o
> > > > collect2: error: ld returned 1 exit status
> > > > make[2]: *** [/home/sjpark/linux/scripts/Makefile.vmlinux:34: vmlinux] Error 1
> > > > make[1]: *** [/home/sjpark/linux/Makefile:1252: vmlinux] Error 2
> > > > make: *** [Makefile:242: __sub-make] Error 2
> > > >
> [...]
> >
> > Thank you for sharing your results. I think it may depend on the compiler
> > version, because I use a quite old compiler.
> >
> > $ gcc --version
> > gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
>
> I'm still getting the failure on my setup with latest mainline. Could we merge
> the fix for now? Or, was there some updates that I was missing?
>
>
> Thanks,
> SJ
>
> [...]
Sorry for delay. I submitted a patch.
https://lore.kernel.org/all/20230207164156.537378-1-masahiroy@kernel.org/
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Linux 6.2-rc2
2023-01-03 10:58 ` Ard Biesheuvel
` (5 preceding siblings ...)
2023-01-10 0:32 ` SeongJae Park
@ 2023-01-13 14:59 ` Tom Saeger
6 siblings, 0 replies; 24+ messages in thread
From: Tom Saeger @ 2023-01-13 14:59 UTC (permalink / raw)
To: Ard Biesheuvel, Greg Kroah-Hartman, Nick Desaulniers
Cc: Linus Torvalds, Guenter Roeck, Jason A. Donenfeld,
Yoshinori Sato, Rich Felker, Arnd Bergmann,
Linux Kernel Mailing List, Masahiro Yamada, Palmer Dabbelt,
stable
On Tue, Jan 03, 2023 at 11:58:48AM +0100, Ard Biesheuvel wrote:
> On Tue, 3 Jan 2023 at 03:13, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > ... and reverting commit 99cb0d917ff indeed fixes the problem.
> >
> > Hmm. My gut feel is that this just exposes some bug in binutils.
> >
> > That said, maybe that commit should not have added its own /DISCARDS/
> > thing, and instead just added that "*(.note.GNU-stack)" to the general
> > /DISCARDS/ thing that is defined by the
> >
> > #define DISCARDS ..
> >
> > a little bit later, so that we only end up with one single DISCARD
> > list. Something like this (broken patch on purpose):
> >
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -897,5 +897,4 @@
> > */
> > #define NOTES \
> > - /DISCARD/ : { *(.note.GNU-stack) } \
> > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> > BOUNDED_SECTION_BY(.note.*, _notes) \
> > @@ -1016,4 +1015,5 @@
> > #define DISCARDS \
> > /DISCARD/ : { \
> > + *(.note.GNU-stack) \
> > EXIT_DISCARDS \
> > EXIT_CALL \
> >
> > But maybe that DISCARDS macrop ends up being used too late?
> >
>
> Masahiro's v1 did something like this, and it caused an issue on
> RISC-V, which is why we ended up with this approach instead.
>
> > It really shouldn't matter, but here we are, with a build problem with
> > some random old binutils on an odd platform..
> >
>
> AIUI, the way ld.bfd used to combine output sections may also affect
> the /DISCARD/ pseudo-section, and so introducing it much earlier
> results in these discards to be interpreted in a different order.
>
> The purpose of this change is to prevent .note.GNU-stack from deciding
> the section type of the .notes output section, and so keeping it in
> its own section should be sufficient. E.g.,
>
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -896,7 +896,7 @@
> * Otherwise, the type of .notes section would become PROGBITS
> instead of NOTES.
> */
> #define NOTES \
> - /DISCARD/ : { *(.note.GNU-stack) } \
> + .note.GNU-stack : { *(.note.GNU-stack) } \
> .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
> BOUNDED_SECTION_BY(.note.*, _notes) \
> } NOTES_HEADERS \
>
> The .note.GNU-stack has zero size, so the result should be the same.
+Greg +Nick
This also fixes Build ID on arm64 for stable 5.15, 5.10, and 5.4
which has been broken since backport of:
0d362be5b142 ("Makefile: link with -z noexecstack --no-warn-rwx-segments")
Discussed here:
https://lore.kernel.org/stable/3df32572ec7016e783d37e185f88495831671f5d.1671143628.git.tom.saeger@oracle.com/
https://lore.kernel.org/stable/cover.1670358255.git.tom.saeger@oracle.com/
Perhaps add:
Cc: <stable@vger.kernel.org> # 5.15, 5.10, 5.4
for stable 5.15, 5.10, 5.4
Tested-by: Tom Saeger <tom.saeger@oracle.com>
^ permalink raw reply [flat|nested] 24+ messages in thread