uml: fix build with gcc 5
[openwrt/openwrt.git] / target / linux / uml / patches-4.1 / 001-um-Remove-copy-paste-code-from-init.h.patch
1 From: Richard Weinberger <richard@nod.at>
2 Date: Sun, 31 May 2015 22:15:58 +0200
3 Subject: [PATCH] um: Remove copy&paste code from init.h
4
5 As we got rid of the __KERNEL__ abuse, we can directly
6 include linux/compiler.h now.
7 This also allows gcc 5 to build UML.
8
9 Reported-by: Hans-Werner Hilse <hwhilse@gmail.com>
10 Signed-off-by: Richard Weinberger <richard@nod.at>
11 ---
12
13 --- a/arch/um/include/shared/init.h
14 +++ b/arch/um/include/shared/init.h
15 @@ -40,28 +40,8 @@
16 typedef int (*initcall_t)(void);
17 typedef void (*exitcall_t)(void);
18
19 -#ifndef __KERNEL__
20 -#ifndef __section
21 -# define __section(S) __attribute__ ((__section__(#S)))
22 -#endif
23 -
24 -#if __GNUC__ == 3
25 -
26 -#if __GNUC_MINOR__ >= 3
27 -# define __used __attribute__((__used__))
28 -#else
29 -# define __used __attribute__((__unused__))
30 -#endif
31 -
32 -#else
33 -#if __GNUC__ == 4
34 -# define __used __attribute__((__used__))
35 -#endif
36 -#endif
37 -
38 -#else
39 #include <linux/compiler.h>
40 -#endif
41 +
42 /* These are for everybody (although not all archs will actually
43 discard it in modules) */
44 #define __init __section(.init.text)