]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Jeff Mahoney <jeffm@suse.com> |
2 | Subject: [PATCH] kbuild: Properly handle arch/$arch/include/asm | |
3 | References: bnc#427473 | |
4 | ||
5 | Some architectures have moved include/asm-$arch to arch/$arch/include/asm, | |
6 | but were still placing new files in include/asm-$arch. This causes build | |
7 | problems with out-of-tree modules. | |
8 | ||
9 | This patch properly handles the new locations. | |
10 | ||
11 | Signed-off-by: Jeff Mahoney <jeffm@suse.com> | |
12 | --- | |
13 | Makefile | 24 ++++++++++++++++-------- | |
14 | arch/ia64/Makefile | 2 +- | |
15 | arch/ia64/include/asm/irq.h | 2 +- | |
16 | arch/ia64/kernel/Makefile | 6 +++--- | |
17 | 4 files changed, 21 insertions(+), 13 deletions(-) | |
18 | ||
19 | --- a/Makefile | |
20 | +++ b/Makefile | |
21 | @@ -969,8 +969,10 @@ define check-symlink | |
22 | set -e; \ | |
23 | if [ -L include/asm ]; then \ | |
24 | asmlink=`readlink include/asm | cut -d '-' -f 2`; \ | |
25 | - if [ "$$asmlink" != "$(SRCARCH)" ]; then \ | |
26 | - echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ | |
27 | + archlink=`readlink include/asm | cut -d '/' -f 3`; \ | |
28 | + if [ "$$asmlink" != "$(SRCARCH)" -a \ | |
29 | + "$$archlink" != "$(SRCARCH)" ]; then \ | |
30 | + echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) or ../arch/$(SRCARCH)/include/asm was expected"; \ | |
31 | echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ | |
32 | exit 1; \ | |
33 | fi; \ | |
34 | @@ -981,12 +983,18 @@ endef | |
35 | # not exist so the test in chack-symlink works and we have a | |
36 | # directory for generated filesas used by some architectures. | |
37 | define create-symlink | |
38 | - if [ ! -L include/asm ]; then \ | |
39 | - echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ | |
40 | - if [ ! -d include/asm-$(SRCARCH) ]; then \ | |
41 | - mkdir -p include/asm-$(SRCARCH); \ | |
42 | - fi; \ | |
43 | - ln -fsn asm-$(SRCARCH) $@; \ | |
44 | + if [ ! -L include/asm ]; then \ | |
45 | + if [ -d $(srctree)/arch/$(SRCARCH)/include/asm ]; then \ | |
46 | + echo ' SYMLINK $@ -> arch/$(SRCARCH)/include/asm'; \ | |
47 | + mkdir -p arch/$(SRCARCH)/include/asm; \ | |
48 | + ln -fsn ../arch/$(SRCARCH)/include/asm $@; \ | |
49 | + else \ | |
50 | + echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ | |
51 | + if [ ! -d include/asm-$(SRCARCH) ]; then \ | |
52 | + mkdir -p include/asm-$(SRCARCH); \ | |
53 | + fi; \ | |
54 | + ln -fsn asm-$(SRCARCH) $@; \ | |
55 | + fi; \ | |
56 | fi | |
57 | endef | |
58 | ||
59 | --- a/arch/ia64/Makefile | |
60 | +++ b/arch/ia64/Makefile | |
61 | @@ -105,4 +105,4 @@ archprepare: make_nr_irqs_h FORCE | |
62 | PHONY += make_nr_irqs_h FORCE | |
63 | ||
64 | make_nr_irqs_h: FORCE | |
65 | - $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h | |
66 | + $(Q)$(MAKE) $(build)=arch/ia64/kernel arch/ia64/include/asm/nr-irqs.h | |
67 | --- a/arch/ia64/include/asm/irq.h | |
68 | +++ b/arch/ia64/include/asm/irq.h | |
69 | @@ -13,7 +13,7 @@ | |
70 | ||
71 | #include <linux/types.h> | |
72 | #include <linux/cpumask.h> | |
73 | -#include <asm-ia64/nr-irqs.h> | |
74 | +#include <asm/nr-irqs.h> | |
75 | ||
76 | static __inline__ int | |
77 | irq_canonicalize (int irq) | |
78 | --- a/arch/ia64/kernel/Makefile | |
79 | +++ b/arch/ia64/kernel/Makefile | |
80 | @@ -96,15 +96,15 @@ endef | |
81 | ||
82 | # We use internal kbuild rules to avoid the "is up to date" message from make | |
83 | arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr-irqs.c \ | |
84 | - $(wildcard $(srctree)/include/asm-ia64/*/irq.h) | |
85 | + $(wildcard $(srctree)/arch/ia64/include/asm/*/irq.h) | |
86 | $(Q)mkdir -p $(dir $@) | |
87 | $(call if_changed_dep,cc_s_c) | |
88 | ||
89 | -include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s | |
90 | +arch/ia64/include/asm/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s | |
91 | $(Q)mkdir -p $(dir $@) | |
92 | $(call cmd,nr_irqs) | |
93 | ||
94 | -clean-files += $(objtree)/include/asm-ia64/nr-irqs.h | |
95 | +clean-files += $(objtree)/arch/ia64/include/asm/nr-irqs.h | |
96 | ||
97 | # | |
98 | # native ivt.S and entry.S |