2020-03-27 15:30:50

by Julien Thierry

[permalink] [raw]
Subject: [PATCH v2 01/10] objtool: Move header sync-check ealier in build

Currently, the check of tools files against kernel equivalent is only
done after every object file has been built. This means one might fix
build issues against outdated headers without seeing a warning about
this.

Check headers before any object is built. Also, make it part of a
FORCE'd recipe so every attempt to build objtool will report the
outdated headers (if any).

Signed-off-by: Julien Thierry <[email protected]>
---
tools/objtool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index ee08aeff30a1..519af6ec4eee 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -43,10 +43,10 @@ export srctree OUTPUT CFLAGS SRCARCH AWK
include $(srctree)/tools/build/Makefile.include

$(OBJTOOL_IN): fixdep FORCE
+ @$(CONFIG_SHELL) ./sync-check.sh
@$(MAKE) $(build)=objtool

$(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
- @$(CONFIG_SHELL) ./sync-check.sh
$(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@


--
2.21.1


2020-04-01 12:34:10

by Miroslav Benes

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] objtool: Move header sync-check ealier in build

On Fri, 27 Mar 2020, Julien Thierry wrote:

> Currently, the check of tools files against kernel equivalent is only
> done after every object file has been built.

> This means one might fix
> build issues against outdated headers without seeing a warning about
> this.

Could you explain the above in more detail, please?

Otherwise it looks good.

Miroslav

> Check headers before any object is built. Also, make it part of a
> FORCE'd recipe so every attempt to build objtool will report the
> outdated headers (if any).
>
> Signed-off-by: Julien Thierry <[email protected]>
> ---
> tools/objtool/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index ee08aeff30a1..519af6ec4eee 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -43,10 +43,10 @@ export srctree OUTPUT CFLAGS SRCARCH AWK
> include $(srctree)/tools/build/Makefile.include
>
> $(OBJTOOL_IN): fixdep FORCE
> + @$(CONFIG_SHELL) ./sync-check.sh
> @$(MAKE) $(build)=objtool
>
> $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
> - @$(CONFIG_SHELL) ./sync-check.sh
> $(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@
>
>
> --
> 2.21.1
>

2020-04-01 12:45:50

by Julien Thierry

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] objtool: Move header sync-check ealier in build



On 4/1/20 1:32 PM, Miroslav Benes wrote:
> On Fri, 27 Mar 2020, Julien Thierry wrote:
>
>> Currently, the check of tools files against kernel equivalent is only
>> done after every object file has been built.
>
>> This means one might fix
>> build issues against outdated headers without seeing a warning about
>> this.
>
> Could you explain the above in more detail, please?
>

I must admit that this patch is more fixing the issues I've faced while
working on the arm64 support and sharing some kernel headers from the
arch/arm64 tree.

The annoying part was:
- Have build errors in objtool
- Fix them
- Objtool build succeeds, but have warning about outdated headers
- Update headers
- New errors come up, potentially making obsolete the ealier fixes

So it's not really a "must have" change. But it's nice to have when
bringing new kernel headers to objtool.

I hope this makes things clearer.

Cheers,

--
Julien Thierry

2020-04-01 12:55:51

by Miroslav Benes

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] objtool: Move header sync-check ealier in build

On Wed, 1 Apr 2020, Julien Thierry wrote:

>
>
> On 4/1/20 1:32 PM, Miroslav Benes wrote:
> > On Fri, 27 Mar 2020, Julien Thierry wrote:
> >
> >> Currently, the check of tools files against kernel equivalent is only
> >> done after every object file has been built.
> >
> >> This means one might fix
> >> build issues against outdated headers without seeing a warning about
> >> this.
> >
> > Could you explain the above in more detail, please?
> >
>
> I must admit that this patch is more fixing the issues I've faced while
> working on the arm64 support and sharing some kernel headers from the
> arch/arm64 tree.
>
> The annoying part was:
> - Have build errors in objtool
> - Fix them
> - Objtool build succeeds, but have warning about outdated headers
> - Update headers
> - New errors come up, potentially making obsolete the ealier fixes

Ah right, yes.

> So it's not really a "must have" change. But it's nice to have when bringing
> new kernel headers to objtool.

No, I think it is useful.

> I hope this makes things clearer.

Yes, it does.

Thanks
Miroslav

2020-04-02 17:15:23

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] objtool: Move header sync-check ealier in build

On Fri, Mar 27, 2020 at 03:28:38PM +0000, Julien Thierry wrote:
> Currently, the check of tools files against kernel equivalent is only
> done after every object file has been built. This means one might fix
> build issues against outdated headers without seeing a warning about
> this.

s/ealier/earlier/ in $SUBJECT

--
Josh

2020-04-02 17:20:33

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] objtool: Move header sync-check ealier in build

On Thu, Apr 02, 2020 at 12:12:37PM -0500, Josh Poimboeuf wrote:
> On Fri, Mar 27, 2020 at 03:28:38PM +0000, Julien Thierry wrote:
> > Currently, the check of tools files against kernel equivalent is only
> > done after every object file has been built. This means one might fix
> > build issues against outdated headers without seeing a warning about
> > this.
>
> s/ealier/earlier/ in $SUBJECT

Actually don't worry about fixing that up, after my review I'll take
this patch (and any other trivial ones) and do any trivial cleanups like
that and then forward them along to the tip tree.

--
Josh