2019-04-23 20:31:01

by Nick Desaulniers

[permalink] [raw]
Subject: [PATCH] sh: require --Wl,--hash-style=sysv

Towards the goal of removing cc-ldoption, prefer ld-option, or better
yet, require --Wl,--hash-style=sysv since the selftest for vdso's
requires DT_HASH.

Cc: Andy Lutomirsky <[email protected]>
Cc: [email protected]
Suggested-by: Masahiro Yamada <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
---
arch/sh/kernel/vsyscall/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
index 5db6579bc44c..6e8664448048 100644
--- a/arch/sh/kernel/vsyscall/Makefile
+++ b/arch/sh/kernel/vsyscall/Makefile
@@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@

export CPPFLAGS_vsyscall.lds += -P -C -Ush

-vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
- $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
+vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv

SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)

--
2.21.0.593.g511ec345e18-goog


2019-04-24 06:30:08

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] sh: require --Wl,--hash-style=sysv

Hi Nick,

On Tue, Apr 23, 2019 at 10:31 PM Nick Desaulniers
<[email protected]> wrote:
> Towards the goal of removing cc-ldoption, prefer ld-option, or better
> yet, require --Wl,--hash-style=sysv since the selftest for vdso's
> requires DT_HASH.
>
> Cc: Andy Lutomirsky <[email protected]>
> Cc: [email protected]
> Suggested-by: Masahiro Yamada <[email protected]>
> Signed-off-by: Nick Desaulniers <[email protected]>

Thanks for your patch!

> --- a/arch/sh/kernel/vsyscall/Makefile
> +++ b/arch/sh/kernel/vsyscall/Makefile
> @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
>
> export CPPFLAGS_vsyscall.lds += -P -C -Ush
>
> -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
>
> SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)

What impact does this have on the minimum binutils version needed to
compile the kernel?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2019-04-24 06:48:04

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] sh: require --Wl,--hash-style=sysv

On Wed, Apr 24, 2019 at 3:37 PM Masahiro Yamada
<[email protected]> wrote:
>
> On Wed, Apr 24, 2019 at 3:29 PM Geert Uytterhoeven <[email protected]> wrote:
> >
> > Hi Nick,
> >
> > On Tue, Apr 23, 2019 at 10:31 PM Nick Desaulniers
> > <[email protected]> wrote:
> > > Towards the goal of removing cc-ldoption, prefer ld-option, or better
> > > yet, require --Wl,--hash-style=sysv since the selftest for vdso's
> > > requires DT_HASH.
> > >
> > > Cc: Andy Lutomirsky <[email protected]>
> > > Cc: [email protected]
> > > Suggested-by: Masahiro Yamada <[email protected]>
> > > Signed-off-by: Nick Desaulniers <[email protected]>
> >
> > Thanks for your patch!
> >
> > > --- a/arch/sh/kernel/vsyscall/Makefile
> > > +++ b/arch/sh/kernel/vsyscall/Makefile
> > > @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
> > >
> > > export CPPFLAGS_vsyscall.lds += -P -C -Ush
> > >
> > > -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> > > - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> > > +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
> > >
> > > SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)
> >
> > What impact does this have on the minimum binutils version needed to
> > compile the kernel?
> >
>
>
> See his ia64 variant:
> https://lore.kernel.org/patchwork/patch/1065347/
>
>
> He commented a stronger reason
> "it seems that --hash-style= was added to binutils 2.17.50.0.2 in 2006.
> The minimal required version of binutils for the kernel according to
> Documentation/process/changes.rst is 2.20"
>
>
> Nick,
> Why don't you rephrase the commit log like your ia64 one?
> It will clarify this change has no impact.
>
>
> BTW, I think the subject should be
> "-Wl,--hash-style=sysv" instead of
> "--Wl,--hash-style=sysv"
>
> (single hash before "Wl")

I mean "single dash"
just in case. :)




--
Best Regards
Masahiro Yamada

2019-04-24 07:44:15

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] sh: require --Wl,--hash-style=sysv

On Wed, Apr 24, 2019 at 3:29 PM Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Nick,
>
> On Tue, Apr 23, 2019 at 10:31 PM Nick Desaulniers
> <[email protected]> wrote:
> > Towards the goal of removing cc-ldoption, prefer ld-option, or better
> > yet, require --Wl,--hash-style=sysv since the selftest for vdso's
> > requires DT_HASH.
> >
> > Cc: Andy Lutomirsky <[email protected]>
> > Cc: [email protected]
> > Suggested-by: Masahiro Yamada <[email protected]>
> > Signed-off-by: Nick Desaulniers <[email protected]>
>
> Thanks for your patch!
>
> > --- a/arch/sh/kernel/vsyscall/Makefile
> > +++ b/arch/sh/kernel/vsyscall/Makefile
> > @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
> >
> > export CPPFLAGS_vsyscall.lds += -P -C -Ush
> >
> > -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> > - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> > +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
> >
> > SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)
>
> What impact does this have on the minimum binutils version needed to
> compile the kernel?
>


See his ia64 variant:
https://lore.kernel.org/patchwork/patch/1065347/


He commented a stronger reason
"it seems that --hash-style= was added to binutils 2.17.50.0.2 in 2006.
The minimal required version of binutils for the kernel according to
Documentation/process/changes.rst is 2.20"


Nick,
Why don't you rephrase the commit log like your ia64 one?
It will clarify this change has no impact.


BTW, I think the subject should be
"-Wl,--hash-style=sysv" instead of
"--Wl,--hash-style=sysv"

(single hash before "Wl")




--
Best Regards
Masahiro Yamada

2019-04-24 18:04:22

by Nick Desaulniers

[permalink] [raw]
Subject: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

Towards the goal of removing cc-ldoption, it seems that --hash-style=
was added to binutils 2.17.50.0.2 in 2006. The minimal required version
of binutils for the kernel according to
Documentation/process/changes.rst is 2.20.

Link: https://gcc.gnu.org/ml/gcc/2007-01/msg01141.html
Cc: [email protected]
Suggested-by: Masahiro Yamada <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
---
Changes V1 -> V2:
* update commit subject and message as per Masahiro/Geert.

To Geert's question about minimum binutils versions; no change needed to
binutils.


arch/sh/kernel/vsyscall/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
index 5db6579bc44c..6e8664448048 100644
--- a/arch/sh/kernel/vsyscall/Makefile
+++ b/arch/sh/kernel/vsyscall/Makefile
@@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@

export CPPFLAGS_vsyscall.lds += -P -C -Ush

-vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
- $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
+vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv

SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)

--
2.21.0.593.g511ec345e18-goog

2019-04-30 20:27:44

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

On Wed, Apr 24, 2019 at 11:02 AM Nick Desaulniers
<[email protected]> wrote:
>
> Towards the goal of removing cc-ldoption, it seems that --hash-style=
> was added to binutils 2.17.50.0.2 in 2006. The minimal required version
> of binutils for the kernel according to
> Documentation/process/changes.rst is 2.20.
>
> Link: https://gcc.gnu.org/ml/gcc/2007-01/msg01141.html
> Cc: [email protected]
> Suggested-by: Masahiro Yamada <[email protected]>
> Signed-off-by: Nick Desaulniers <[email protected]>
> ---
> Changes V1 -> V2:
> * update commit subject and message as per Masahiro/Geert.
>
> To Geert's question about minimum binutils versions; no change needed to
> binutils.
>
>
> arch/sh/kernel/vsyscall/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
> index 5db6579bc44c..6e8664448048 100644
> --- a/arch/sh/kernel/vsyscall/Makefile
> +++ b/arch/sh/kernel/vsyscall/Makefile
> @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
>
> export CPPFLAGS_vsyscall.lds += -P -C -Ush
>
> -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
>
> SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)
>
> --
> 2.21.0.593.g511ec345e18-goog
>

bumping for review
--
Thanks,
~Nick Desaulniers

2019-05-08 19:25:58

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

bumping for review, as the merge window is now open.

On Tue, Apr 30, 2019 at 1:26 PM Nick Desaulniers
<[email protected]> wrote:
>
> On Wed, Apr 24, 2019 at 11:02 AM Nick Desaulniers
> <[email protected]> wrote:
> >
> > Towards the goal of removing cc-ldoption, it seems that --hash-style=
> > was added to binutils 2.17.50.0.2 in 2006. The minimal required version
> > of binutils for the kernel according to
> > Documentation/process/changes.rst is 2.20.
> >
> > Link: https://gcc.gnu.org/ml/gcc/2007-01/msg01141.html
> > Cc: [email protected]
> > Suggested-by: Masahiro Yamada <[email protected]>
> > Signed-off-by: Nick Desaulniers <[email protected]>
> > ---
> > Changes V1 -> V2:
> > * update commit subject and message as per Masahiro/Geert.
> >
> > To Geert's question about minimum binutils versions; no change needed to
> > binutils.
> >
> >
> > arch/sh/kernel/vsyscall/Makefile | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
> > index 5db6579bc44c..6e8664448048 100644
> > --- a/arch/sh/kernel/vsyscall/Makefile
> > +++ b/arch/sh/kernel/vsyscall/Makefile
> > @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
> >
> > export CPPFLAGS_vsyscall.lds += -P -C -Ush
> >
> > -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> > - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> > +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
> >
> > SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)
> >
> > --
> > 2.21.0.593.g511ec345e18-goog
> >
>
> bumping for review
> --
> Thanks,
> ~Nick Desaulniers



--
Thanks,
~Nick Desaulniers

2019-05-09 00:47:21

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

On Thu, May 9, 2019 at 5:13 AM Nick Desaulniers <[email protected]> wrote:
>
> bumping for review, as the merge window is now open.


sh is not very active these days.

I applied this to my kbuild tree.
I will send PR for this in the current MW.

Thanks.



> On Tue, Apr 30, 2019 at 1:26 PM Nick Desaulniers
> <[email protected]> wrote:
> >
> > On Wed, Apr 24, 2019 at 11:02 AM Nick Desaulniers
> > <[email protected]> wrote:
> > >
> > > Towards the goal of removing cc-ldoption, it seems that --hash-style=
> > > was added to binutils 2.17.50.0.2 in 2006. The minimal required version
> > > of binutils for the kernel according to
> > > Documentation/process/changes.rst is 2.20.
> > >
> > > Link: https://gcc.gnu.org/ml/gcc/2007-01/msg01141.html
> > > Cc: [email protected]
> > > Suggested-by: Masahiro Yamada <[email protected]>
> > > Signed-off-by: Nick Desaulniers <[email protected]>
> > > ---
> > > Changes V1 -> V2:
> > > * update commit subject and message as per Masahiro/Geert.
> > >
> > > To Geert's question about minimum binutils versions; no change needed to
> > > binutils.
> > >
> > >
> > > arch/sh/kernel/vsyscall/Makefile | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
> > > index 5db6579bc44c..6e8664448048 100644
> > > --- a/arch/sh/kernel/vsyscall/Makefile
> > > +++ b/arch/sh/kernel/vsyscall/Makefile
> > > @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
> > >
> > > export CPPFLAGS_vsyscall.lds += -P -C -Ush
> > >
> > > -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> > > - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> > > +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
> > >
> > > SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)
> > >
> > > --
> > > 2.21.0.593.g511ec345e18-goog
> > >
> >
> > bumping for review
> > --
> > Thanks,
> > ~Nick Desaulniers
>
>
>
> --
> Thanks,
> ~Nick Desaulniers



--
Best Regards
Masahiro Yamada

Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

On 5/9/19 2:44 AM, Masahiro Yamada wrote:
> On Thu, May 9, 2019 at 5:13 AM Nick Desaulniers <[email protected]> wrote:
>>
>> bumping for review, as the merge window is now open.
>
>
> sh is not very active these days.

We're still supporting SH with an up-to-date kernel and userland in Debian, so
if your patch broke something, we will notice that soonish. This also applies
to ia64 and many other architectures.

So, if in doubt, there are folks in Debian which can test your kernel patch
if you fear that it breaks something.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - [email protected]
`. `' Freie Universitaet Berlin - [email protected]
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

2019-05-09 07:11:12

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

On Thu, May 9, 2019 at 3:11 PM John Paul Adrian Glaubitz
<[email protected]> wrote:
>
> On 5/9/19 2:44 AM, Masahiro Yamada wrote:
> > On Thu, May 9, 2019 at 5:13 AM Nick Desaulniers <[email protected]> wrote:
> >>
> >> bumping for review, as the merge window is now open.
> >
> >
> > sh is not very active these days.
>
> We're still supporting SH with an up-to-date kernel and userland in Debian, so
> if your patch broke something, we will notice that soonish. This also applies
> to ia64 and many other architectures.
>
> So, if in doubt, there are folks in Debian which can test your kernel patch
> if you fear that it breaks something.

Thanks for taking care of them in Debian.

I am talking about the sh sub-system in the kernel here.

SH patches occasionally fly around in LKML, but
the SH maintainers are not picking up them these days.

This one is trivial from the build system point of view.
So, I offer to apply it to my tree.

Thanks.




> Adrian
>
> --
> .''`. John Paul Adrian Glaubitz
> : :' : Debian Developer - [email protected]
> `. `' Freie Universitaet Berlin - [email protected]
> `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913



--
Best Regards
Masahiro Yamada

Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

Hi Masahiro!

On 5/9/19 9:07 AM, Masahiro Yamada wrote:
>> So, if in doubt, there are folks in Debian which can test your kernel patch
>> if you fear that it breaks something.
>
> Thanks for taking care of them in Debian.
>
> I am talking about the sh sub-system in the kernel here.

Yes, I'm aware of that :).

> SH patches occasionally fly around in LKML, but
> the SH maintainers are not picking up them these days.

Rich was normally the one maintaining the SH tree and collecting the patches,
not sure whether he is still active. It's been a while since he sent Linus
a pull request.

Sato-san was recently a patch himself, but I think he doesn't have a tree
himself.

@Sato: Could you have a look at the patch and ack it if it's okay?

> This one is trivial from the build system point of view.
> So, I offer to apply it to my tree.

I'm fine with that. If you need to test build the kernel for SH, Debian
has an easily installable cross-compiler for SH and every other architecture
except ia64 (working on fixing that) available.

In any case, thanks for taking care of SH in this case.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - [email protected]
`. `' Freie Universitaet Berlin - [email protected]
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

2019-05-12 04:31:52

by Yoshinori Sato

[permalink] [raw]
Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

On Thu, 25 Apr 2019 03:02:21 +0900,
Nick Desaulniers wrote:
>
> Towards the goal of removing cc-ldoption, it seems that --hash-style=
> was added to binutils 2.17.50.0.2 in 2006. The minimal required version
> of binutils for the kernel according to
> Documentation/process/changes.rst is 2.20.
>
> Link: https://gcc.gnu.org/ml/gcc/2007-01/msg01141.html
> Cc: [email protected]
> Suggested-by: Masahiro Yamada <[email protected]>
> Signed-off-by: Nick Desaulniers <[email protected]>

Acked-by: Yoshinori Sato <[email protected]>

> ---
> Changes V1 -> V2:
> * update commit subject and message as per Masahiro/Geert.
>
> To Geert's question about minimum binutils versions; no change needed to
> binutils.
>
>
> arch/sh/kernel/vsyscall/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
> index 5db6579bc44c..6e8664448048 100644
> --- a/arch/sh/kernel/vsyscall/Makefile
> +++ b/arch/sh/kernel/vsyscall/Makefile
> @@ -15,8 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
>
> export CPPFLAGS_vsyscall.lds += -P -C -Ush
>
> -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
> - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
> +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 -Wl,--hash-style=sysv
>
> SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)
>
> --
> 2.21.0.593.g511ec345e18-goog
>

--
Yosinori Sato

2019-05-12 04:32:47

by Yoshinori Sato

[permalink] [raw]
Subject: Re: [PATCH v2] sh: vsyscall: drop unnecessary cc-ldoption

On Thu, 09 May 2019 17:44:45 +0900,
John Paul Adrian Glaubitz wrote:
>
> Hi Masahiro!
>
> On 5/9/19 9:07 AM, Masahiro Yamada wrote:
> >> So, if in doubt, there are folks in Debian which can test your kernel patch
> >> if you fear that it breaks something.
> >
> > Thanks for taking care of them in Debian.
> >
> > I am talking about the sh sub-system in the kernel here.
>
> Yes, I'm aware of that :).
>
> > SH patches occasionally fly around in LKML, but
> > the SH maintainers are not picking up them these days.
>
> Rich was normally the one maintaining the SH tree and collecting the patches,
> not sure whether he is still active. It's been a while since he sent Linus
> a pull request.
>
> Sato-san was recently a patch himself, but I think he doesn't have a tree
> himself.
>
> @Sato: Could you have a look at the patch and ack it if it's okay?

I sent ack now.
Sorry too late reply.

> > This one is trivial from the build system point of view.
> > So, I offer to apply it to my tree.
>
> I'm fine with that. If you need to test build the kernel for SH, Debian
> has an easily installable cross-compiler for SH and every other architecture
> except ia64 (working on fixing that) available.
>
> In any case, thanks for taking care of SH in this case.
>
> Adrian
>
> --
> .''`. John Paul Adrian Glaubitz
> : :' : Debian Developer - [email protected]
> `. `' Freie Universitaet Berlin - [email protected]
> `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

--
Yosinori Sato