This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

building cygwin with gcc4


Has anyone experimented with building Cygwin with gcc4?  I've been
fooling around with it, but there's still a ways to go.

The first thing I ran into was that ilockincr() gets called with a null
pointer somewhere.  When I changed the line "#define
InterlockedIncrement ilockincr" to also spit out an OutputDebugString()
the problem went away, so it would seem that some optimization was
causing a register to be used for the pointer and not converted back to
a memory location.  I just rebuilt with -O0 and that cured it.  Hardly a
good solution though.

The next thing I ran into was this: (I added extra info to the output
while trying to figure out what was happening):

[main] ? 4908 cygheap_user::init: SetTokenInformation (0x7D0,
TokenDefaultDacl, 0x22F950 [dacl.DefaultDacl = 0x22F46F], 4), Win32
error 998
[main] ? 4908 cygheap_user::init: SetKernelObjectSecurity (0x7D8,
DACL_SECURITY_INFORMATION, 0x22F45B), Win32 error 998

I can't see anything blatantly wrong with the parameters being passed
that would cause windows to barf, but I'm sure there's something I'm not
seeing.  Because those were system_printf()s they cause every test in
the test suite to fail as they write to stderr, so I changed them to
debug_printf()s temporarily.  After doing that and rerunning the
testsuite, everything seemed to pass except for mmap(), which suffers
from a divide by zero:

[main] mmaptest01 3204 handle_exceptions: Exception:
STATUS_INTEGER_DIVIDE_BY_ZERO
[main] mmaptest01 3204 open_stackdumpfile: Dumping stack trace to
mmaptest01.exe.stackdump
FAIL: mmaptest01.c (execute)

Looking into it further, the offending line is this in mmap.cc:581:

 gran_len = howmany (off + len, granularity) * granularity - gran_off;

'granularity' had a value of 0.  Something must have changed in the way
that g++ interprets static initializers -- I'm really not sure of
language details here.  But I moved the declaration of the variable out
of the function into file scope and that fixed it.

With those changes my gcc-4 built cygwin1.dll passes all but one of the
tests:

                === winsup Summary ===

# of expected passes            272
# of unexpected failures        1
# of expected failures          8

The failing test is:

running /usr/src/cygwin/build/i686-pc-cygwin/winsup/testsuite/cygrun
./pthread-cancel11.exe > ./pthread-cancel11.log

pthread/cancel11.c: Assertion failed: (result == PTHREAD_CANCELED), file
/usr/src/cygwin/src/winsup/testsuite/winsup.api/pthread/cancel11.c, line
66
FAIL: pthread/cancel11.c (execute)

That's about as far as I got.  Oh, and I had to patch some of the
testcases themselves to get rid of a warning in gcc4, but that was
pretty simple.  I'll post the patches for these on the patches list.

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]