This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Building newlib-2.1.0 for m68k fails
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: "Newlib Mailing List (newlib at sourceware dot org)" <newlib at sourceware dot org>
- Cc: Anders Montonen <Anders dot Montonen at iki dot fi>, kclifford at tranaptic dot ca
- Date: Fri, 15 Aug 2014 15:35:10 -0400 (EDT)
- Subject: Re: Building newlib-2.1.0 for m68k fails
- Authentication-results: sourceware.org; auth=none
- References: <004301cfb1cb$7d05e710$7711b530$ at tranaptic dot ca> <C6A3A7C4-B246-45BE-80FB-B3DD4D23E98D at iki dot fi>
Hi Anders/Keith,
The patch should instead be setting _READ_WRITE_RETURN_TYPE in newlib/libc/include/sys/config.h
to ssize_t for m68k since the io-read.c code has been specifying ssize_t for quite
a while now.
Please try the attached patch for newlib and let me know if there are any issues.
-- Jeff J.
----- Original Message -----
From: "Anders Montonen" <Anders.Montonen@iki.fi>
To: newlib@sourceware.org
Sent: Thursday, August 14, 2014 1:17:59 PM
Subject: Re: Building newlib-2.1.0 for m68k fails
On Aug 7, 2014, at 2:09, Keith Clifford wrote:
> On Cygwin I'm building gcc-4.91 along with newlib-2.1.0 for a mingw host and
> an m68k ELF target. Building newlib failed when trying to compile io-read.c
> because the return type of read is a ssize_t but the prototype uses
> _READ_WRITE_RETURN_TYPE which in my configuration was defined to int. The
> attached patch fixed the problem.
FWIW, this patch fixed my build problems.
Regards,
Anders Montonen
Index: libc/include/sys/config.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
retrieving revision 1.65
diff -u -p -r1.65 config.h
--- libc/include/sys/config.h 23 Oct 2013 10:04:42 -0000 1.65
+++ libc/include/sys/config.h 15 Aug 2014 19:26:22 -0000
@@ -75,6 +75,10 @@
#define _POINTER_INT short
#endif
+#if defined(__m68k__) || defined(__mc68000__)
+#define _READ_WRITE_RETURN_TYPE _ssize_t
+#endif
+
#ifdef ___AM29K__
#define _FLOAT_RET double
#endif