improve gate generation
PATCH 1/1 improve gate generation
This patch fixes a couple of things.
- gate.lds.s is generated in the obj tree, not the src tree.
- It can be generated by the normal .s.S rule.
- Adding the extra-y list prevents it from being rebuilt unnecessarily.
Index: arch/ia64/kernel/Makefile
=================================RCS file: /var/cvs/linux-2.6/arch/ia64/kernel/Makefile,v retrieving revision 1.4
ia64/kernel/Makefile +3 -3
@@ -22,15 +22,15 @@ obj-$(CONFIG_PERFMON) += perfmon_defaul # The gate DSO image is built using a special linker script. targets += gate.so gate-syms.o +extra-y += gate.so gate-syms.o gate.lds.s gate.o + AFLAGS_gate.lds.o += -P -C -U$(ARCH) -arch/ia64/kernel/gate.lds.s: %.s: %.S scripts FORCE - $(call if_changed_dep,as_s_S) quiet_cmd_gate = GATE $@ cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 -$(obj)/gate.so: $(src)/gate.lds.s $(obj)/gate.o FORCE +$(obj)/gate.so: $(obj)/gate.lds.s $(obj)/gate.o FORCE $(call if_changed,gate) $(obj)/built-in.o: $(obj)/gate-syms.o
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Matthew Wilcox
Matthew> This patch fixes a couple of things.
Matthew> - gate.lds.s is generated in the obj tree, not the src tree. Matthew> - It can be generated by the normal .s.S rule.
OK.
Matthew> - Adding the extra-y list prevents it from being rebuilt Matthew> unnecessarily.
Ah, so _that's_ the missing magic.
Now if only the patch applied with "patch -p1"... (don't worry about it this time---I fixed it by hand).
Thanks,
--david
Quoted 5 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Matthew Wilcox
Matthew> - Adding the extra-y list prevents it from being rebuilt Matthew> unnecessarily.
Ah, so _that's_ the missing magic.
Yeah, it was bugging me too. Not enough to fix it until I wanted to run "sudo make install" and of course the output was then owned by root. Took me a while to figure it out; finally I asked myself what the difference was between gate.lds.s and vmlinux.lds, and vmlinux.lds was in extra-y. Make does so much that staring at make -d isn't always a great help. ("It depends on FORCE. Hm. But why doesn't that other thing depend on FORCE?")
Quoted 2 lines
Now if only the patch applied with "patch -p1"... (don't worry about it this time---I fixed it by hand).
Ta. I actually have a patched version of CVS that'll generate -p1 by default, just need to get it installed on that server.
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Matthew Wilcox
Quoted 1 line · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Matthew Wilcox
Matthew> - Adding the extra-y list prevents it from being rebuilt Matthew> unnecessarily.
Quoted 1 line
Quoted 1 line
Ah, so _that's_ the missing magic.
Matthew> Yeah, it was bugging me too. Not enough to fix it until I Matthew> wanted to run "sudo make install" and of course the output Matthew> was then owned by root. Took me a while to figure it out; Matthew> finally I asked myself what the difference was between Matthew> gate.lds.s and vmlinux.lds, and vmlinux.lds was in extra-y. Matthew> Make does so much that staring at make -d isn't always a Matthew> great help. ("It depends on FORCE. Hm. But why doesn't Matthew> that other thing depend on FORCE?")
I looked into it briefly at some point, too, but concluded that perhaps the old behavior was the intended one (perhaps dependencies don't get tracked properly for all possible cases?). At least, I don't see anything mentioned for extra-y on i386 other than vsyscall-syms.o.
--david