From: Tom Rini <trini@kernel.crashing.org>
To: "Robert P. J. Day" <rpjday@mindspring.com>
Cc: Embedded PPC Linux list <linuxppc-embedded@ozlabs.org>
Subject: Re: cross-compiling under cygwin?
Date: Fri, 8 Apr 2005 07:46:00 -0700 [thread overview]
Message-ID: <20050408144600.GX3396@smtp.west.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0504081010330.14089@localhost.localdomain>
On Fri, Apr 08, 2005 at 10:13:09AM -0400, Robert P. J. Day wrote:
> i've just had a request from a colleague who wants to do all the
> cross-compilation for our 8xx board on a windows box, rather than
> linux.
>
> there was talk of cygwin, and kdevelop as well. i'm still parsing
> the rest of the email but is there a canonical URL that discusses
> working in the windows environment?
>
> i'm just about to head over to denx.de to see what i can find.
> thanks for any pointers.
The cross-tool list has had some of this. As of 2.6.10 at least, the
following was still needed, and too ugly and/or cygwin version specific
to be submitted to the kernel proper (still applies cleanly to
2.6.12-rc2, but untested in Cygwin env):
Source: MontaVista Software, Inc.
MR: 8836
Type: Defect Fix
Disposition: local
Signed-off-by: Tom Rini <trini@mvista.com>
Description:
A collection of unmergeable Cygwin fixes:
- Cygwin doesn't have <inttypes.h> nor <stdint.h>, but doesn't
need them for certain values anyhow.
- For certain ELF things, we rely on libelf being provided by
the MVL environment.
- /usr/include/asm/byteorder.h provided ntohl/htonl.
- <limits.h> defines PATH_MAX as an expression, which means
it cannot be used in some places.
Index: linux-2.6.11.2/arch/ppc/boot/utils/mktree.c
===================================================================
--- linux-2.6.11.2.orig/arch/ppc/boot/utils/mktree.c
+++ linux-2.6.11.2/arch/ppc/boot/utils/mktree.c
@@ -15,9 +15,9 @@
#include <sys/stat.h>
#include <unistd.h>
#include <netinet/in.h>
-#ifdef __sun__
+#if defined(__sun__)
#include <inttypes.h>
-#else
+#elif !defined(__CYGWIN__)
#include <stdint.h>
#endif
Index: linux-2.6.11.2/scripts/mod/modpost.h
===================================================================
--- linux-2.6.11.2.orig/scripts/mod/modpost.h
+++ linux-2.6.11.2/scripts/mod/modpost.h
@@ -7,7 +7,11 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
+#ifdef __CYGWIN__
+#include <libelf/libelf.h>
+#else
#include <elf.h>
+#endif
#include "elfconfig.h"
Index: linux-2.6.11.2/scripts/mod/mk_elfconfig.c
===================================================================
--- linux-2.6.11.2.orig/scripts/mod/mk_elfconfig.c
+++ linux-2.6.11.2/scripts/mod/mk_elfconfig.c
@@ -1,7 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef __CYGWIN__
+#include <libelf/libelf.h>
+#else
#include <elf.h>
+#endif
int
main(int argc, char **argv)
Index: linux-2.6.11.2/scripts/mod/sumversion.c
===================================================================
--- linux-2.6.11.2.orig/scripts/mod/sumversion.c
+++ linux-2.6.11.2/scripts/mod/sumversion.c
@@ -1,7 +1,10 @@
+#if defined(__sun__)
#include <netinet/in.h>
-#ifdef __sun__
#include <inttypes.h>
+#elif defined(__CYGWIN__)
+#include <asm/byteorder.h> /* For ntohl/htonl */
#else
+#include <netinet/in.h>
#include <stdint.h>
#endif
#include <ctype.h>
Index: linux-2.6.11.2/scripts/mod/file2alias.c
===================================================================
--- linux-2.6.11.2.orig/scripts/mod/file2alias.c
+++ linux-2.6.11.2/scripts/mod/file2alias.c
@@ -19,9 +19,9 @@ typedef Elf32_Addr kernel_ulong_t;
#else
typedef Elf64_Addr kernel_ulong_t;
#endif
-#ifdef __sun__
+#if defined(__sun__)
#include <inttypes.h>
-#else
+#elif !defined(__CYGWIN__)
#include <stdint.h>
#endif
Index: linux-2.6.11.2/arch/ppc/boot/utils/mkbugboot.c
===================================================================
--- linux-2.6.11.2.orig/arch/ppc/boot/utils/mkbugboot.c
+++ linux-2.6.11.2/arch/ppc/boot/utils/mkbugboot.c
@@ -21,9 +21,9 @@
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
-#ifdef __sun__
+#if defined(__sun__)
#include <inttypes.h>
-#else
+#elif !defined(__CYGWIN__)
#include <stdint.h>
#endif
Index: linux-2.6.11.2/lib/gen_crc32table.c
===================================================================
--- linux-2.6.11.2.orig/lib/gen_crc32table.c
+++ linux-2.6.11.2/lib/gen_crc32table.c
@@ -1,6 +1,8 @@
#include <stdio.h>
#include "crc32defs.h"
+#ifndef __CYGWIN__
#include <inttypes.h>
+#endif
#define ENTRIES_PER_LINE 4
Index: linux-2.6.11.2/usr/gen_init_cpio.c
===================================================================
--- linux-2.6.11.2.orig/usr/gen_init_cpio.c
+++ linux-2.6.11.2/usr/gen_init_cpio.c
@@ -10,6 +10,12 @@
#include <ctype.h>
#include <limits.h>
+/* Cygwin's <limits.h> defines PATH_MAX as (260 - 1) which just won't do. */
+#ifdef __CYGWIN__
+#undef PATH_MAX
+#define PATH_MAX 259
+#endif
+
/*
* Original work by Jeff Garzik
*
--
Tom Rini
http://gate.crashing.org/~trini/
next prev parent reply other threads:[~2005-04-08 14:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-08 14:13 cross-compiling under cygwin? Robert P. J. Day
2005-04-08 14:46 ` Tom Rini [this message]
2005-04-08 16:49 ` Wolfgang Denk
2005-04-08 16:52 ` Robert P. J. Day
2005-04-08 17:57 ` Patrick Huesmann
2005-04-08 18:32 ` Dan Malek
2005-04-08 18:35 ` Robert P. J. Day
-- strict thread matches above, loose matches on Subject: below --
2005-04-08 15:24 Steven Blakeslee
2005-04-08 18:48 Howard, Marc
2005-04-08 21:17 ` Dan Malek
2005-04-10 16:59 ` Wolfgang Denk
2005-04-11 18:30 Howard, Marc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050408144600.GX3396@smtp.west.cox.net \
--to=trini@kernel.crashing.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=rpjday@mindspring.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).