Skip to content

Commit

Permalink
canadian build: fix mingw32
Browse files Browse the repository at this point in the history
Makes libgcc compilation fail because of broken "sys/types.h" include (missing __caddr_t typedef).
This issue is around for a while and apply on both eglibc and glibc.

Tested on glib-2.23 with target=arm, build=linux, host=mingw32.

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
  • Loading branch information
mcrapet authored and Matthieu Crapet committed Sep 12, 2016
1 parent 1e4040e commit 0ea57ef
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions patches/glibc/2.23/002-glibc-sys_types.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(e)glibc: add caddr_t protection (include/sys/types.h)

Workaround for mingw32 related builds.
Troubles happen on mingw32 host/target.

Related thread:
http://sourceware.org/ml/crossgcc/2011-12/msg00073.html

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>

diff --git a/libc/posix/sys/types.h b/libc/posix/sys/types.h
index a7e9084..da97bc8 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -114,7 +114,10 @@ typedef __ssize_t ssize_t;
#ifdef __USE_BSD
# ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
+# if !defined(caddr_t) && !defined(__caddr_t_defined)
typedef __caddr_t caddr_t;
+# define __caddr_t_defined
+# endif
# define __daddr_t_defined
# endif
#endif

0 comments on commit 0ea57ef

Please sign in to comment.