2015-07-07 07:41:15

by Pavel Fedin

[permalink] [raw]
Subject: [RESEND-2 PATCH trivial] Avoid conflict with host definitions when cross-compiling

Certain platforms (e. g. BSD-based ones) define some ELF constants according to host.
This patch fixes problems with cross-building Linux kernel on these platforms (e. g. building ARM
32-bit version on x86-64 host).

Signed-off-by: Pavel Fedin <[email protected]>
---
If you are not fond of mentioning Cygwin in the comment, feel free to change it to "BSD-based" or
whatever else you feel appropriate
---
scripts/mod/modpost.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 168b43d..9f51365 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -11,6 +11,12 @@

#include "elfconfig.h"

+/* Cygwin's elf.h defines these according to host's word size */
+#undef ELF_ST_BIND
+#undef ELF_ST_TYPE
+#undef ELF_R_SYM
+#undef ELF_R_TYPE
+
#if KERNEL_ELFCLASS == ELFCLASS32

#define Elf_Ehdr Elf32_Ehdr
--
1.9.5.msysgit.0