chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH 0/1] Add _XOPEN_SOURCE feature test macro


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH 0/1] Add _XOPEN_SOURCE feature test macro
Date: Sat, 14 Jan 2017 21:34:16 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Jan 14, 2017 at 03:00:20PM +0100, Kooda wrote:
> On Fri, 13 Jan 2017 16:08:02 +1300
> Evan Hanson <address@hidden> wrote:
> 
> > Hi hackers,
> > 
> > Another small patch for Windows. This one fixes a symbol visibility
> > problem when building CHICKEN on Cygwin (64-bit), where the following
> > currently occurs:
> > […]
> 
> Tested on windows 10 with latest Cygwin, both CHICKEN 4 and 5. It
> builds fine, tests pass and I was also able to run and serve requests
> with spiffy. :)

Hi guys,

Thanks for the patch, Evan, and thanks for testing, Kooda!

I have no access to a true 64-bit build of Windows, so I tested on
Windows 7 (x86) with Cygwin, but unfortunately this patch now actually
_introduces_ warnings there: "implicit declaration of initgroups" and
"implicit declaration of strlcpy".

Defining _XOPEN_SOURCE causes the __BSD_VISIBLE macro in the Cygwin
headers to get set to 0 (regardless of our defining _BSD_SOURCE),
which then hides all the BSD extensions like initrgroups and strlcpy.

I really hate playing this stupid game of whack-a-mole with header
definitions (there seems to be no sane combination of definitions that
will work on all OSes).  Instead, I think it's better to just give in
and add the --std=gnu99 on all platforms where we're using gcc and clang.
I'd appreciate if you guys could test this on a x86_64 Windows to see
if that also fixes the warnings you saw before.

This has also been suggested by Christian in #1107, but I was afraid of
adding it because it probably won't work on any compiler aside gcc/clang,
but this preprocessor madness is getting out of hand, and this seems
like a simpler approach and so far it seems to work everywhere.  If this
is not acceptable, we could also try defining _GNU_SOURCE instead.  Like
the Cygwin headers say "this defines everything and the kitchen sink".

PS: I also noticed that "$time foo" doesn't work in either the Cygwin nor
the Mingw-msys shells (they have a builtin "time", but for some reason
using $time causes it not to see this), so I've attached a second patch
with a slightly different workaround for missing "time" than the
workaround we added in cfdeb4ab.  Yay for broken systems :(

The patch simply tries to run "time echo ''" from a variable, and if it
fails sets $time to ":".  See also this Stack Overflow question for more
information about how to make it work and how broken things really are:
http://unix.stackexchange.com/questions/104579/catch-command-not-found-from-shell-script
If this doesn't work, we could spawn a new shell with -c "$time ...", to
make it see the expanded version of the $time variable, but let's try
this first.

Cheers,
Peter

Attachment: 0001-Pass-std-gnu99-gcc-or-clang-is-default.patch
Description: Text Data

Attachment: 0002-Add-a-workaround-for-time-builtin-on-bash-cygwin.chicken-5.patch
Description: Text Data

Attachment: 0002-Add-a-workaround-for-time-builtin-on-bash-cygwin.master.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]