Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
Hi James, On 18/04/18 00:09, James Hogan wrote: On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index adce180f3ee4..e03f522c33ac 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o -extra-y += ashldi3.c bswapsi.c -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c +extra-y += ashldi3.c +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c + $(call cmd,shipped) + +extra-y += bswapsi.c +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c $(call cmd,shipped) ci20_defconfig: arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file or directory #include "libgcc.h" ^~ It looks like it had already copied ashldi3.c from arch/mips/lib/ when building an older commit, and it hasn't been regenerated from lib/ since the Makefile changed, so its still using the old version. I think it should be using FORCE and if_changed like this: diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index e03f522c33ac..abe77add8789 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o extra-y += ashldi3.c -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c - $(call cmd,shipped) +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE + $(call if_changed,shipped) extra-y += bswapsi.c -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c - $(call cmd,shipped) +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE + $(call if_changed,shipped) targets := $(notdir $(vmlinuzobjs-y)) That resolves the build failures when checking out old -> new without cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. It should also resolve issues if the path it copies from is updated in future since the .ashldi3.c.cmd will get updated. If you checkout new -> old without cleaning, the now removed arch/mips/lib/ashldi3.c will get added which will trigger regeneration, so it won't error. However if you do new -> old -> new then the .ashldi3.cmd file isn't updated while at old, so you get the same error as above. I'm not sure there's much we can practically do about that, aside perhaps avoiding the issue in future by somehow auto-deleting stale .*.cmd files. Cc'ing kbuild folk in case they have any bright ideas. At least the straightforward old->new upgrade will work with the above fixup though. If you're okay with it I'm happy to apply as a fixup. Unbelievable how fragile this change is proving to be :-/ Yeah fixup looks good to me. Thanks, Matt Cheers James
Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
Hi James, On 18/04/18 00:09, James Hogan wrote: On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index adce180f3ee4..e03f522c33ac 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o -extra-y += ashldi3.c bswapsi.c -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c +extra-y += ashldi3.c +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c + $(call cmd,shipped) + +extra-y += bswapsi.c +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c $(call cmd,shipped) ci20_defconfig: arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file or directory #include "libgcc.h" ^~ It looks like it had already copied ashldi3.c from arch/mips/lib/ when building an older commit, and it hasn't been regenerated from lib/ since the Makefile changed, so its still using the old version. I think it should be using FORCE and if_changed like this: diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index e03f522c33ac..abe77add8789 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o extra-y += ashldi3.c -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c - $(call cmd,shipped) +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE + $(call if_changed,shipped) extra-y += bswapsi.c -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c - $(call cmd,shipped) +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE + $(call if_changed,shipped) targets := $(notdir $(vmlinuzobjs-y)) That resolves the build failures when checking out old -> new without cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. It should also resolve issues if the path it copies from is updated in future since the .ashldi3.c.cmd will get updated. If you checkout new -> old without cleaning, the now removed arch/mips/lib/ashldi3.c will get added which will trigger regeneration, so it won't error. However if you do new -> old -> new then the .ashldi3.cmd file isn't updated while at old, so you get the same error as above. I'm not sure there's much we can practically do about that, aside perhaps avoiding the issue in future by somehow auto-deleting stale .*.cmd files. Cc'ing kbuild folk in case they have any bright ideas. At least the straightforward old->new upgrade will work with the above fixup though. If you're okay with it I'm happy to apply as a fixup. Unbelievable how fragile this change is proving to be :-/ Yeah fixup looks good to me. Thanks, Matt Cheers James
Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
2018-04-18 8:09 GMT+09:00 James Hogan: > On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: >> diff --git a/arch/mips/boot/compressed/Makefile >> b/arch/mips/boot/compressed/Makefile >> index adce180f3ee4..e03f522c33ac 100644 >> --- a/arch/mips/boot/compressed/Makefile >> +++ b/arch/mips/boot/compressed/Makefile >> @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: >> $(srctree)/arch/mips/ath79/early_printk.c >> >> vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o >> >> -extra-y += ashldi3.c bswapsi.c >> -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += >> -I$(srctree)/arch/mips/lib >> -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c >> +extra-y += ashldi3.c >> +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c >> + $(call cmd,shipped) >> + >> +extra-y += bswapsi.c >> +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c >> $(call cmd,shipped) > > ci20_defconfig: > > arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file > or directory > #include "libgcc.h" >^~ > > It looks like it had already copied ashldi3.c from arch/mips/lib/ when > building an older commit, and it hasn't been regenerated from lib/ since > the Makefile changed, so its still using the old version. > > I think it should be using FORCE and if_changed like this: > > diff --git a/arch/mips/boot/compressed/Makefile > b/arch/mips/boot/compressed/Makefile > index e03f522c33ac..abe77add8789 100644 > --- a/arch/mips/boot/compressed/Makefile > +++ b/arch/mips/boot/compressed/Makefile > @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: > $(srctree)/arch/mips/ath79/early_printk.c > vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o > > extra-y += ashldi3.c > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c > - $(call cmd,shipped) > +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE > + $(call if_changed,shipped) > > extra-y += bswapsi.c > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > - $(call cmd,shipped) > +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE > + $(call if_changed,shipped) > > targets := $(notdir $(vmlinuzobjs-y)) > > That resolves the build failures when checking out old -> new without > cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. > > It should also resolve issues if the path it copies from is updated in > future since the .ashldi3.c.cmd will get updated. > > If you checkout new -> old without cleaning, the now removed > arch/mips/lib/ashldi3.c will get added which will trigger regeneration, > so it won't error. > > However if you do new -> old -> new then the .ashldi3.cmd file isn't > updated while at old, so you get the same error as above. I'm not sure > there's much we can practically do about that, aside perhaps avoiding > the issue in future by somehow auto-deleting stale .*.cmd files. > > Cc'ing kbuild folk in case they have any bright ideas. I do not have any idea better than if_changed. > At least the straightforward old->new upgrade will work with the above > fixup though. If you're okay with it I'm happy to apply as a fixup. > -- Best Regards Masahiro Yamada
Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
2018-04-18 8:09 GMT+09:00 James Hogan : > On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: >> diff --git a/arch/mips/boot/compressed/Makefile >> b/arch/mips/boot/compressed/Makefile >> index adce180f3ee4..e03f522c33ac 100644 >> --- a/arch/mips/boot/compressed/Makefile >> +++ b/arch/mips/boot/compressed/Makefile >> @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: >> $(srctree)/arch/mips/ath79/early_printk.c >> >> vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o >> >> -extra-y += ashldi3.c bswapsi.c >> -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += >> -I$(srctree)/arch/mips/lib >> -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c >> +extra-y += ashldi3.c >> +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c >> + $(call cmd,shipped) >> + >> +extra-y += bswapsi.c >> +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c >> $(call cmd,shipped) > > ci20_defconfig: > > arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file > or directory > #include "libgcc.h" >^~ > > It looks like it had already copied ashldi3.c from arch/mips/lib/ when > building an older commit, and it hasn't been regenerated from lib/ since > the Makefile changed, so its still using the old version. > > I think it should be using FORCE and if_changed like this: > > diff --git a/arch/mips/boot/compressed/Makefile > b/arch/mips/boot/compressed/Makefile > index e03f522c33ac..abe77add8789 100644 > --- a/arch/mips/boot/compressed/Makefile > +++ b/arch/mips/boot/compressed/Makefile > @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: > $(srctree)/arch/mips/ath79/early_printk.c > vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o > > extra-y += ashldi3.c > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c > - $(call cmd,shipped) > +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE > + $(call if_changed,shipped) > > extra-y += bswapsi.c > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > - $(call cmd,shipped) > +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE > + $(call if_changed,shipped) > > targets := $(notdir $(vmlinuzobjs-y)) > > That resolves the build failures when checking out old -> new without > cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. > > It should also resolve issues if the path it copies from is updated in > future since the .ashldi3.c.cmd will get updated. > > If you checkout new -> old without cleaning, the now removed > arch/mips/lib/ashldi3.c will get added which will trigger regeneration, > so it won't error. > > However if you do new -> old -> new then the .ashldi3.cmd file isn't > updated while at old, so you get the same error as above. I'm not sure > there's much we can practically do about that, aside perhaps avoiding > the issue in future by somehow auto-deleting stale .*.cmd files. > > Cc'ing kbuild folk in case they have any bright ideas. I do not have any idea better than if_changed. > At least the straightforward old->new upgrade will work with the above > fixup though. If you're okay with it I'm happy to apply as a fixup. > -- Best Regards Masahiro Yamada
Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: > diff --git a/arch/mips/boot/compressed/Makefile > b/arch/mips/boot/compressed/Makefile > index adce180f3ee4..e03f522c33ac 100644 > --- a/arch/mips/boot/compressed/Makefile > +++ b/arch/mips/boot/compressed/Makefile > @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: > $(srctree)/arch/mips/ath79/early_printk.c > > vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o > > -extra-y += ashldi3.c bswapsi.c > -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += > -I$(srctree)/arch/mips/lib > -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > +extra-y += ashldi3.c > +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c > + $(call cmd,shipped) > + > +extra-y += bswapsi.c > +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > $(call cmd,shipped) ci20_defconfig: arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file or directory #include "libgcc.h" ^~ It looks like it had already copied ashldi3.c from arch/mips/lib/ when building an older commit, and it hasn't been regenerated from lib/ since the Makefile changed, so its still using the old version. I think it should be using FORCE and if_changed like this: diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index e03f522c33ac..abe77add8789 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o extra-y += ashldi3.c -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c - $(call cmd,shipped) +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE + $(call if_changed,shipped) extra-y += bswapsi.c -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c - $(call cmd,shipped) +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE + $(call if_changed,shipped) targets := $(notdir $(vmlinuzobjs-y)) That resolves the build failures when checking out old -> new without cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. It should also resolve issues if the path it copies from is updated in future since the .ashldi3.c.cmd will get updated. If you checkout new -> old without cleaning, the now removed arch/mips/lib/ashldi3.c will get added which will trigger regeneration, so it won't error. However if you do new -> old -> new then the .ashldi3.cmd file isn't updated while at old, so you get the same error as above. I'm not sure there's much we can practically do about that, aside perhaps avoiding the issue in future by somehow auto-deleting stale .*.cmd files. Cc'ing kbuild folk in case they have any bright ideas. At least the straightforward old->new upgrade will work with the above fixup though. If you're okay with it I'm happy to apply as a fixup. Cheers James signature.asc Description: Digital signature
Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: > diff --git a/arch/mips/boot/compressed/Makefile > b/arch/mips/boot/compressed/Makefile > index adce180f3ee4..e03f522c33ac 100644 > --- a/arch/mips/boot/compressed/Makefile > +++ b/arch/mips/boot/compressed/Makefile > @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: > $(srctree)/arch/mips/ath79/early_printk.c > > vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o > > -extra-y += ashldi3.c bswapsi.c > -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += > -I$(srctree)/arch/mips/lib > -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > +extra-y += ashldi3.c > +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c > + $(call cmd,shipped) > + > +extra-y += bswapsi.c > +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > $(call cmd,shipped) ci20_defconfig: arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file or directory #include "libgcc.h" ^~ It looks like it had already copied ashldi3.c from arch/mips/lib/ when building an older commit, and it hasn't been regenerated from lib/ since the Makefile changed, so its still using the old version. I think it should be using FORCE and if_changed like this: diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index e03f522c33ac..abe77add8789 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o extra-y += ashldi3.c -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c - $(call cmd,shipped) +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE + $(call if_changed,shipped) extra-y += bswapsi.c -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c - $(call cmd,shipped) +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE + $(call if_changed,shipped) targets := $(notdir $(vmlinuzobjs-y)) That resolves the build failures when checking out old -> new without cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. It should also resolve issues if the path it copies from is updated in future since the .ashldi3.c.cmd will get updated. If you checkout new -> old without cleaning, the now removed arch/mips/lib/ashldi3.c will get added which will trigger regeneration, so it won't error. However if you do new -> old -> new then the .ashldi3.cmd file isn't updated while at old, so you get the same error as above. I'm not sure there's much we can practically do about that, aside perhaps avoiding the issue in future by somehow auto-deleting stale .*.cmd files. Cc'ing kbuild folk in case they have any bright ideas. At least the straightforward old->new upgrade will work with the above fixup though. If you're okay with it I'm happy to apply as a fixup. Cheers James signature.asc Description: Digital signature
[PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
In preparation for removing some of the MIPS compiler intrinsics from arch/mips/lib, first update the build of vmlinuz to use the generic ashldi3 from lib. Both ashldi3 and bswapsi objects need to be built with different CFLAGS for inclusion to vmlinuz rather than simply including the object built for the main kernel image. The objects cannot be built directly from source, since CONFIG_MODVERSIONS changes cmd_cc_o_c to prevent this. Split the rule to ship ashldi3 and bswapsi from the relevant source locations. These files make no reference to other files in their directory, so the additional CFLAGS are apparently unnecessary - remove them as well. Signed-off-by: Matt Redfearn--- Changes in v6: New patch to fix vmlinuz which requires ashldi3 so must be switched to come from $(srctree)/lib before the arch/mips/ version is deleted. This version has been build tested with every upstream defconfig since previous versions caused problems with ci20_defconfig and loongson1b_defconfig. Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None arch/mips/boot/compressed/Makefile | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index adce180f3ee4..e03f522c33ac 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o -extra-y += ashldi3.c bswapsi.c -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c +extra-y += ashldi3.c +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c + $(call cmd,shipped) + +extra-y += bswapsi.c +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c $(call cmd,shipped) targets := $(notdir $(vmlinuzobjs-y)) -- 2.7.4
[PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3
In preparation for removing some of the MIPS compiler intrinsics from arch/mips/lib, first update the build of vmlinuz to use the generic ashldi3 from lib. Both ashldi3 and bswapsi objects need to be built with different CFLAGS for inclusion to vmlinuz rather than simply including the object built for the main kernel image. The objects cannot be built directly from source, since CONFIG_MODVERSIONS changes cmd_cc_o_c to prevent this. Split the rule to ship ashldi3 and bswapsi from the relevant source locations. These files make no reference to other files in their directory, so the additional CFLAGS are apparently unnecessary - remove them as well. Signed-off-by: Matt Redfearn --- Changes in v6: New patch to fix vmlinuz which requires ashldi3 so must be switched to come from $(srctree)/lib before the arch/mips/ version is deleted. This version has been build tested with every upstream defconfig since previous versions caused problems with ci20_defconfig and loongson1b_defconfig. Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None arch/mips/boot/compressed/Makefile | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index adce180f3ee4..e03f522c33ac 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o -extra-y += ashldi3.c bswapsi.c -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c +extra-y += ashldi3.c +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c + $(call cmd,shipped) + +extra-y += bswapsi.c +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c $(call cmd,shipped) targets := $(notdir $(vmlinuzobjs-y)) -- 2.7.4