Bugzilla – Bug 691480
cygwin build fails with parse error on esp field in signal.h
Last modified: 2010-07-23 22:14:13 PDT
Created attachment 6512 [details]
patches to ensure that esp in estack.h does not conflict with eps in signal.h
gs 8.71 fails to build on Windows under cygwin because "base/stat_.h" includes <sys/stat.h> which includes <time.h> which includes <signal.h> which includes <sys/signal.h> which includes <cygwin/signal.h> which defines struct ucontext which has fields with the names of i386 registers including esp.
estack.h defines a macro esp as (e_stack.p).
If estack.h is included before stat_.h, the declaration of the esp field in signal.h gets syntax errors.
#define esp abc.def
In file included from /usr/include/sys/signal.h:107,
/usr/include/cygwin/signal.h:54: error: parse error before '.' token
/usr/include/cygwin/signal.h:58: error: parse error before '}' token
The attached patches fix the problem.
I had a later problem linking because configure found jbig but didn't link it in. I added a way to pass more libraries to Makefile.in so I could link with -ljbig. (Makefile.in already had LDFLAGS and XLDFLAGS, but setting them from the command line caused more problems. I think that configure needs to control them.)
The PC is running Windows Server 2003.
uname -a on cygwin returns
CYGWIN_NT-5.2 wtp 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
We had this problem before: see bug 689276.
Which files in 8.71 failed? i.e. an actual list of failed files from "make -k" would be nice. Alex fixed this 3 years ago and I don't think much has changed - one possible candidate is psi/zchar42.c, "string_.h" which was added in 2008; in any case, Alex probably should handle this.
Created attachment 6534 [details]
log of "./configure ; make -k" of gs 8.71 on cygwin
The parse error from eps happens in psi/zfapi.c.
I just tried the head revision, and the build completes successfuly, using Cygwin 1.7.5, gcc 4.3.4.
I have cygwin 1.5.25 and gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125).
This problem has been fixed in the development version, which
is scheduled for release in August 2010.
See bug 691123 for details.
Thank you for using and contributing to Ghostscript.
*** This bug has been marked as a duplicate of bug 691123 ***
(In reply to comment #3)
> Created an attachment (id=6534) [details]
> log of "./configure ; make -k" of gs 8.71 on cygwin
> The parse error from eps happens in psi/zfapi.c.
I have tried adding CFLAGS -Desp=... against HEAD and built most of the suspects like this file before I asked which files failed. I believe it is fixed in HEAD as the others has verified as well.