All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [BUG] Add missing <linux/string.h> include for strcmp.
@ 2023-02-01 23:37 Sam James
  2023-02-02  8:55 ` H. Nikolaus Schaller
  0 siblings, 1 reply; 5+ messages in thread
From: Sam James @ 2023-02-01 23:37 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Andrew Morton, Discussions about the Letux Kernel,
	linux Kernel Mailing List

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

Finally getting back to this. Thanks for reporting the problem (we reverted it as a result, obviously).

Would you mind sharing a preprocessed version of the failing file please?

(Passing -save-temps to CC can do this, the relevant files should be xx.i)

Thanks.


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 358 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [BUG] Add missing <linux/string.h> include for strcmp.
@ 2022-11-28 17:15 H. Nikolaus Schaller
  2022-11-28 21:25 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: H. Nikolaus Schaller @ 2022-11-28 17:15 UTC (permalink / raw)
  To: Sam James
  Cc: Andrew Morton, linux Kernel Mailing List,
	Discussions about the Letux Kernel

Hi,
starting with v6.1-rc7 I can't build my tree any more:

  HOSTCC  scripts/mod/modpost.o - due to target missing
In file included from include/linux/string.h:5,
                 from scripts/mod/../../include/linux/license.h:5,
                 from scripts/mod/modpost.c:24:
include/linux/compiler.h:246:10: fatal error: asm/rwonce.h: No such file or directory
  246 | #include <asm/rwonce.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

Bisect did show your patch as the first bad one:

commit 50c697215a8c "Add missing <linux/string.h> include for strcmp."

Reverting it makes compile succeed.

The problem is that HOSTCC is not necessarily the same compiler or even
architecture as CC and pulling in <linux/compiler.h> or <asm/rwonce.h>
files indirectly isn't a good idea then.

My toolchain is providing HOSTCC = gcc (MacPorts) and CC = arm-linux-gnueabihf
(built from gcc source) and all running on Darwin.

If I change the include to <string.h> I can then "HOSTCC scripts/mod/modpost.c"
but then it fails for "CC kernel/module/main.c" not finding <string.h>:

  CC      kernel/module/main.o - due to target missing
In file included from kernel/module/main.c:43:0:
./include/linux/license.h:5:20: fatal error: string.h: No such file or directory
 #include <string.h>
                    ^
compilation terminated.

So this should be a conditional include depending on CC vs. HOSTCC.
Or moved elsewhere.

BR and thanks,
Nikolaus


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

end of thread, other threads:[~2023-02-02  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 23:37 [BUG] Add missing <linux/string.h> include for strcmp Sam James
2023-02-02  8:55 ` H. Nikolaus Schaller
  -- strict thread matches above, loose matches on Subject: below --
2022-11-28 17:15 H. Nikolaus Schaller
2022-11-28 21:25 ` Andrew Morton
2022-11-28 21:27   ` Sam James

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.