[coreboot] romcc changes for mingw32 environment

Patrick Georgi patrick at georgi-clan.de
Fri Nov 20 22:03:28 CET 2009


Hi,

I succeeded in building the entire SerialICE tool set (host and target) 
on mingw32. Most changes are in the repository already, but there are 
two issues in romcc without a clean fix so far, so I thought I'll post 
the patch for discussion to have it out in public.
As they're romcc related, I also added the coreboot list.

1. romcc seems to access memory after free. There's an xfree() call 
removed in that patch, which is a thinly disguised free() call. With 
that one removed, free_basic_block(..) works happily, with it present, I 
get a segfault. Win32 seems to invalidate free'd memory by writing a 
pattern (0xfeeefeee) there, and that trips up the next pointer deref.

There's probably a "sane" fix to that.

2. romcc uses open/read/close to read included files. For some reason, 
read always returns 0 bytes, so that's an endless loop. I kept the 
open/stat/close part, and replaced the read with fread (and fopen/fclose 
to support it).

This might be solved in a cleaner way.


Patrick
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20091120-1-romcc-on-mingw
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20091120/dbce8c1f/attachment.ksh>


More information about the coreboot mailing list