lkml.org 
[lkml]   [2007]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.6.21.3] kbuild: fix build for cygwin
From: Tom Enderes <enderes@gmail.com>

The kernel build failed on cygwin hosts, because cygwin has slightly
different typedefs compared to linux:
scripts/mod/file2alias.c:518: error: dereferencing pointer to incomplete
type
Two files, scripts/mod/file2alias.c and scripts/mod/modpost.h, were
modified as follows:
Whever __CYGWIN__ is defined, __uint32 is defined as __uint32_t (instead
of uint_32_t) and the missing ElfxxSection definitions are added.
These changes have been tested both on cygwin 1.5.24, hostcc=gcc 3.4.4
and on FC5, hostcc=gcc 4.1.1-1. Any tests on cygwin, with and without
this change, were executed with the following set for make:
HOST_LOADLIBES="-lcurses -lintl".

Signed-off-by: Tom Enderes <enderes@gmail.com>


diff -Naur -r o21.1/scripts/mod/file2alias.c
2.6.21.1/scripts/mod/file2alias.c
--- o21.1/scripts/mod/file2alias.c 2007-04-27 14:49:26.000000000 -0700
+++ 2.6.21.1/scripts/mod/file2alias.c 2007-05-29 20:35:01.209115300
-0700
@@ -29,7 +29,11 @@

#include <ctype.h>

+#ifdef __CYGWIN__
+typedef __uint32_t __u32;
+#else
typedef uint32_t __u32;
+#endif
typedef uint16_t __u16;
typedef unsigned char __u8;

diff -Naur -r o21.1/scripts/mod/modpost.h 2.6.21.1/scripts/mod/modpost.h
--- o21.1/scripts/mod/modpost.h 2007-04-27 14:49:26.000000000 -0700
+++ 2.6.21.1/scripts/mod/modpost.h 2007-05-29 20:35:01.599732800
-0700
@@ -9,6 +9,11 @@
#include <unistd.h>
#include <elf.h>

+#ifdef __CYGWIN__
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+#endif
+
#include "elfconfig.h"

#if KERNEL_ELFCLASS == ELFCLASS32

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-06-08 20:33    [W:0.110 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site