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
> On 28 Nov 2022, at 21:25, Andrew Morton <[email protected]> wrote:
>
> On Mon, 28 Nov 2022 18:15:55 +0100 "H. Nikolaus Schaller" <[email protected]> wrote:
>
>> 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.
>
> Thanks. I queued a reversion patch.
Thanks, I can't look into it properly right now so this is the best course of action. I'll test cross and the like then submit a fixed one in a few days.
On Mon, 28 Nov 2022 18:15:55 +0100 "H. Nikolaus Schaller" <[email protected]> wrote:
> 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.
Thanks. I queued a reversion patch.
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.
Hi Sam,
> Am 02.02.2023 um 00:37 schrieb Sam James <[email protected]>:
>
> 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)
Build v6.1-rc7 with ARCH=arm V=2 clean omap2plus_defconfig uImage
...
SYSTBL arch/arm/include/generated/calls-oabi.S - due to calls-oabi.S not in $(targets)
SYSTBL arch/arm/include/generated/calls-eabi.S - due to calls-eabi.S not in $(targets)
HOSTCC scripts/mod/mk_elfconfig - due to missing .cmd file
CC scripts/mod/empty.o - due to target missing
MKELF scripts/mod/elfconfig.h - due to: scripts/mod/empty.o scripts/mod/mk_elfconfig
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.
scripts/Makefile.host:128: recipe for target 'scripts/mod/modpost.o' failed
make[2]: *** [scripts/mod/modpost.o] Error 1
Makefile:1269: recipe for target 'prepare0' failed
make[1]: *** [prepare0] Error 2
Makefile:362: recipe for target '__build_one_by_one' failed
make: *** [__build_one_by_one] Error 2
Attached is the modpost.i
After the failed #include it is apparently incomplete.
BR and thanks,
Nikolaus