diff mbox

Fix crtstuff.c compilation with mingw build.

Message ID daed3e62-8ef6-4e1a-8143-00e13dd0860f@BAMAIL02.ba.imgtec.org
State New
Headers show

Commit Message

Steve Ellcey April 24, 2014, 5:07 p.m. UTC
I sent an earlier patch to change how GCC configure was setting default
values of caddr_t and ssize_t.  That patch fixed a build problem I had
when building GCC for Windows using the mingw tools but only because my
patch was wrong.  Here is a new patch to fix the problem.

The problem was that crtstuff.c would not compile because it saw two
different (incompatible) definitions of caddr_t, one coming from
auto-host.h (set by the configure script) and one coming from the
sys/types.h system header file (part of glibc in my case).

Since crtstuff.c doesn't actually need or use caddr_t my patch
undef's it after including auto-host.h in the same way that
pid_t, rlim_t, ssize_t, and vfork are already undef'ed.

Note that there is a FIXME in crtstuff that says including auto-host
is wrong, but I don't have a fix for that larger issue.

Tested with my mingw build and a linux based mips toolchain.

OK to checkin?

Steve Ellcey
sellcey@mips.com


2014-04-24  Steve Ellcey  <sellcey@mips.com>

	* crtstuff.c: Undef caddr_t.

Comments

Rainer Orth April 24, 2014, 5:27 p.m. UTC | #1
"Steve Ellcey " <sellcey@mips.com> writes:

> diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
> index 12bed4b..d09455f 100644
> --- a/libgcc/crtstuff.c
> +++ b/libgcc/crtstuff.c
> @@ -54,6 +54,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #include "auto-host.h"
>  #undef pid_t
>  #undef rlim_t
> +#undef caddr_t
>  #undef ssize_t
>  #undef vfork
>  #include "tconfig.h"

It seems the undef's were sorted alphabetically.  Please keep it this way.

	Rainer
diff mbox

Patch

diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index 12bed4b..d09455f 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -54,6 +54,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "auto-host.h"
 #undef pid_t
 #undef rlim_t
+#undef caddr_t
 #undef ssize_t
 #undef vfork
 #include "tconfig.h"