git/list[1] front-page[2] threads[3] people[4] search[5] about
 

recent cygwin breakage

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Nov 22, 2014, 16:29 UTC
Message-ID
<5470B9F9.2060008@ramsay1.demon.co.uk>
Hi Junio,
Just a quick heads-up on a recent cygwin breakage.

I updated my (64-bit) cygwin installation yesterday and (along with many other packages) I noticed a new version of gcc (and presumably libc) was installed (gcc v4.8.3-5 x86-64).

Unfortunately, this caused new warning to be issued when compiling git. In particular, warnings about the implicit declaration of the memmem(), strlcpy() and strcasestr() functions. As an example:

    CC archive.o
archive.c: In function ‘format_subst’:
archive.c:44:3: warning: implicit declaration of function ‘memmem’ [-Wimplicit-function-declaration]
   b = memmem(src, len, "$Format:", 8);
   ^
archive.c:44:5: warning: assignment makes pointer from integer without a cast [enabled by default]
   b = memmem(src, len, "$Format:", 8);
     ^

I haven't spent too long on this, but it appears that the _XOPEN_SOURCE setting now trumps _GNU_SOURCE and _BSD_SOURCE settings. (I am guessing that /usr/lib/gcc/x86_64-pc-cygwin/4.8.3/include-fixed/sys/cdefs.h was changed recently to reflect the new priority).

Anyway, based on that quick squint, I changed git-compat-util.h, thus:
    diff --git a/git-compat-util.h b/git-compat-util.h
    index 400e921..cef2691 100644
    --- a/git-compat-util.h
    +++ b/git-compat-util.h
    @@ -75,7 +75,8 @@
     # endif
     #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
           !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
    -      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__)
    +      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \
    +      !defined(__CYGWIN__)
     #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
     #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
     #endif
... which fixed up the build for me.

However, I haven't run any tests yet. Also, I would need to check this out on 32-bit cygwin (I haven't booted that laptop into Win XP for quite some time!).

Hmm, I don't really know if this is an unintended side-effect of a recent change to cygwin (or a bug), but I couldn't see any mention of this on the cygwin mailing list. (I don't intend to report this to that mailing list; I don't want to subscribe to (yet another) busy list). :(

ATB, Ramsay Jones

Next: Junio C Hamano
Message 1 of 3 in “recent cygwin breakage”
  1. Ramsay JonesNov 22, 2014
  2. Junio C HamanoNov 23, 2014
  3. Ramsay JonesNov 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.