diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-09-28 12:22:35 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-09-28 12:22:35 +0000 |
commit | 2675ade97a115d3ba1e75fb1193365cd87310fcf (patch) | |
tree | 6bbf7d84655ca679743a227a1ad6e08124d59b12 | |
parent | 5da85f7a01b82d30979afa20ce2ce30f87b338ed (diff) | |
download | mtk-20170518-2675ade97a115d3ba1e75fb1193365cd87310fcf.zip mtk-20170518-2675ade97a115d3ba1e75fb1193365cd87310fcf.tar.gz mtk-20170518-2675ade97a115d3ba1e75fb1193365cd87310fcf.tar.bz2 |
uml: backport another upstream patch to fix compile errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 47067
-rw-r--r-- | target/linux/uml/patches-4.1/001-um-Stop-abusing-__KERNEL__.patch | 94 | ||||
-rw-r--r-- | target/linux/uml/patches-4.1/002-um-Remove-copy-paste-code-from-init.h.patch (renamed from target/linux/uml/patches-4.1/001-um-Remove-copy-paste-code-from-init.h.patch) | 2 |
2 files changed, 95 insertions, 1 deletions
diff --git a/target/linux/uml/patches-4.1/001-um-Stop-abusing-__KERNEL__.patch b/target/linux/uml/patches-4.1/001-um-Stop-abusing-__KERNEL__.patch new file mode 100644 index 0000000..a46a5be --- /dev/null +++ b/target/linux/uml/patches-4.1/001-um-Stop-abusing-__KERNEL__.patch @@ -0,0 +1,94 @@ +From: Richard Weinberger <richard@nod.at> +Date: Sun, 31 May 2015 19:50:57 +0200 +Subject: [PATCH] um: Stop abusing __KERNEL__ + +Currently UML is abusing __KERNEL__ to distinguish between +kernel and host code (os-Linux). It is better to use a custom +define such that existing users of __KERNEL__ don't get confused. + +Signed-off-by: Richard Weinberger <richard@nod.at> +--- + +--- a/arch/um/drivers/mconsole.h ++++ b/arch/um/drivers/mconsole.h +@@ -7,7 +7,7 @@ + #ifndef __MCONSOLE_H__ + #define __MCONSOLE_H__ + +-#ifndef __KERNEL__ ++#ifdef __UM_HOST__ + #include <stdint.h> + #define u32 uint32_t + #endif +--- a/arch/um/include/shared/init.h ++++ b/arch/um/include/shared/init.h +@@ -40,7 +40,7 @@ + typedef int (*initcall_t)(void); + typedef void (*exitcall_t)(void); + +-#ifndef __KERNEL__ ++#ifdef __UM_HOST__ + #ifndef __section + # define __section(S) __attribute__ ((__section__(#S))) + #endif +@@ -131,7 +131,7 @@ extern struct uml_param __uml_setup_star + #define __uml_postsetup_call __used __section(.uml.postsetup.init) + #define __uml_exit_call __used __section(.uml.exitcall.exit) + +-#ifndef __KERNEL__ ++#ifdef __UM_HOST__ + + #define __define_initcall(level,fn) \ + static initcall_t __initcall_##fn __used \ +--- a/arch/um/include/shared/user.h ++++ b/arch/um/include/shared/user.h +@@ -17,7 +17,7 @@ + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + /* This is to get size_t */ +-#ifdef __KERNEL__ ++#ifndef __UM_HOST__ + #include <linux/types.h> + #else + #include <stddef.h> +--- a/arch/um/Makefile ++++ b/arch/um/Makefile +@@ -68,9 +68,10 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) - + + KBUILD_AFLAGS += $(ARCH_INCLUDE) + +-USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ +- $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ +- $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include ++USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \ ++ $(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \ ++ -D_FILE_OFFSET_BITS=64 -idirafter include \ ++ -D__KERNEL__ -D__UM_HOST__ + + #This will adjust *FLAGS accordingly to the platform. + include $(ARCH_DIR)/Makefile-os-$(OS) +--- a/arch/x86/um/shared/sysdep/tls.h ++++ b/arch/x86/um/shared/sysdep/tls.h +@@ -1,7 +1,7 @@ + #ifndef _SYSDEP_TLS_H + #define _SYSDEP_TLS_H + +-# ifndef __KERNEL__ ++#ifdef __UM_HOST__ + + /* Change name to avoid conflicts with the original one from <asm/ldt.h>, which + * may be named user_desc (but in 2.4 and in header matching its API was named +@@ -22,11 +22,11 @@ typedef struct um_dup_user_desc { + #endif + } user_desc_t; + +-# else /* __KERNEL__ */ ++#else /* __UM_HOST__ */ + + typedef struct user_desc user_desc_t; + +-# endif /* __KERNEL__ */ ++#endif /* __UM_HOST__ */ + + extern int os_set_thread_area(user_desc_t *info, int pid); + extern int os_get_thread_area(user_desc_t *info, int pid); diff --git a/target/linux/uml/patches-4.1/001-um-Remove-copy-paste-code-from-init.h.patch b/target/linux/uml/patches-4.1/002-um-Remove-copy-paste-code-from-init.h.patch index a68c4b6..6733384 100644 --- a/target/linux/uml/patches-4.1/001-um-Remove-copy-paste-code-from-init.h.patch +++ b/target/linux/uml/patches-4.1/002-um-Remove-copy-paste-code-from-init.h.patch @@ -16,7 +16,7 @@ Signed-off-by: Richard Weinberger <richard@nod.at> typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); --#ifndef __KERNEL__ +-#ifdef __UM_HOST__ -#ifndef __section -# define __section(S) __attribute__ ((__section__(#S))) -#endif |