* Re: RE : Building kernel 2.6.21.3 for arm on cygwin [not found] ` <12D4B80525C5B744A216276E209921D9CE8016@MIAMI.xi-lite.lan> @ 2007-06-04 18:45 ` Tom 2007-06-07 20:47 ` Sam Ravnborg 0 siblings, 1 reply; 10+ messages in thread From: Tom @ 2007-06-04 18:45 UTC (permalink / raw) To: Sam Ravnborg; +Cc: linux-kernel, linux-arm-kernel Hi Sam enclosed is the 'k_smf.patch' which modifies three files to enable the kernel 2.6.21.3 to be built under cygwin: host: cygwin 1.5.24, hostcc= gcc 3.4.4 cross: arm-linux-uclibcgnueabi-gcc (GCC) 4.1.2 cmd: make ARCH=arm CROSS_COMPILE=arm-linux- \ HOST_LOADLIBES="-lcurses -lintl" at91rm9200dk_defconfig I verified that this does not break building on a linux-host on this config: host: FC5, gcc 4.1.1-1 cross: arm-none-linux-gnueabi-gcc 4.1.1 cmd: make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- Let me know if I can help any further. Tom k_smf.patch: ------------ 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 diff -Naur -r o21.1/scripts/mod/sumversion.c 2.6.21.1/scripts/mod/sumversion.c --- o21.1/scripts/mod/sumversion.c 2007-04-27 14:49:26.000000000 -0700 +++ 2.6.21.1/scripts/mod/sumversion.c 2007-05-29 20:35:01.677856300 -0700 @@ -7,6 +7,7 @@ #include <ctype.h> #include <errno.h> #include <string.h> +#include <limits.h> #include "modpost.h" /* linux host error (old gcc!): ---------------------------- CC mm/bootmem.o CC mm/filemap.o CC mm/mempool.o CC mm/oom_kill.o CC mm/fadvise.o CC mm/page_alloc.o mm/page_alloc.c:684: warning: `setup_nr_node_ids' defined but not used /tmp/ccj7iwRd.s: Assembler messages: /tmp/ccj7iwRd.s:3089: Error: .err encountered make[1]: *** [mm/page_alloc.o] Error 1 make: *** [mm] Error 2 arm-linux-gcc (GCC) 3.3.2 20030820 (prerelease) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RE : Building kernel 2.6.21.3 for arm on cygwin 2007-06-04 18:45 ` RE : Building kernel 2.6.21.3 for arm on cygwin Tom @ 2007-06-07 20:47 ` Sam Ravnborg 2007-06-08 15:57 ` Matthieu CASTET 2007-06-08 18:32 ` [PATCH 2.6.21.3] kbuild: fix build for cygwin Tom 0 siblings, 2 replies; 10+ messages in thread From: Sam Ravnborg @ 2007-06-07 20:47 UTC (permalink / raw) To: Tom; +Cc: linux-kernel, linux-arm-kernel On Mon, Jun 04, 2007 at 11:45:29AM -0700, Tom wrote: > Hi Sam > > > enclosed is the 'k_smf.patch' which modifies three files to enable the > kernel 2.6.21.3 to be built under cygwin: > host: cygwin 1.5.24, hostcc= gcc 3.4.4 > cross: arm-linux-uclibcgnueabi-gcc (GCC) 4.1.2 > cmd: make ARCH=arm CROSS_COMPILE=arm-linux- \ > HOST_LOADLIBES="-lcurses -lintl" at91rm9200dk_defconfig > > I verified that this does not break building on a linux-host on this config: > host: FC5, gcc 4.1.1-1 > cross: arm-none-linux-gnueabi-gcc 4.1.1 > cmd: make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- > > > Let me know if I can help any further. Hi Tom. Patch looks good. The last bit touching sumversion.c is not needed in latest kernel - we already include limits.h. I need you to sign off the patch as per instruction in Documentation/SubmittingPatch. Please do so and send me a new mail containing both changlog entry (the introduction part of your mail) and the patch itself. Sam ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RE : Building kernel 2.6.21.3 for arm on cygwin 2007-06-07 20:47 ` Sam Ravnborg @ 2007-06-08 15:57 ` Matthieu CASTET 2007-06-08 22:10 ` Sam Ravnborg 2007-06-08 18:32 ` [PATCH 2.6.21.3] kbuild: fix build for cygwin Tom 1 sibling, 1 reply; 10+ messages in thread From: Matthieu CASTET @ 2007-06-08 15:57 UTC (permalink / raw) To: Sam Ravnborg; +Cc: Tom, linux-kernel, linux-arm-kernel [-- Attachment #1: Type: text/plain, Size: 889 bytes --] Hi, Sam Ravnborg a écrit : > On Mon, Jun 04, 2007 at 11:45:29AM -0700, Tom wrote: >> Hi Sam >> >> >> enclosed is the 'k_smf.patch' which modifies three files to enable the >> kernel 2.6.21.3 to be built under cygwin: >> host: cygwin 1.5.24, hostcc= gcc 3.4.4 >> cross: arm-linux-uclibcgnueabi-gcc (GCC) 4.1.2 >> cmd: make ARCH=arm CROSS_COMPILE=arm-linux- \ >> HOST_LOADLIBES="-lcurses -lintl" at91rm9200dk_defconfig >> >> I verified that this does not break building on a linux-host on this config: >> host: FC5, gcc 4.1.1-1 >> cross: arm-none-linux-gnueabi-gcc 4.1.1 >> cmd: make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- >> >> >> Let me know if I can help any further. > Hi Tom. > > Patch looks good. The last bit touching sumversion.c is not > needed in latest kernel - we already include limits.h. > What about something like that for ncurses stuff ? Matthieu [-- Attachment #2: cygwin.patch --] [-- Type: text/x-patch, Size: 1260 bytes --] Index: scripts/kconfig/Makefile =================================================================== RCS file: /soft/cvs/Linux/kernel/linux/scripts/kconfig/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- scripts/kconfig/Makefile 5 Mar 2007 13:02:59 -0000 1.1.1.1 +++ scripts/kconfig/Makefile 6 Mar 2007 10:08:36 -0000 1.2 @@ -148,6 +148,13 @@ else echo no ; fi) ifeq ($(KBUILD_HAVE_NLS),no) HOSTCFLAGS += -DKBUILD_NO_NLS +else +HOST_OS := $(shell uname -o) +ifeq ($(HOST_OS),Cygwin) +HOSTLOADLIBES_conf = -lintl +endif + + endif # generated files seem to need this to find local include files Index: scripts/kconfig/lxdialog/check-lxdialog.sh =================================================================== RCS file: /soft/cvs/Linux/kernel/linux/scripts/kconfig/lxdialog/check-lxdialog.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- scripts/kconfig/lxdialog/check-lxdialog.sh 5 Mar 2007 13:02:59 -0000 1.1.1.1 +++ scripts/kconfig/lxdialog/check-lxdialog.sh 6 Mar 2007 10:08:36 -0000 1.2 @@ -19,6 +19,11 @@ echo '-lcurses' exit fi + $cc -print-file-name=libncurses.a | grep -q / + if [ $? -eq 0 ]; then + echo '-lintl -lncurses' + exit + fi exit 1 } ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RE : Building kernel 2.6.21.3 for arm on cygwin 2007-06-08 15:57 ` Matthieu CASTET @ 2007-06-08 22:10 ` Sam Ravnborg 2007-06-09 7:51 ` Jan Engelhardt 2007-06-11 7:25 ` Matthieu CASTET 0 siblings, 2 replies; 10+ messages in thread From: Sam Ravnborg @ 2007-06-08 22:10 UTC (permalink / raw) To: Matthieu CASTET; +Cc: Tom, linux-kernel, linux-arm-kernel Hi Matthieu. Can you please try to tell what your patch actually does. As for the part added in the MAkefile you pass -lintl for Cygwin - but I fail to see _why_ -lintl is needed. The patch to check-lxdialog.sh is outdated. Could I ask you to redo it againt latest version and again explains the _why_ part. The how part is obvious from the diff... Do not get me worg. I would love to have Cygwin supported but I want it in the cleanest possible way. Sam ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RE : Building kernel 2.6.21.3 for arm on cygwin 2007-06-08 22:10 ` Sam Ravnborg @ 2007-06-09 7:51 ` Jan Engelhardt 2007-06-11 7:25 ` Matthieu CASTET 1 sibling, 0 replies; 10+ messages in thread From: Jan Engelhardt @ 2007-06-09 7:51 UTC (permalink / raw) To: Sam Ravnborg; +Cc: Matthieu CASTET, Tom, linux-kernel, linux-arm-kernel On Jun 9 2007 00:10, Sam Ravnborg wrote: >Hi Matthieu. > >Can you please try to tell what your patch actually does. > >As for the part added in the MAkefile you pass -lintl for Cygwin - >but I fail to see _why_ -lintl is needed. It is because I think .DLLs do not have something like ELF's DT_NEEDED, hence needing to specify all libs you ever need explicitly. Quite ugly. Jan -- ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RE : Building kernel 2.6.21.3 for arm on cygwin 2007-06-08 22:10 ` Sam Ravnborg 2007-06-09 7:51 ` Jan Engelhardt @ 2007-06-11 7:25 ` Matthieu CASTET 1 sibling, 0 replies; 10+ messages in thread From: Matthieu CASTET @ 2007-06-11 7:25 UTC (permalink / raw) To: Sam Ravnborg; +Cc: Tom, linux-kernel, linux-arm-kernel Hi Sam, Sam Ravnborg wrote: > Hi Matthieu. > > Can you please try to tell what your patch actually does. > > As for the part added in the MAkefile you pass -lintl for Cygwin - > but I fail to see _why_ -lintl is needed. If I don't do it, I got [1] or [2]. Matthieu [1] scripts/kconfig/conf.o:conf.c:(.text+0x91): undefined reference to `_libintl_gettext' scripts/kconfig/conf.o:conf.c:(.text+0xa5): undefined reference to `_libintl_gettext' scripts/kconfig/conf.o:conf.c:(.text+0xb9): undefined reference to `_libintl_gettext' scripts/kconfig/conf.o:conf.c:(.text+0x7b8): undefined reference to `_libintl_gettext' scripts/kconfig/conf.o:conf.c:(.text+0xf19): undefined reference to `_libintl_gettext' scripts/kconfig/conf.o:conf.c:(.text+0x1026): more undefined references to `_libintl_gettext' follow collect2: ld returned 1 exit status [2] scripts/kconfig/mconf.o:mconf.c:(.text+0x923): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x9c9): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0xa66): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0xa91): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0xab1): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0xadd): more undefined references to `_libintl_gettext' follow scripts/kconfig/mconf.o:mconf.c:(.text+0x11af): undefined reference to `_libintl_bindtextdomain' scripts/kconfig/mconf.o:mconf.c:(.text+0x11bb): undefined reference to `_libintl_textdomain' scripts/kconfig/mconf.o:mconf.c:(.text+0x1207): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1414): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1467): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1482): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x14af): undefined reference to `_libintl_gettext' scripts/kconfig/zconf.tab.o:zconf.tab.c:(.text+0x54e6): more undefined references to `_libintl_gettext' follow Info: resolving _stdscr by linking to __imp__stdscr (auto-import) Info: resolving _COLS by linking to __imp__COLS (auto-import) Info: resolving _LINES by linking to __imp__LINES (auto-import) collect2: ld returned 1 exit status ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2.6.21.3] kbuild: fix build for cygwin 2007-06-07 20:47 ` Sam Ravnborg 2007-06-08 15:57 ` Matthieu CASTET @ 2007-06-08 18:32 ` Tom 2007-06-08 20:15 ` Sam Ravnborg 2007-08-28 19:34 ` Sam Ravnborg 1 sibling, 2 replies; 10+ messages in thread From: Tom @ 2007-06-08 18:32 UTC (permalink / raw) To: Sam Ravnborg; +Cc: linux-kernel, linux-arm-kernel 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2.6.21.3] kbuild: fix build for cygwin 2007-06-08 18:32 ` [PATCH 2.6.21.3] kbuild: fix build for cygwin Tom @ 2007-06-08 20:15 ` Sam Ravnborg 2007-06-09 1:47 ` Tom 2007-08-28 19:34 ` Sam Ravnborg 1 sibling, 1 reply; 10+ messages in thread From: Sam Ravnborg @ 2007-06-08 20:15 UTC (permalink / raw) To: Tom; +Cc: linux-kernel, linux-arm-kernel On Fri, Jun 08, 2007 at 11:32:29AM -0700, Tom wrote: > 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; This change is wrong. Somehow __uint32_t_defined gets defined and cygwin fails to define uint32_t. So we have hit a bug in cygwin here. Browsing the code I think that including inttypes.h much sooner will fix it. In file2alias.c I moved include of inttypes.h up. > 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 I did this in an alternative way. Replacing use of Elf32_section with Elf32_Half did the trick. Same for the 64 bit type. Let me know if this works on Cygwin. I have tested with a few architectures on Linux with success. (Needs to look into the lib part next). Thanks for keeping attention on this. Sam diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index f646381..5e017a9 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -10,6 +10,14 @@ * of the GNU General Public License, incorporated herein by reference. */ +#ifdef __sun__ +#include <inttypes.h> +#else +#include <stdint.h> +#endif + +#include <ctype.h> + #include "modpost.h" /* We use the ELF typedefs for kernel_ulong_t but bite the bullet and @@ -21,13 +29,6 @@ typedef Elf32_Addr kernel_ulong_t; typedef Elf64_Addr kernel_ulong_t; #define BITS_PER_LONG 64 #endif -#ifdef __sun__ -#include <inttypes.h> -#else -#include <stdint.h> -#endif - -#include <ctype.h> typedef uint32_t __u32; typedef uint16_t __u16; diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 4156dd3..0ffed17 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -17,7 +17,7 @@ #define Elf_Shdr Elf32_Shdr #define Elf_Sym Elf32_Sym #define Elf_Addr Elf32_Addr -#define Elf_Section Elf32_Section +#define Elf_Section Elf32_Half #define ELF_ST_BIND ELF32_ST_BIND #define ELF_ST_TYPE ELF32_ST_TYPE @@ -31,7 +31,7 @@ #define Elf_Shdr Elf64_Shdr #define Elf_Sym Elf64_Sym #define Elf_Addr Elf64_Addr -#define Elf_Section Elf64_Section +#define Elf_Section Elf64_Half #define ELF_ST_BIND ELF64_ST_BIND #define ELF_ST_TYPE ELF64_ST_TYPE ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2.6.21.3] kbuild: fix build for cygwin 2007-06-08 20:15 ` Sam Ravnborg @ 2007-06-09 1:47 ` Tom 0 siblings, 0 replies; 10+ messages in thread From: Tom @ 2007-06-09 1:47 UTC (permalink / raw) To: Sam Ravnborg; +Cc: linux-kernel, linux-arm-kernel Sam Ravnborg wrote: > On Fri, Jun 08, 2007 at 11:32:29AM -0700, Tom wrote: >> 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; > This change is wrong. > Somehow __uint32_t_defined gets defined and cygwin fails to define > uint32_t. > > So we have hit a bug in cygwin here. > > Browsing the code I think that including inttypes.h much sooner will fix it. > In file2alias.c I moved include of inttypes.h up. > > >> 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 > > I did this in an alternative way. > Replacing use of Elf32_section with Elf32_Half did the trick. > Same for the 64 bit type. > > > Let me know if this works on Cygwin. This is what I got on cygwin: In file included from scripts/mod/../../include/linux/input.h:19, from scripts/mod/file2alias.c:41: /usr/include/asm/types.h:21: error: conflicting types for '__u32' scripts/mod/file2alias.c:33: error: previous declaration of '__u32' was here scripts/mod/file2alias.c: In function `do_ieee1394_entry': scripts/mod/file2alias.c:193: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c:195: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c:197: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c:199: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c: In function `do_pci_entry': scripts/mod/file2alias.c:221: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c:222: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c:223: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c:224: warning: unsigned int format, __u32 arg (arg 3) scripts/mod/file2alias.c: In function `do_pcmcia_entry': scripts/mod/file2alias.c:346: warning: unsigned int format, long unsigned int ar g (arg 3) scripts/mod/file2alias.c:347: warning: unsigned int format, long unsigned int ar g (arg 3) scripts/mod/file2alias.c:348: warning: unsigned int format, long unsigned int ar g (arg 3) scripts/mod/file2alias.c:349: warning: unsigned int format, long unsigned int ar g (arg 3) scripts/mod/file2alias.c: In function `do_parisc_entry': scripts/mod/file2alias.c:469: warning: unsigned int format, __u32 arg (arg 3) make[2]: *** [scripts/mod/file2alias.o] Error 1 make[1]: *** [scripts/mod] Error 2 make: *** [scripts] Error 2 > I have tested with a few architectures on Linux with success. > > (Needs to look into the lib part next). > > Thanks for keeping attention on this. > > Sam > > diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c > index f646381..5e017a9 100644 > --- a/scripts/mod/file2alias.c > +++ b/scripts/mod/file2alias.c > @@ -10,6 +10,14 @@ > * of the GNU General Public License, incorporated herein by reference. > */ > > +#ifdef __sun__ > +#include <inttypes.h> > +#else > +#include <stdint.h> > +#endif > + > +#include <ctype.h> > + > #include "modpost.h" > > /* We use the ELF typedefs for kernel_ulong_t but bite the bullet and > @@ -21,13 +29,6 @@ typedef Elf32_Addr kernel_ulong_t; > typedef Elf64_Addr kernel_ulong_t; > #define BITS_PER_LONG 64 > #endif > -#ifdef __sun__ > -#include <inttypes.h> > -#else > -#include <stdint.h> > -#endif > - > -#include <ctype.h> > > typedef uint32_t __u32; > typedef uint16_t __u16; > diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h > index 4156dd3..0ffed17 100644 > --- a/scripts/mod/modpost.h > +++ b/scripts/mod/modpost.h > @@ -17,7 +17,7 @@ > #define Elf_Shdr Elf32_Shdr > #define Elf_Sym Elf32_Sym > #define Elf_Addr Elf32_Addr > -#define Elf_Section Elf32_Section > +#define Elf_Section Elf32_Half > #define ELF_ST_BIND ELF32_ST_BIND > #define ELF_ST_TYPE ELF32_ST_TYPE > > @@ -31,7 +31,7 @@ > #define Elf_Shdr Elf64_Shdr > #define Elf_Sym Elf64_Sym > #define Elf_Addr Elf64_Addr > -#define Elf_Section Elf64_Section > +#define Elf_Section Elf64_Half > #define ELF_ST_BIND ELF64_ST_BIND > #define ELF_ST_TYPE ELF64_ST_TYPE > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2.6.21.3] kbuild: fix build for cygwin 2007-06-08 18:32 ` [PATCH 2.6.21.3] kbuild: fix build for cygwin Tom 2007-06-08 20:15 ` Sam Ravnborg @ 2007-08-28 19:34 ` Sam Ravnborg 1 sibling, 0 replies; 10+ messages in thread From: Sam Ravnborg @ 2007-08-28 19:34 UTC (permalink / raw) To: Tom; +Cc: linux-kernel, linux-arm-kernel On Fri, Jun 08, 2007 at 11:32:29AM -0700, Tom wrote: > 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". Hi Tom. I have revisited this and have made a successfull kernel build on a windows/cygwin box now. I had to change two things only: 1) The -lintl workaround was fixed by introducing a little script. If gcc cannot link a program that sues gettext then NLS is disabled. 2) Elf32_Section and Elf64_Section was replaced by Elfnn_Half The build succeeds with a number of warnings that I just ignored. fixdep and friends always get rebuild because kbuild does not know about the .exe suffix so it does not see that the binaries exists. This is annoying and I hope to fix it before the merge. These change will hit mainline during next merge window so it will take a while before you can benefit. For now they are in the kbuild.git tree at git.kernel.org and will soon be part of -mm. Sam ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-08-28 19:35 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <46608757.4020503@gmail.com>
[not found] ` <20070601212208.GA4559@uranus.ravnborg.org>
[not found] ` <4660971E.5020609@gmail.com>
[not found] ` <12D4B80525C5B744A216276E209921D9CE8016@MIAMI.xi-lite.lan>
2007-06-04 18:45 ` RE : Building kernel 2.6.21.3 for arm on cygwin Tom
2007-06-07 20:47 ` Sam Ravnborg
2007-06-08 15:57 ` Matthieu CASTET
2007-06-08 22:10 ` Sam Ravnborg
2007-06-09 7:51 ` Jan Engelhardt
2007-06-11 7:25 ` Matthieu CASTET
2007-06-08 18:32 ` [PATCH 2.6.21.3] kbuild: fix build for cygwin Tom
2007-06-08 20:15 ` Sam Ravnborg
2007-06-09 1:47 ` Tom
2007-08-28 19:34 ` Sam Ravnborg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox