This is the mail archive of the
mailing list for the GCC project.
[Patch] Fix crtstuff.c compilation with mingw build.
- From: "Steve Ellcey " <sellcey at mips dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Apr 2014 10:07:36 -0700
- Subject: [Patch] Fix crtstuff.c compilation with mingw build.
- Authentication-results: sourceware.org; auth=none
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?
2014-04-24 Steve Ellcey <firstname.lastname@example.org>
* crtstuff.c: Undef caddr_t.
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index 12bed4b..d09455f 100644
@@ -54,6 +54,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see