linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Sam James <sam@gentoo.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Discussions about the Letux Kernel 
	<letux-kernel@openphoenux.org>
Subject: [BUG] Add missing <linux/string.h> include for strcmp.
Date: Mon, 28 Nov 2022 18:15:55 +0100	[thread overview]
Message-ID: <A222B1E6-69B8-4085-AD1B-27BDB72CA971@goldelico.com> (raw)

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


             reply	other threads:[~2022-11-28 17:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 17:15 H. Nikolaus Schaller [this message]
2022-11-28 21:25 ` [BUG] Add missing <linux/string.h> include for strcmp Andrew Morton
2022-11-28 21:27   ` Sam James
2023-02-01 23:37 Sam James
2023-02-02  8:55 ` H. Nikolaus Schaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A222B1E6-69B8-4085-AD1B-27BDB72CA971@goldelico.com \
    --to=hns@goldelico.com \
    --cc=akpm@linux-foundation.org \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).