use alternate download url
[buildroot.git] / linux-2.6.27.5-powerpc-crtsavres_for_modules.patch
blobb7c382d37f61cab2e777cb6b3cf16a51d290a903
1 Fix linking modules against crtsavres.o
3 Previously we got
4 CC drivers/char/hw_random/rng-core.mod.o
5 LD [M] drivers/char/hw_random/rng-core.ko
6 /there/src/buildroot.git.ppc/build_powerpc_nofpu/staging_dir/usr/bin/powerpc-linux-uclibc-ld: arch/powerpc/lib/crtsavres.o: No such file: No such file or directory
8 * Makefile (LDFLAGS_MODULE_PREREQ): New variable to hold prerequisite
9 files for modules.
10 * arch/powerpc/Makefile: add crtsavres.o to LDFLAGS_MODULE_PREREQ.
11 * scripts/Makefile.modpost (cmd_as_o_S): Copy from Makefile.build.
12 (cmd_ld_ko_o): Also link LDFLAGS_MODULE_PREREQ.
13 Provide rule to build objects from assembler.
15 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
17 diff -rup ../../x/linux-2.6.26.5.old/arch/powerpc/Makefile linux-2.6.26.5/arch/powerpc/Makefile
18 --- ../../x/linux-2.6.26.5.old/arch/powerpc/Makefile 2008-09-08 19:40:20.000000000 +0200
19 +++ linux-2.6.26.5/arch/powerpc/Makefile 2008-10-07 14:28:08.000000000 +0200
20 @@ -97,7 +97,7 @@ else
21 KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
22 endif
23 else
24 -LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
25 +LDFLAGS_MODULE_PREREQ += arch/powerpc/lib/crtsavres.o
26 endif
28 ifeq ($(CONFIG_TUNE_CELL),y)
29 diff -rup ../../x/linux-2.6.26.5.old/Makefile linux-2.6.26.5/Makefile
30 --- ../../x/linux-2.6.26.5.old/Makefile 2008-09-08 19:40:20.000000000 +0200
31 +++ linux-2.6.26.5/Makefile 2008-10-07 14:15:59.000000000 +0200
32 @@ -318,6 +318,7 @@ MODFLAGS = -DMODULE
33 CFLAGS_MODULE = $(MODFLAGS)
34 AFLAGS_MODULE = $(MODFLAGS)
35 LDFLAGS_MODULE =
36 +LDFLAGS_MODULE_PREREQ =
37 CFLAGS_KERNEL =
38 AFLAGS_KERNEL =
40 @@ -342,7 +343,7 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL)
41 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
42 export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
43 export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
44 -export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
45 +export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE LDFLAGS_MODULE_PREREQ CHECK CHECKFLAGS
47 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
48 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
49 diff -rup ../../x/linux-2.6.26.5.old/scripts/Makefile.modpost linux-2.6.26.5/scripts/Makefile.modpost
50 --- ../../x/linux-2.6.26.5.old/scripts/Makefile.modpost 2008-09-08 19:40:20.000000000 +0200
51 +++ linux-2.6.26.5/scripts/Makefile.modpost 2008-10-07 14:24:34.000000000 +0200
52 @@ -122,14 +122,21 @@ quiet_cmd_cc_o_c = CC $@
53 cmd_cc_o_c = $(CC) $(c_flags) $(CFLAGS_MODULE) \
54 -c -o $@ $<
56 -$(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
57 +quiet_cmd_as_o_S = AS $(quiet_modtag) $@
58 +cmd_as_o_S = $(CC) $(a_flags) $(AFLAGS_MODULE) -c -o $@ $<
60 +$(LDFLAGS_MODULE_PREREQ): %.o: %.S FORCE
61 + $(call if_changed_dep,as_o_S)
63 +$(modules:.ko=.mod.o): %.mod.o: %.mod.c $(LDFLAGS_MODULE_PREREQ) FORCE
64 $(call if_changed_dep,cc_o_c)
66 targets += $(modules:.ko=.mod.o)
68 # Step 6), final link of the modules
69 quiet_cmd_ld_ko_o = LD [M] $@
70 - cmd_ld_ko_o = $(LD) -r $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
71 + cmd_ld_ko_o = $(LD) -r $(LDFLAGS) $(LDFLAGS_MODULE_PREREQ) \
72 + $(LDFLAGS_MODULE) -o $@ \
73 $(filter-out FORCE,$^)
75 $(modules): %.ko :%.o %.mod.o FORCE