diff options
author | Zhenhua Luo <zhenhua.luo@nxp.com> | 2016-06-03 15:49:37 +0800 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2016-06-03 08:46:44 -0300 |
commit | bfacfa3525e18748c2d52f55933cf41debb20edc (patch) | |
tree | d62c237d93ba55436a95f338b3a125846924b39f /recipes-kernel | |
parent | a1ce123705d33e5deb5925399a0356a0598178a7 (diff) | |
download | meta-freescale-bfacfa3525e18748c2d52f55933cf41debb20edc.tar.gz |
linux-qoriq: fix build issue under gcc6
Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-kernel')
3 files changed, 182 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-qoriq/fix-the-compile-issue-under-gcc6.patch b/recipes-kernel/linux/linux-qoriq/fix-the-compile-issue-under-gcc6.patch new file mode 100644 index 00000000..910ef188 --- /dev/null +++ b/recipes-kernel/linux/linux-qoriq/fix-the-compile-issue-under-gcc6.patch | |||
@@ -0,0 +1,103 @@ | |||
1 | Fix the compile issue under gcc6 | ||
2 | |||
3 | Fix the following build error: | ||
4 | | .../include/linux/compiler-gcc.h:106:30: fatal error: linux/compiler-gcc6.h: No such file or directory | ||
5 | | #include gcc_header(__GNUC__) | ||
6 | |||
7 | Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com> | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | --- | ||
11 | arch/powerpc/kernel/Makefile | 2 -- | ||
12 | include/linux/compiler-gcc6.h | 66 +++++++++++++++++++++++++++++++++++++++++++ | ||
13 | 2 files changed, 66 insertions(+), 2 deletions(-) | ||
14 | create mode 100644 include/linux/compiler-gcc6.h | ||
15 | |||
16 | diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile | ||
17 | index c326675..45f0494 100644 | ||
18 | --- a/arch/powerpc/kernel/Makefile | ||
19 | +++ b/arch/powerpc/kernel/Makefile | ||
20 | @@ -4,8 +4,6 @@ | ||
21 | |||
22 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' | ||
23 | |||
24 | -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
25 | - | ||
26 | ifeq ($(CONFIG_PPC64),y) | ||
27 | CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) | ||
28 | endif | ||
29 | diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h | ||
30 | new file mode 100644 | ||
31 | index 0000000..cdd1cc2 | ||
32 | --- /dev/null | ||
33 | +++ b/include/linux/compiler-gcc6.h | ||
34 | @@ -0,0 +1,66 @@ | ||
35 | +#ifndef __LINUX_COMPILER_H | ||
36 | +#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead." | ||
37 | +#endif | ||
38 | + | ||
39 | +#define __used __attribute__((__used__)) | ||
40 | +#define __must_check __attribute__((warn_unused_result)) | ||
41 | +#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) | ||
42 | + | ||
43 | +/* Mark functions as cold. gcc will assume any path leading to a call | ||
44 | + to them will be unlikely. This means a lot of manual unlikely()s | ||
45 | + are unnecessary now for any paths leading to the usual suspects | ||
46 | + like BUG(), printk(), panic() etc. [but let's keep them for now for | ||
47 | + older compilers] | ||
48 | + | ||
49 | + Early snapshots of gcc 4.3 don't support this and we can't detect this | ||
50 | + in the preprocessor, but we can live with this because they're unreleased. | ||
51 | + Maketime probing would be overkill here. | ||
52 | + | ||
53 | + gcc also has a __attribute__((__hot__)) to move hot functions into | ||
54 | + a special section, but I don't see any sense in this right now in | ||
55 | + the kernel context */ | ||
56 | +#define __cold __attribute__((__cold__)) | ||
57 | + | ||
58 | +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||
59 | + | ||
60 | +#ifndef __CHECKER__ | ||
61 | +# define __compiletime_warning(message) __attribute__((warning(message))) | ||
62 | +# define __compiletime_error(message) __attribute__((error(message))) | ||
63 | +#endif /* __CHECKER__ */ | ||
64 | + | ||
65 | +/* | ||
66 | + * Mark a position in code as unreachable. This can be used to | ||
67 | + * suppress control flow warnings after asm blocks that transfer | ||
68 | + * control elsewhere. | ||
69 | + * | ||
70 | + * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
71 | + * this in the preprocessor, but we can live with this because they're | ||
72 | + * unreleased. Really, we need to have autoconf for the kernel. | ||
73 | + */ | ||
74 | +#define unreachable() __builtin_unreachable() | ||
75 | + | ||
76 | +/* Mark a function definition as prohibited from being cloned. */ | ||
77 | +#define __noclone __attribute__((__noclone__)) | ||
78 | + | ||
79 | +/* | ||
80 | + * Tell the optimizer that something else uses this function or variable. | ||
81 | + */ | ||
82 | +#define __visible __attribute__((externally_visible)) | ||
83 | + | ||
84 | +/* | ||
85 | + * GCC 'asm goto' miscompiles certain code sequences: | ||
86 | + * | ||
87 | + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||
88 | + * | ||
89 | + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||
90 | + * Fixed in GCC 4.8.2 and later versions. | ||
91 | + * | ||
92 | + * (asm goto is automatically volatile - the naming reflects this.) | ||
93 | + */ | ||
94 | +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) | ||
95 | + | ||
96 | +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | ||
97 | +#define __HAVE_BUILTIN_BSWAP32__ | ||
98 | +#define __HAVE_BUILTIN_BSWAP64__ | ||
99 | +#define __HAVE_BUILTIN_BSWAP16__ | ||
100 | +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | ||
101 | -- | ||
102 | 2.5.0 | ||
103 | |||
diff --git a/recipes-kernel/linux/linux-qoriq/module-remove-MODULE_GENERIC_TABLE.patch b/recipes-kernel/linux/linux-qoriq/module-remove-MODULE_GENERIC_TABLE.patch new file mode 100644 index 00000000..5a671559 --- /dev/null +++ b/recipes-kernel/linux/linux-qoriq/module-remove-MODULE_GENERIC_TABLE.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | module: remove MODULE_GENERIC_TABLE | ||
2 | |||
3 | MODULE_DEVICE_TABLE() calles MODULE_GENERIC_TABLE(); make it do the | ||
4 | work directly. This also removes a wart introduced in the last patch, | ||
5 | where the alias is defined to be an unknown struct type "struct | ||
6 | type##__##name##_device_id" instead of "struct type##_device_id" (it's | ||
7 | an extern so GCC doesn't care, but it's wrong). | ||
8 | |||
9 | The other user of MODULE_GENERIC_TABLE (ISAPNP_CARD_TABLE) is unused, | ||
10 | so delete it. | ||
11 | |||
12 | <Backport from cff26a51da5d206d3baf871e75778da44710219d> | ||
13 | |||
14 | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> | ||
15 | Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com> | ||
16 | |||
17 | Upstream-Status: Backport | ||
18 | --- | ||
19 | include/linux/isapnp.h | 4 ---- | ||
20 | include/linux/module.h | 19 ++++++++----------- | ||
21 | 2 files changed, 8 insertions(+), 15 deletions(-) | ||
22 | |||
23 | diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h | ||
24 | index e2d28b0..3c77bf9 100644 | ||
25 | --- a/include/linux/isapnp.h | ||
26 | +++ b/include/linux/isapnp.h | ||
27 | @@ -56,10 +56,6 @@ | ||
28 | #define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \ | ||
29 | { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) } | ||
30 | |||
31 | -/* export used IDs outside module */ | ||
32 | -#define ISAPNP_CARD_TABLE(name) \ | ||
33 | - MODULE_GENERIC_TABLE(isapnp_card, name) | ||
34 | - | ||
35 | struct isapnp_card_id { | ||
36 | unsigned long driver_data; /* data private to the driver */ | ||
37 | unsigned short card_vendor, card_device; | ||
38 | diff --git a/include/linux/module.h b/include/linux/module.h | ||
39 | index 54aef1b..a9f6812 100644 | ||
40 | --- a/include/linux/module.h | ||
41 | +++ b/include/linux/module.h | ||
42 | @@ -83,15 +83,6 @@ void sort_extable(struct exception_table_entry *start, | ||
43 | void sort_main_extable(void); | ||
44 | void trim_init_extable(struct module *m); | ||
45 | |||
46 | -#ifdef MODULE | ||
47 | -#define MODULE_GENERIC_TABLE(gtype,name) \ | ||
48 | -extern const struct gtype##_id __mod_##gtype##_table \ | ||
49 | - __attribute__ ((unused, alias(__stringify(name)))) | ||
50 | - | ||
51 | -#else /* !MODULE */ | ||
52 | -#define MODULE_GENERIC_TABLE(gtype,name) | ||
53 | -#endif | ||
54 | - | ||
55 | /* Generic info of form tag = "info" */ | ||
56 | #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) | ||
57 | |||
58 | @@ -142,8 +133,14 @@ extern const struct gtype##_id __mod_##gtype##_table \ | ||
59 | /* What your module does. */ | ||
60 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) | ||
61 | |||
62 | -#define MODULE_DEVICE_TABLE(type,name) \ | ||
63 | - MODULE_GENERIC_TABLE(type##__##name##_device, name) | ||
64 | +#ifdef MODULE | ||
65 | +/* Creates an alias so file2alias.c can find device table. */ | ||
66 | +#define MODULE_DEVICE_TABLE(type, name) \ | ||
67 | + extern const struct type##_device_id __mod_##type##__##name##_device_table \ | ||
68 | + __attribute__ ((unused, alias(__stringify(name)))) | ||
69 | +#else /* !MODULE */ | ||
70 | +#define MODULE_DEVICE_TABLE(type, name) | ||
71 | +#endif | ||
72 | |||
73 | /* Version of form [<epoch>:]<version>[-<extra-version>]. | ||
74 | Or for CVS/RCS ID version, everything but the number is stripped. | ||
75 | -- | ||
76 | 2.5.0 | ||
77 | |||
diff --git a/recipes-kernel/linux/linux-qoriq_3.12.bb b/recipes-kernel/linux/linux-qoriq_3.12.bb index 0e6b8ab7..37e088e7 100644 --- a/recipes-kernel/linux/linux-qoriq_3.12.bb +++ b/recipes-kernel/linux/linux-qoriq_3.12.bb | |||
@@ -7,6 +7,8 @@ SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;branch=sdk-v1.9.x \ | |||
7 | file://0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch \ | 7 | file://0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch \ |
8 | file://0003-use-static-inline-in-ARM-lifeboot.h.patch \ | 8 | file://0003-use-static-inline-in-ARM-lifeboot.h.patch \ |
9 | file://0001-powerpc-Align-TOC-to-256-bytes.patch \ | 9 | file://0001-powerpc-Align-TOC-to-256-bytes.patch \ |
10 | file://fix-the-compile-issue-under-gcc6.patch \ | ||
11 | file://module-remove-MODULE_GENERIC_TABLE.patch \ | ||
10 | " | 12 | " |
11 | 13 | ||
12 | SRCREV = "43cecda943a6c40a833b588801b0929e8bd48813" | 14 | SRCREV = "43cecda943a6c40a833b588801b0929e8bd48813" |