* kbuild will remove .c files
@ 2004-03-03 20:34 Chris Wright
2004-03-03 21:07 ` Sam Ravnborg
0 siblings, 1 reply; 4+ messages in thread
From: Chris Wright @ 2004-03-03 20:34 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel
I added a new config to my kernel, and hadn't done a bk -r get in quite
a while. Turns out the subdir relevant to the config item hits the make
builtin to get the file (since it had been missing), but then kbuild
assembles, links, links, and finally removes the .c file. This will
be done everytime, since the .c file is now gone. While a preemptive
bk -r get is the obvious solution here (or even a after the fact bk get
$missing.c), is this a possible very small buglet in kbuild?
Here's some relevant output:
get net/irda/irlan/SCCS/s.irlan_client.c
net/irda/irlan/irlan_client.c 1.8: 565 lines
CC net/irda/irlan/irlan_client.s
as -o net/irda/irlan/irlan_client.o net/irda/irlan/irlan_client.s
LD net/irda/irlan/irlan.o
LD net/irda/irlan/built-in.o
rm net/irda/irlan/irlan_client.c
And only the net/irda/irlan/.irlan_client.s.cmd is created.
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kbuild will remove .c files
2004-03-03 20:34 Chris Wright
@ 2004-03-03 21:07 ` Sam Ravnborg
2004-03-03 21:38 ` Chris Wright
0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2004-03-03 21:07 UTC (permalink / raw)
To: Chris Wright; +Cc: Sam Ravnborg, linux-kernel
On Wed, Mar 03, 2004 at 12:34:06PM -0800, Chris Wright wrote:
> I added a new config to my kernel, and hadn't done a bk -r get in quite
> a while. Turns out the subdir relevant to the config item hits the make
> builtin to get the file (since it had been missing), but then kbuild
> assembles, links, links, and finally removes the .c file. This will
> be done everytime, since the .c file is now gone. While a preemptive
> bk -r get is the obvious solution here (or even a after the fact bk get
> $missing.c), is this a possible very small buglet in kbuild?
>
> Here's some relevant output:
>
> get net/irda/irlan/SCCS/s.irlan_client.c
> net/irda/irlan/irlan_client.c 1.8: 565 lines
> CC net/irda/irlan/irlan_client.s
> as -o net/irda/irlan/irlan_client.o net/irda/irlan/irlan_client.s
> LD net/irda/irlan/irlan.o
> LD net/irda/irlan/built-in.o
> rm net/irda/irlan/irlan_client.c
What happens here is that make resort to a chained rule to create the
irlan.o file.
The chain goes from SCCS/%.c -> %.c -> %.s -> %.o
The two files %.c and %.s is considered intermidiate files, and make
guarantees that intermidiate files that did not exist when
make was called, does not exists when make exists.
This is reported by make with the "rm ..." line.
See info make -> Implicit rules - > Chained rules
The reason why you see this is that there is no implicit rule from SCCS/%.c -> %.c
wich is because kbuild does not 'know' of SCCS/* - but make uses some build-in
rule for this.
Two questions pops up though.
First my make documentatin say the make would use "rm -f ...",not "rm".
What make version do you use?
Also I would expect to see irlan_client.s to be deleted also - did you miss that?
It may show up a bit later.
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kbuild will remove .c files
2004-03-03 21:07 ` Sam Ravnborg
@ 2004-03-03 21:38 ` Chris Wright
0 siblings, 0 replies; 4+ messages in thread
From: Chris Wright @ 2004-03-03 21:38 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Chris Wright, linux-kernel
* Sam Ravnborg (sam@ravnborg.org) wrote:
> What happens here is that make resort to a chained rule to create the
> irlan.o file.
> The chain goes from SCCS/%.c -> %.c -> %.s -> %.o
>
> The two files %.c and %.s is considered intermidiate files, and make
> guarantees that intermidiate files that did not exist when
> make was called, does not exists when make exists.
> This is reported by make with the "rm ..." line.
Ah, I was trying to find it in kbuild.
> First my make documentatin say the make would use "rm -f ...",not "rm".
> What make version do you use?
GNU Make 3.80
> Also I would expect to see irlan_client.s to be deleted also - did you miss that?
> It may show up a bit later.
No, it is not deleted.
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-03-03 22:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1vLk4-6uK-23@gated-at.bofh.it>
[not found] ` <1vLWC-7h0-1@gated-at.bofh.it>
2004-03-03 22:35 ` kbuild will remove .c files Pascal Schmidt
2004-03-03 20:34 Chris Wright
2004-03-03 21:07 ` Sam Ravnborg
2004-03-03 21:38 ` Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox