All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the kbuild tree
@ 2021-08-19 23:28 Stephen Rothwell
  2021-08-23  0:25 ` Masahiro Yamada
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2021-08-19 23:28 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

Hi all,

After merging the kbuild tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

arch/x86/entry/vdso/Makefile:135: FORCE prerequisite is missing
arch/x86/entry/vdso/Makefile:135: FORCE prerequisite is missing
arch/x86/entry/vdso/Makefile:135: FORCE prerequisite is missing

Exposed by commit

  0fc7db58e2a6 ("kbuild: warn if FORCE is missing for if_changed(_dep,_rule) and filechk")

Not sure why we need 3 of these :-(

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2021-08-19 23:28 linux-next: build warning after merge of the kbuild tree Stephen Rothwell
@ 2021-08-23  0:25 ` Masahiro Yamada
  0 siblings, 0 replies; 33+ messages in thread
From: Masahiro Yamada @ 2021-08-23  0:25 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Aug 20, 2021 at 8:28 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the kbuild tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> arch/x86/entry/vdso/Makefile:135: FORCE prerequisite is missing
> arch/x86/entry/vdso/Makefile:135: FORCE prerequisite is missing
> arch/x86/entry/vdso/Makefile:135: FORCE prerequisite is missing
>
> Exposed by commit
>
>   0fc7db58e2a6 ("kbuild: warn if FORCE is missing for if_changed(_dep,_rule) and filechk")
>
> Not sure why we need 3 of these :-(


This is a pattern rule, which generates
vdso64.so, vdso32.so, and vdsox32.so

The warning is produced as a side-effect
of the recipe. That is why 3 warnings.
Otherwise, I do not know how to implement it.


BTW, a fix for x86 Makefile exists in the patchwork.

https://lore.kernel.org/patchwork/patch/1478798/


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2023-10-03 23:13 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2023-10-03 23:13 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2580 bytes --]

Hi all,

After merging the kbuild tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

In file included from scripts/mod/modpost.c:23:
scripts/mod/modpost.c: In function 'section_rela':
scripts/mod/modpost.h:66:24: warning: passing argument 2 of '__endian' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   66 |         __endian(&(x), &(__x), sizeof(__x));                    \
      |                        ^~~~~~
scripts/mod/modpost.c:1437:28: note: in expansion of macro 'TO_NATIVE'
 1437 |                 r_offset = TO_NATIVE(rela->r_offset);
      |                            ^~~~~~~~~
scripts/mod/modpost.h:56:52: note: expected 'void *' but argument is of type 'const Elf64_Addr *' {aka 'const long unsigned int *'}
   56 | static inline void __endian(const void *src, void *dest, unsigned int size)
      |                                              ~~~~~~^~~~
scripts/mod/modpost.h:66:24: warning: passing argument 2 of '__endian' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   66 |         __endian(&(x), &(__x), sizeof(__x));                    \
      |                        ^~~~~~
scripts/mod/modpost.c:1440:25: note: in expansion of macro 'TO_NATIVE'
 1440 |                 taddr = TO_NATIVE(rela->r_addend);
      |                         ^~~~~~~~~
scripts/mod/modpost.h:56:52: note: expected 'void *' but argument is of type 'const Elf64_Sxword *' {aka 'const long int *'}
   56 | static inline void __endian(const void *src, void *dest, unsigned int size)
      |                                              ~~~~~~^~~~
scripts/mod/modpost.c: In function 'section_rel':
scripts/mod/modpost.h:66:24: warning: passing argument 2 of '__endian' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   66 |         __endian(&(x), &(__x), sizeof(__x));                    \
      |                        ^~~~~~
scripts/mod/modpost.c:1472:28: note: in expansion of macro 'TO_NATIVE'
 1472 |                 r_offset = TO_NATIVE(rel->r_offset);
      |                            ^~~~~~~~~
scripts/mod/modpost.h:56:52: note: expected 'void *' but argument is of type 'const Elf64_Addr *' {aka 'const long unsigned int *'}
   56 | static inline void __endian(const void *src, void *dest, unsigned int size)
      |                                              ~~~~~~^~~~

Introduced by commit

  367df0e19c67 ("modpost: factor out the common boilerplate of section_rel(a)")

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2023-08-28  4:57 Stephen Rothwell
@ 2023-08-28 17:28 ` Nick Desaulniers
  0 siblings, 0 replies; 33+ messages in thread
From: Nick Desaulniers @ 2023-08-28 17:28 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Masahiro Yamada, Linux Kernel Mailing List, Linux Next Mailing List

On Sun, Aug 27, 2023 at 9:57 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the kbuild tree, today's linux-next build (htmldocs)
> produced this warning:
>
> Documentation/kbuild/llvm.rst:127: ERROR: Unknown target name: "reprocible_builds".
>
> Introduced by commit
>
>   bda09c0e14a4 ("Documentation/llvm: refresh docs")

Sorry about that; thanks for the report:
https://lore.kernel.org/llvm/20230828-docs_fixup-v1-1-cc78af124667@google.com/
-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2023-08-28  4:57 Stephen Rothwell
  2023-08-28 17:28 ` Nick Desaulniers
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2023-08-28  4:57 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Nick Desaulniers, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

Hi all,

After merging the kbuild tree, today's linux-next build (htmldocs)
produced this warning:

Documentation/kbuild/llvm.rst:127: ERROR: Unknown target name: "reprocible_builds".

Introduced by commit

  bda09c0e14a4 ("Documentation/llvm: refresh docs")

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2020-12-20 22:10 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2020-12-20 22:10 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

Hi all,

After merging the kbuild tree, today's linux-next build (htmldocs)
produced this warning:

Documentation/kbuild/makefiles.rst:1617: WARNING: Inline emphasis start-string without end-string.

Maybe introduced by commit

  663e29430e12 ("kbuild: doc: replace arch/$(ARCH)/ with arch/$(SRCARCH)/")

But am not sure about this.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2020-12-09  9:30 Stephen Rothwell
  2020-12-09 13:01 ` Dominique Martinet
@ 2020-12-14 20:44 ` Stephen Rothwell
  1 sibling, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2020-12-14 20:44 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Dominique Martinet, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

Hi all,

On Wed, 9 Dec 2020 20:30:29 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the kbuild tree, today's linux-next build (x86_64
> modules_install) produced this warning:
> 
> Warning: 'make modules_install' requires depmod. Please install it.
> This is probably in the kmod package.
> 
> Introduced by commit
> 
>   330029209513 ("kbuild: don't hardcode depmod path")
> 
> Unfortunately for most of us (?), /sbin is not in our PATH ...

I am still getting this warning.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2020-12-09 20:56   ` Stephen Rothwell
@ 2020-12-10  6:47     ` Dominique Martinet
  0 siblings, 0 replies; 33+ messages in thread
From: Dominique Martinet @ 2020-12-10  6:47 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Masahiro Yamada, Linux Kernel Mailing List, Linux Next Mailing List

Stephen Rothwell wrote on Thu, Dec 10, 2020:
> On Wed, 9 Dec 2020 14:01:30 +0100 Dominique Martinet <asmadeus@codewreck.org> wrote:
> >
> > I guess it's possible to make kbuild check both sbin and PATH, would
> > that be acceptable?
> 
> I guess so.  But, have you actually found any setup where depmod is not
> /sbin/depmod?  i.e. what problem are you trying to solve.  As far as I
> can see all this change does is (ever so slightly) slow down the build
> for no gain.

On nixos, depmod is in /run/current-system/sw/bin/depmod (as a link to
/nix/store/r3r39rzsrikdsv68rvswn3hhank706gj-kmod-27/bin/depmod or
wherever the current version wants to be).
developers on guix probably face the same problem.

There is no sbin, the only things in /bin is sh, and in /usr/bin env as
I think is mandated by posix.

For their official builds they just modify the build scripts in place
before starting the build, but for dev as I keep rebasing it's annoying
to keep a couple of local patches just for this.
I could obviously manually create a link from /sbin/depmod to the
current system's but that doesn't solve the problem for all other nixos
users.

I'll send an updated patch later today..
-- 
Dominique

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2020-12-09 13:01 ` Dominique Martinet
@ 2020-12-09 20:56   ` Stephen Rothwell
  2020-12-10  6:47     ` Dominique Martinet
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2020-12-09 20:56 UTC (permalink / raw)
  To: Dominique Martinet
  Cc: Masahiro Yamada, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

Hi Dominique,

On Wed, 9 Dec 2020 14:01:30 +0100 Dominique Martinet <asmadeus@codewreck.org> wrote:
>
> I guess it's possible to make kbuild check both sbin and PATH, would
> that be acceptable?

I guess so.  But, have you actually found any setup where depmod is not
/sbin/depmod?  i.e. what problem are you trying to solve.  As far as I
can see all this change does is (ever so slightly) slow down the build
for no gain.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2020-12-09  9:30 Stephen Rothwell
@ 2020-12-09 13:01 ` Dominique Martinet
  2020-12-09 20:56   ` Stephen Rothwell
  2020-12-14 20:44 ` Stephen Rothwell
  1 sibling, 1 reply; 33+ messages in thread
From: Dominique Martinet @ 2020-12-09 13:01 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Masahiro Yamada, Linux Kernel Mailing List, Linux Next Mailing List

Stephen Rothwell wrote on Wed, Dec 09, 2020:
> After merging the kbuild tree, today's linux-next build (x86_64
> modules_install) produced this warning:
> 
> Warning: 'make modules_install' requires depmod. Please install it.
> This is probably in the kmod package.
> 
> Introduced by commit
> 
>   330029209513 ("kbuild: don't hardcode depmod path")
> 
> Unfortunately for most of us (?), /sbin is not in our PATH ...

d'oh.

Now you say this, I always found stupid distros that don't include sbin
in user PATHs: utilities like ip and a few others are perfectly useable
as reglar users to query the system state and the first thing I always
do is to add /sbin to my path on the rare distros that do this
(debian-based distros only?) so it totally slipped out of my head :/


I guess it's possible to make kbuild check both sbin and PATH, would
that be acceptable?

I'll have a look at how to do that if so.
-- 
Dominique


^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2020-12-09  9:30 Stephen Rothwell
  2020-12-09 13:01 ` Dominique Martinet
  2020-12-14 20:44 ` Stephen Rothwell
  0 siblings, 2 replies; 33+ messages in thread
From: Stephen Rothwell @ 2020-12-09  9:30 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Dominique Martinet, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

Hi all,

After merging the kbuild tree, today's linux-next build (x86_64
modules_install) produced this warning:

Warning: 'make modules_install' requires depmod. Please install it.
This is probably in the kmod package.

Introduced by commit

  330029209513 ("kbuild: don't hardcode depmod path")

Unfortunately for most of us (?), /sbin is not in our PATH ...

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2017-12-11  0:22 ` Masahiro Yamada
@ 2017-12-11 16:11   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-12-11 16:11 UTC (permalink / raw)
  To: sfr, yamada.masahiro
  Cc: felipe.balbi, linux-kernel, ulfalizer, hare, linux-next

On Mon, 2017-12-11 at 09:22 +0900, Masahiro Yamada wrote:
> 2017-12-11 7:52 GMT+09:00 Stephen Rothwell <sfr@canb.auug.org.au>:
> > After merging the kbuild tree, today's linux-next build (arm
> > multi_v7_defconfig) produced this warning:
> > 
> > drivers/usb/gadget/Kconfig:487:warning: choice default symbol 'USB_ETH' is not contained in the choice
> 
> I had noticed this before merging it.
> 
> I expect somebody will fix drivers/usb/gadget/Kconfig.
> 
> > Exposed by commit
> > 
> >   2c37e08464a8 ("kconfig: Warn if choice default is not in choice")
> > 
> > Introduced by commit
> > 
> >   7a9618a22aad ("usb: gadget: allow to enable legacy drivers without USB_ETH")

Hello Stephen and Masahiro,

I will look further into this. Please revert commit 7a9618a22aad until a fix
is upstream.

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2017-12-10 22:52 Stephen Rothwell
@ 2017-12-11  0:22 ` Masahiro Yamada
  2017-12-11 16:11   ` Bart Van Assche
  0 siblings, 1 reply; 33+ messages in thread
From: Masahiro Yamada @ 2017-12-11  0:22 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Ulf Magnusson, Bart Van Assche, Felipe Balbi, Hannes Reinecke

Hi Stephen,

2017-12-11 7:52 GMT+09:00 Stephen Rothwell <sfr@canb.auug.org.au>:
> Hi Masahiro,
>
> After merging the kbuild tree, today's linux-next build (arm
> multi_v7_defconfig) produced this warning:
>
> drivers/usb/gadget/Kconfig:487:warning: choice default symbol 'USB_ETH' is not contained in the choice


I had noticed this before merging it.

I expect somebody will fix drivers/usb/gadget/Kconfig.



> Exposed by commit
>
>   2c37e08464a8 ("kconfig: Warn if choice default is not in choice")
>
> Introduced by commit
>
>   7a9618a22aad ("usb: gadget: allow to enable legacy drivers without USB_ETH")
>
> --
> Cheers,
> Stephen Rothwell






-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2017-12-10 22:52 Stephen Rothwell
  2017-12-11  0:22 ` Masahiro Yamada
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2017-12-10 22:52 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Ulf Magnusson, Bart Van Assche, Felipe Balbi, Hannes Reinecke

Hi Masahiro,

After merging the kbuild tree, today's linux-next build (arm
multi_v7_defconfig) produced this warning:

drivers/usb/gadget/Kconfig:487:warning: choice default symbol 'USB_ETH' is not contained in the choice

Exposed by commit

  2c37e08464a8 ("kconfig: Warn if choice default is not in choice")

Introduced by commit

  7a9618a22aad ("usb: gadget: allow to enable legacy drivers without USB_ETH")

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2016-11-30 23:06 Stephen Rothwell
@ 2016-12-01  2:00 ` Nicholas Piggin
  0 siblings, 0 replies; 33+ messages in thread
From: Nicholas Piggin @ 2016-12-01  2:00 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Michal Marek, linux-next, linux-kernel

On Thu, 1 Dec 2016 10:06:08 +1100
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Michal,
> 
> After merging the kbuild tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
> 
> WARNING: EXPORT symbol "__sw_hweight32" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "memcpy_mcsafe_unrolled" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "empty_zero_page" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__get_user_2" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__put_user_2" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__fentry__" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "native_load_gs_index" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__copy_user_nocache" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "copy_user_generic_unrolled" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "memset" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "_copy_to_user" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__sw_hweight64" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__put_user_1" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__memcpy" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "memmove" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__put_user_8" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "copy_user_generic_string" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__get_user_4" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "clear_page" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__memset" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__memmove" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "copy_user_enhanced_fast_string" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "_copy_from_user" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__get_user_1" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "phys_base" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__get_user_8" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "copy_page" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "__put_user_4" [vmlinux] version generation failed, symbol will not be versioned.
> WARNING: EXPORT symbol "memcpy" [vmlinux] version generation failed, symbol will not be versioned.
> 
> Introduced by commit
> 
>   d8c1eb86e952 ("kbuild: modpost warn if export version crc is missing")
> 

These are existing problems caught by the new warning. The modversions saga
has another chapter left, but one way or another we'll get rid of the warnings
for 4.10.

Thanks,
Nick

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2016-11-30 23:06 Stephen Rothwell
  2016-12-01  2:00 ` Nicholas Piggin
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2016-11-30 23:06 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-next, linux-kernel, Nicholas Piggin

Hi Michal,

After merging the kbuild tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

WARNING: EXPORT symbol "__sw_hweight32" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "memcpy_mcsafe_unrolled" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "empty_zero_page" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__get_user_2" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__put_user_2" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__fentry__" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "native_load_gs_index" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__copy_user_nocache" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "copy_user_generic_unrolled" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "memset" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "_copy_to_user" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__sw_hweight64" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__put_user_1" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__memcpy" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "memmove" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__put_user_8" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "copy_user_generic_string" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__get_user_4" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "clear_page" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__memset" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__memmove" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "copy_user_enhanced_fast_string" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "_copy_from_user" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__get_user_1" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "phys_base" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__get_user_8" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "copy_page" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "__put_user_4" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "memcpy" [vmlinux] version generation failed, symbol will not be versioned.

Introduced by commit

  d8c1eb86e952 ("kbuild: modpost warn if export version crc is missing")

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02 15:17           ` Valdis.Kletnieks
@ 2011-05-02 15:31             ` Michal Marek
  0 siblings, 0 replies; 33+ messages in thread
From: Michal Marek @ 2011-05-02 15:31 UTC (permalink / raw)
  To: Valdis.Kletnieks
  Cc: Stephen Rothwell, Dave Jones, linux-next, linux-kernel, Sam Ravnborg

On 2.5.2011 17:17, Valdis.Kletnieks@vt.edu wrote:
> On Mon, 02 May 2011 13:13:37 +0200, Michal Marek said:
>
>> +# We test for support of the -Wunused-but-set-variable option, because
>> +# some version of gcc will happily accept any -Wno-* switch and complain
>> +# later during build.
>> +ifeq ($(call cc-option-yn, -Wunused-but-set-variable), y)
>> +KBUILD_CFLAGS += -Wno-unused-but-set-variable
>> +endif
>
> Do we need to do this more generically for all the other -Wno-foo
> options under the various W={123} options?

I only see -Wno-unused-parameter in scripts/Makefile.build and that 
should be supported by any gcc version. Also please have a look at 
http://marc.info/?l=linux-kernel&m=130433840412201&w=2, which is an 
updated version.

Michal

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02 11:13         ` Michal Marek
@ 2011-05-02 15:17           ` Valdis.Kletnieks
  2011-05-02 15:31             ` Michal Marek
  0 siblings, 1 reply; 33+ messages in thread
From: Valdis.Kletnieks @ 2011-05-02 15:17 UTC (permalink / raw)
  To: Michal Marek
  Cc: Stephen Rothwell, Dave Jones, linux-next, linux-kernel, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

On Mon, 02 May 2011 13:13:37 +0200, Michal Marek said:

> +# We test for support of the -Wunused-but-set-variable option, because
> +# some version of gcc will happily accept any -Wno-* switch and complain
> +# later during build.
> +ifeq ($(call cc-option-yn, -Wunused-but-set-variable), y)
> +KBUILD_CFLAGS += -Wno-unused-but-set-variable
> +endif

Do we need to do this more generically for all the other -Wno-foo
options under the various W={123} options?

[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  4:53       ` Stephen Rothwell
@ 2011-05-02 11:13         ` Michal Marek
  2011-05-02 15:17           ` Valdis.Kletnieks
  0 siblings, 1 reply; 33+ messages in thread
From: Michal Marek @ 2011-05-02 11:13 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Dave Jones, linux-next, linux-kernel, Sam Ravnborg

On Mon, May 02, 2011 at 02:53:38PM +1000, Stephen Rothwell wrote:
> Hi Dave,
> 
> hmmm,
> 
> On my build machine:
> $ /opt/cross/gcc-4.4.5-nolibc/x86_64-linux/bin/x86_64-linux-gcc -Wno-unused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
> 0
> $ /opt/cross/gcc-4.4.5-nolibc/x86_64-linux/bin/x86_64-linux-gcc -Wunused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
> cc1: error: unrecognized command line option "-Wunused-but-set-variable"
> 1
> $ gcc -Wno-unused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
> 0
> $ gcc -Wunused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
> cc1: error: unrecognized command line option "-Wunused-but-set-variable"
> 1

I reproduced this myself with 4.5.1 and 4.6.0 and was about to file a
bug at gcc.gnu.org, but I learned that this is a feature :-(, see here:
http://gcc.gnu.org/PR28322 . It treats invalid -Wno-* options as
warnings and it only issues them when there is another warning or error
in the source.

I have a patch below, but after learning the above, I'm going to rewrite
it to some more generic cc-disable-warning fuction, because it can hit
us anytime again.

Michal

Subject: [PATCH] kbuild: Fix passing -Wno-unused-but-set-variable to some gcc versions

Some versions of gcc will happily accept -Wno-<anything> in the
cc-option test and complain later when compiling some random file that
-Wno-unused-but-set-variable is not recognized. Work around this by
testing if gcc supports the -Wunused-but-set-variable option insteaed.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>

diff --git a/Makefile b/Makefile
index 4527dc2..db6b6df 100644
--- a/Makefile
+++ b/Makefile
@@ -569,7 +569,12 @@ endif
 
 # This warning generated too much noise in a regular build.
 # Use make W=1 to enable this warning (see scripts/Makefile.build)
-KBUILD_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable)
+# We test for support of the -Wunused-but-set-variable option, because
+# some version of gcc will happily accept any -Wno-* switch and complain
+# later during build.
+ifeq ($(call cc-option-yn, -Wunused-but-set-variable), y)
+KBUILD_CFLAGS += -Wno-unused-but-set-variable
+endif
 
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  4:36       ` Dave Jones
@ 2011-05-02  5:57         ` Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2011-05-02  5:57 UTC (permalink / raw)
  To: Dave Jones; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]

Hi Dave,

On Mon, 2 May 2011 00:36:43 -0400 Dave Jones <davej@redhat.com> wrote:
>
> That's interesting. That suggests that something isn't being built with KBUILD_CFLAGS.
> I did a full defconfig build on x86-64 successfully (allmodconfig is churning away).
> Can you point me at something that doesn't build ?

I have just done an i386 defconfig build with V=1.  Every compilation has
that flag passed to it, but only one complains:

  i386-linux-gcc -Wp,-MD,kernel/.futex.o.d  -nostdinc -isystem /opt/cross/gcc-4.4.5-nolibc/i386-linux/bin/../lib/gcc/i386-linux/4.4.5/include -I/scratch/sfr/next/arch/x86/include -Iarch/x86/include/generated -Iinclude  -I/scratch/sfr/next/include -include include/generated/autoconf.h  -I/scratch/sfr/next/kernel -Ikernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m32 -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -Wa,-mtune=generic32 -ffreestanding -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(futex)"  -D"KBUILD_MODNAME=KBUILD_STR(futex)" -c -o kernel/futex.o /scratch/sfr/next/kernel/futex.c
/scratch/sfr/next/kernel/futex.c: In function 'fixup_pi_state_owner':
/scratch/sfr/next/kernel/futex.c:1549: warning: 'curval' may be used uninitialized in this function
/scratch/sfr/next/kernel/futex.c: In function 'futex_lock_pi_atomic':
/scratch/sfr/next/kernel/futex.c:678: warning: 'curval' may be used uninitialized in this function
/scratch/sfr/next/kernel/futex.c: In function 'handle_futex_death':
/scratch/sfr/next/kernel/futex.c:2454: warning: 'nval' may be used uninitialized in this function
At top level:
cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"

I removed kernel/futex.o and recompiled to verify.  futex.c doesn't seem
to be built any differently to anything else.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  4:24     ` Stephen Rothwell
  2011-05-02  4:36       ` Dave Jones
@ 2011-05-02  4:53       ` Stephen Rothwell
  2011-05-02 11:13         ` Michal Marek
  1 sibling, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2011-05-02  4:53 UTC (permalink / raw)
  To: Dave Jones; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 2495 bytes --]

Hi Dave,

hmmm,

On my build machine:
$ /opt/cross/gcc-4.4.5-nolibc/x86_64-linux/bin/x86_64-linux-gcc -Wno-unused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
0
$ /opt/cross/gcc-4.4.5-nolibc/x86_64-linux/bin/x86_64-linux-gcc -Wunused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
cc1: error: unrecognized command line option "-Wunused-but-set-variable"
1
$ gcc -Wno-unused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
0
$ gcc -Wunused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
cc1: error: unrecognized command line option "-Wunused-but-set-variable"
1
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8) 

On master.kernel.org:

$ gcc -Wno-unused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
0
$ gcc -Wunused-but-set-variable -c -xc /dev/null -o /tmp/xx.o; echo $?
0
$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) 

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  4:02     ` Dave Jones
@ 2011-05-02  4:44       ` Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2011-05-02  4:44 UTC (permalink / raw)
  To: Dave Jones; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]

Hi Dave,

On Mon, 2 May 2011 00:02:16 -0400 Dave Jones <davej@redhat.com> wrote:
>
> Subtly different from what I wrote.. the version I wrote did this ..
> 
> +KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wunused-but-set-variable)

Due to other changes in the kbuild tree, I suspect.  However, as you say,
this part is not relevant to the warning I am getting.

> I just tested with the gcc 4.4.5 on master.kernel.org, with a tip of Linus'
> tree with my original diff, and it didn't complain at all.

Also see my other email.  For a i386 defconfig build, I get this warning
only twice, for a sparc64 defconfig I get 4 and for a sparc32 defconfig,
none:

At top level:
cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"

> What does gcc -v say ?
> gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC)  seems to be fine.

$ /opt/cross/gcc-4.4.5-nolibc/x86_64-linux/bin/x86_64-linux-gcc -v
Using built-in specs.
Target: x86_64-linux
Configured with: /home/tony/buildall/src/gcc/configure --target=x86_64-linux --enable-targets=all --prefix=/home/tony/buildall/cross.x86_64/gcc-4.4.5-nolibc/x86_64-linux/ --enable-languages=c --with-newlib --without-headers --with-system-libunwind --disable-nls --disable-threads --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-decimal-float --enable-checking=release --with-mpfr=/home/tony/buildall/src/sys-x86_64 --with-gmp=/home/tony/buildall/src/sys-x86_64 --disable-bootstrap
Thread model: single
gcc version 4.4.5 (GCC) 

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  4:24     ` Stephen Rothwell
@ 2011-05-02  4:36       ` Dave Jones
  2011-05-02  5:57         ` Stephen Rothwell
  2011-05-02  4:53       ` Stephen Rothwell
  1 sibling, 1 reply; 33+ messages in thread
From: Dave Jones @ 2011-05-02  4:36 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

On Mon, May 02, 2011 at 02:24:54PM +1000, Stephen Rothwell wrote:
 > Hi Dave,
 > 
 > On Mon, 2 May 2011 13:45:24 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
 > >
 > > On Sun, 1 May 2011 22:24:18 -0400 Dave Jones <davej@redhat.com> wrote:
 > > >
 > > > Which version of the patch got merged ? This should be guarded by cc-option checks.
 > > 
 > > It looks right to me (that's why I wrote "though I don't see why") but
 > > empirically we have a problem.
 > 
 > I do not get it for every compile fo a file, just a few times during a
 > whole kernel build.  Some config/arches do not produce any (like sparc32
 > defconfig).
 
That's interesting. That suggests that something isn't being built with KBUILD_CFLAGS.
I did a full defconfig build on x86-64 successfully (allmodconfig is churning away).
Can you point me at something that doesn't build ?

	Dave

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  3:45   ` Stephen Rothwell
  2011-05-02  4:02     ` Dave Jones
@ 2011-05-02  4:24     ` Stephen Rothwell
  2011-05-02  4:36       ` Dave Jones
  2011-05-02  4:53       ` Stephen Rothwell
  1 sibling, 2 replies; 33+ messages in thread
From: Stephen Rothwell @ 2011-05-02  4:24 UTC (permalink / raw)
  To: Dave Jones; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

Hi Dave,

On Mon, 2 May 2011 13:45:24 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Sun, 1 May 2011 22:24:18 -0400 Dave Jones <davej@redhat.com> wrote:
> >
> > Which version of the patch got merged ? This should be guarded by cc-option checks.
> 
> It looks right to me (that's why I wrote "though I don't see why") but
> empirically we have a problem.

I do not get it for every compile fo a file, just a few times during a
whole kernel build.  Some config/arches do not produce any (like sparc32
defconfig).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  3:45   ` Stephen Rothwell
@ 2011-05-02  4:02     ` Dave Jones
  2011-05-02  4:44       ` Stephen Rothwell
  2011-05-02  4:24     ` Stephen Rothwell
  1 sibling, 1 reply; 33+ messages in thread
From: Dave Jones @ 2011-05-02  4:02 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

On Mon, May 02, 2011 at 01:45:24PM +1000, Stephen Rothwell wrote:

 > diff --git a/scripts/Makefile.build b/scripts/Makefile.build
 > index 9c0c481..9fb19c0 100644
 > --- a/scripts/Makefile.build
 > +++ b/scripts/Makefile.build
 > @@ -66,6 +66,7 @@ warning-1 += -Wmissing-format-attribute
 >  warning-1 += -Wmissing-prototypes
 >  warning-1 += -Wold-style-definition
 >  warning-1 += $(call cc-option, -Wmissing-include-dirs)
 > +warning-1 += $(call cc-option, -Wunused-but-set-variable)

Subtly different from what I wrote.. the version I wrote did this ..

+KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wunused-but-set-variable)

I just tested with the gcc 4.4.5 on master.kernel.org, with a tip of Linus'
tree with my original diff, and it didn't complain at all. 
What does gcc -v say ?
gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC)  seems to be fine.

(note the above hunk isn't relevant unless using W=1 builds anyway,
so I'm at a loss as to what broke it..)

	Dave


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  2:24 ` Dave Jones
@ 2011-05-02  3:45   ` Stephen Rothwell
  2011-05-02  4:02     ` Dave Jones
  2011-05-02  4:24     ` Stephen Rothwell
  0 siblings, 2 replies; 33+ messages in thread
From: Stephen Rothwell @ 2011-05-02  3:45 UTC (permalink / raw)
  To: Dave Jones; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

Hi Dave,

On Sun, 1 May 2011 22:24:18 -0400 Dave Jones <davej@redhat.com> wrote:
>
> Which version of the patch got merged ? This should be guarded by cc-option checks.

It looks right to me (that's why I wrote "though I don't see why") but
empirically we have a problem.

This is what is in -next today:

From: Dave Jones <davej@redhat.com>
Date: Thu, 21 Apr 2011 17:28:13 -0400
Subject: [PATCH] kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0

Disable the new -Wunused-but-set-variable that was added in gcc 4.6.0
It produces more false positives than useful warnings.

This can still be enabled using W=1

Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Makefile               |    4 ++++
 scripts/Makefile.build |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index e509cc7..4527dc2 100644
--- a/Makefile
+++ b/Makefile
@@ -567,6 +567,10 @@ ifndef CONFIG_CC_STACKPROTECTOR
 KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
 endif
 
+# This warning generated too much noise in a regular build.
+# Use make W=1 to enable this warning (see scripts/Makefile.build)
+KBUILD_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable)
+
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
 else
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 9c0c481..9fb19c0 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -66,6 +66,7 @@ warning-1 += -Wmissing-format-attribute
 warning-1 += -Wmissing-prototypes
 warning-1 += -Wold-style-definition
 warning-1 += $(call cc-option, -Wmissing-include-dirs)
+warning-1 += $(call cc-option, -Wunused-but-set-variable)
 
 warning-2 := -Waggregate-return
 warning-2 += -Wcast-align
-- 
1.7.4.4

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2011-05-02  2:18 Stephen Rothwell
@ 2011-05-02  2:24 ` Dave Jones
  2011-05-02  3:45   ` Stephen Rothwell
  0 siblings, 1 reply; 33+ messages in thread
From: Dave Jones @ 2011-05-02  2:24 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Michal Marek, linux-next, linux-kernel, Sam Ravnborg

On Mon, May 02, 2011 at 12:18:17PM +1000, Stephen Rothwell wrote:
 > Hi Michal,
 > 
 > After merging the kbuild tree, today's linux-next build (x86_64
 > allmodconfig) produced this warning:
 > 
 > At top level:
 > cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"
 > 
 > Presumably caused by commit af0e5d565d2f ("kbuild: Disable
 > -Wunused-but-set-variable for gcc 4.6.0") though I don't see why.  I am
 > using gcc version 4.4.5.

Which version of the patch got merged ? This should be guarded by cc-option checks.

	Dave


^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2011-05-02  2:18 Stephen Rothwell
  2011-05-02  2:24 ` Dave Jones
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2011-05-02  2:18 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-next, linux-kernel, Dave Jones, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

Hi Michal,

After merging the kbuild tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

At top level:
cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"

Presumably caused by commit af0e5d565d2f ("kbuild: Disable
-Wunused-but-set-variable for gcc 4.6.0") though I don't see why.  I am
using gcc version 4.4.5.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2010-12-23  0:00 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2010-12-23  0:00 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-next, linux-kernel, Arnaud Lacombe

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

Hi Michal,

After merging the kbuild tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

In file included from scripts/kconfig/zconf.tab.c:2502:
scripts/kconfig/expr.c:1033: warning: no previous prototype for 'expr_simplify_unmet_dep'

Introduced by commit 1137c56b7420c801147e0863845c03b07554721a ("kconfig:
simplify select-with-unmet-direct-dependency warning").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2010-09-30  0:50 Stephen Rothwell
@ 2010-09-30 20:25 ` Michal Marek
  0 siblings, 0 replies; 33+ messages in thread
From: Michal Marek @ 2010-09-30 20:25 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Arnaud Lacombe, Sam Ravnborg

On Thu, Sep 30, 2010 at 10:50:25AM +1000, Stephen Rothwell wrote:
> Hi Michal,
> 
> After merging the kbuild tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> scripts/kconfig/kxgettext.c: In function 'menu_build_message_list':
> scripts/kconfig/kxgettext.c:175: warning: passing argument 3 of 'message__add' discards qualifiers from pointer target type
> scripts/kconfig/kxgettext.c:148: note: expected 'char *' but argument is of type 'const char * const'
> scripts/kconfig/kxgettext.c:180: warning: passing argument 3 of 'message__add' discards qualifiers from pointer target type
> scripts/kconfig/kxgettext.c:148: note: expected 'char *' but argument is of type 'const char * const'

Thanks, fixed with


From: Michal Marek <mmarek@suse.cz>
Subject: kconfig: Propagate const

Commit 2e7a091 made struct file->name a const char*, but forgot to
constify all users of it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/kconfig/kxgettext.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index dcc3fcc..e9d8e79 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -63,11 +63,11 @@ next:
 
 struct file_line {
 	struct file_line *next;
-	char*		 file;
-	int		 lineno;
+	const char *file;
+	int lineno;
 };
 
-static struct file_line *file_line__new(char *file, int lineno)
+static struct file_line *file_line__new(const char *file, int lineno)
 {
 	struct file_line *self = malloc(sizeof(*self));
 
@@ -90,7 +90,8 @@ struct message {
 
 static struct message *message__list;
 
-static struct message *message__new(const char *msg, char *option, char *file, int lineno)
+static struct message *message__new(const char *msg, char *option,
+				    const char *file, int lineno)
 {
 	struct message *self = malloc(sizeof(*self));
 
@@ -130,7 +131,8 @@ static struct message *mesage__find(const char *msg)
 	return m;
 }
 
-static int message__add_file_line(struct message *self, char *file, int lineno)
+static int message__add_file_line(struct message *self, const char *file,
+				  int lineno)
 {
 	int rc = -1;
 	struct file_line *fl = file_line__new(file, lineno);
@@ -145,7 +147,8 @@ out:
 	return rc;
 }
 
-static int message__add(const char *msg, char *option, char *file, int lineno)
+static int message__add(const char *msg, char *option, const char *file,
+			int lineno)
 {
 	int rc = 0;
 	char bf[16384];
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: linux-next: build warning after merge of the kbuild tree
  2010-09-30  0:52 Stephen Rothwell
@ 2010-09-30 20:24 ` Michal Marek
  0 siblings, 0 replies; 33+ messages in thread
From: Michal Marek @ 2010-09-30 20:24 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Arnaud Lacombe, Sam Ravnborg

On Thu, Sep 30, 2010 at 10:52:22AM +1000, Stephen Rothwell wrote:
> After merging the kbuild tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> In file included from scripts/kconfig/zconf.tab.c:2485:
> scripts/kconfig/symbol.c: In function 'sym_expand_string_value':
> scripts/kconfig/symbol.c:881: warning: ignoring return value of 'realloc', declared with attribute warn_unused_result
> 
> Introduced by commit 76a540958af5390a94b7f68c46cb7f2aed34ccf1 ("kconfig:
> add a symbol string expansion helper").

Thanks a lot for spotting it, fixed with

From: Michal Marek <mmarek@suse.cz>
Subject: kconfig: Fix realloc usage()

Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/kconfig/symbol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index dc5dcf2..c0efe10 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -878,7 +878,7 @@ const char *sym_expand_string_value(const char *in)
 		newlen = strlen(res) + strlen(symval) + strlen(src);
 		if (newlen > reslen) {
 			reslen = newlen;
-			realloc(res, reslen);
+			res = realloc(res, reslen);
 		}
 
 		strcat(res, symval);

Actually dealing with OOM condition would be another patch, right now
most of kconfig ignores it.

Michal

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2010-09-30  0:52 Stephen Rothwell
  2010-09-30 20:24 ` Michal Marek
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2010-09-30  0:52 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-next, linux-kernel, Arnaud Lacombe, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Hi Michal,

After merging the kbuild tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

In file included from scripts/kconfig/zconf.tab.c:2485:
scripts/kconfig/symbol.c: In function 'sym_expand_string_value':
scripts/kconfig/symbol.c:881: warning: ignoring return value of 'realloc', declared with attribute warn_unused_result

Introduced by commit 76a540958af5390a94b7f68c46cb7f2aed34ccf1 ("kconfig:
add a symbol string expansion helper").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* linux-next: build warning after merge of the kbuild tree
@ 2010-09-30  0:50 Stephen Rothwell
  2010-09-30 20:25 ` Michal Marek
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2010-09-30  0:50 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-next, linux-kernel, Arnaud Lacombe, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

Hi Michal,

After merging the kbuild tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

scripts/kconfig/kxgettext.c: In function 'menu_build_message_list':
scripts/kconfig/kxgettext.c:175: warning: passing argument 3 of 'message__add' discards qualifiers from pointer target type
scripts/kconfig/kxgettext.c:148: note: expected 'char *' but argument is of type 'const char * const'
scripts/kconfig/kxgettext.c:180: warning: passing argument 3 of 'message__add' discards qualifiers from pointer target type
scripts/kconfig/kxgettext.c:148: note: expected 'char *' but argument is of type 'const char * const'

Probably caused by commit 2e7a091833f014cac8a6b92573ca6cd2edd2753c
("kconfig: constify file name").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2023-10-03 23:14 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 23:28 linux-next: build warning after merge of the kbuild tree Stephen Rothwell
2021-08-23  0:25 ` Masahiro Yamada
  -- strict thread matches above, loose matches on Subject: below --
2023-10-03 23:13 Stephen Rothwell
2023-08-28  4:57 Stephen Rothwell
2023-08-28 17:28 ` Nick Desaulniers
2020-12-20 22:10 Stephen Rothwell
2020-12-09  9:30 Stephen Rothwell
2020-12-09 13:01 ` Dominique Martinet
2020-12-09 20:56   ` Stephen Rothwell
2020-12-10  6:47     ` Dominique Martinet
2020-12-14 20:44 ` Stephen Rothwell
2017-12-10 22:52 Stephen Rothwell
2017-12-11  0:22 ` Masahiro Yamada
2017-12-11 16:11   ` Bart Van Assche
2016-11-30 23:06 Stephen Rothwell
2016-12-01  2:00 ` Nicholas Piggin
2011-05-02  2:18 Stephen Rothwell
2011-05-02  2:24 ` Dave Jones
2011-05-02  3:45   ` Stephen Rothwell
2011-05-02  4:02     ` Dave Jones
2011-05-02  4:44       ` Stephen Rothwell
2011-05-02  4:24     ` Stephen Rothwell
2011-05-02  4:36       ` Dave Jones
2011-05-02  5:57         ` Stephen Rothwell
2011-05-02  4:53       ` Stephen Rothwell
2011-05-02 11:13         ` Michal Marek
2011-05-02 15:17           ` Valdis.Kletnieks
2011-05-02 15:31             ` Michal Marek
2010-12-23  0:00 Stephen Rothwell
2010-09-30  0:52 Stephen Rothwell
2010-09-30 20:24 ` Michal Marek
2010-09-30  0:50 Stephen Rothwell
2010-09-30 20:25 ` Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.