Failure in rebuilding Cygwin-1.5.24-2 with recent newlib

Brian Dessent
Sat Jun 16 15:38:00 GMT 2007

Angelo Graziosi wrote:
> I want to flag that rebuilding Cygwin-1.5.24-2 with recent checkout of
> newlib fails in this way:

It's really not a good idea to mix and match like that, you can run into
subtle breakage that way as the two are meant to be kept in sync.  For
example, if newlib added a new function (as in this case) it will be
present in the headers but it won't get exported by the DLL since that
requires changes in cygwin.din.  And thus if you try to use the
combination of lib+headers that you just built you'll get failures since
the latter declares an interface that the former doesn't export.

And besides, Newlib and Cygwin are in the same CVS repository so all you
have to do is check out the cygwin module and you get the latest newlib
module automatically.

> '/home/Angelo/Downloads/cygwin_varie/Snapshots/cygwin-1.5.24-2p5/newlib/libc/string/'`strcasestr.c
> /home/Angelo/Downloads/cygwin_varie/Snapshots/cygwin-1.5.24-2p5/newlib/libc/string/strcasestr.c:72: error: parse
> error before string constant
> /home/Angelo/Downloads/cygwin_varie/Snapshots/cygwin-1.5.24-2p5/newlib/libc/string/strcasestr.c:72: warning: data
> definition has no type or storage class

This is just due to __FBSDID not getting #defined to blank properly. 
The file includes sys/cdefs.h and newlib's copy contains the required
bit (#define __FBSDID(x) /* nothing */) however when building with
Cygwin, the Cygwin headers are used and Cygwin's sys/cdefs.h doesn't
contain this.  The appropriate fix is either to modify strcasestr.c or
to fix Cygwin's sys/cdefs.h.  I think the latter is probably the better
choice, since it seems that there is precedent already in newlib for
being able to just #include <sys/cdefs.h> followed by use of __FBSDID
without having to explicitly undefine it.  Patch attached which fixes
the build for me.

-------------- next part --------------
2007-06-16  Brian Dessent  <>

	* include/sys/cdefs.h (__FBSDID): Define.

Index: include/sys/cdefs.h
RCS file: /cvs/src/src/winsup/cygwin/include/sys/cdefs.h,v
retrieving revision 1.4
diff -u -p -r1.4 cdefs.h
--- include/sys/cdefs.h	8 Aug 2005 18:54:28 -0000	1.4
+++ include/sys/cdefs.h	16 Jun 2007 15:28:58 -0000
@@ -21,3 +21,4 @@ details. */
 #define  __CONCAT(__x,__y)   __x##__y
+#define __FBSDID(x) /* nothing */

More information about the Cygwin-patches mailing list