Some notes on building gcc-4.3.0
Charles Wilson
cygwin@cwilson.fastmail.fm
Wed Jun 13 07:21:00 GMT 2007
I was testing Danny Smith's latest DWARF-2 patch, and building gcc from
the current (rather unsettled) trunk was a bit tricky. So, I thought
I'd post my experiences, which ultimately resulted in a fully
bootstrapped native cygwin compiler, with c,c++,objc,fortran,java frontends.
Now, whether it actually *works* after installation -- dunno. Probably,
and bootstrapping is pretty good evidence, and building the target
runtime libs is even better, so...
OTOH, no warranty, express or implied, WJFFM, YMMV, etc etc...
First, I had to massage the tree in the following ways (and I was using
revision 125636):
1. patched /usr/include/stdio.h
See: http://www.cygwin.com/ml/newlib/2007/msg00296.html
the patch I used is attached.
2. patched classpath/native/fdlibm/mprec.h (_EXFUN issue)
See: http://gcc.gnu.org/ml/gcc/2007-04/msg00648.html
also attached
3. patched basic_string.[h|tcc] per pr24196
See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196
ditto.
4. danny's latest dwarf2 patch
See: http://gcc.gnu.org/ml/gcc-patches/2007-05/msg02051.html
the gcc mailing list inlined the patch, so it needed lots of hand
fixups. I've attached another copy here.
5. extra dwarf2 patch for cygwin.h
It's in changelog of #4, but missing from patch...
6. fix for _GC_get_thread_stack_base issue
See http://gcc.gnu.org/ml/gcc/2007-03/msg00790.html
I configured as:
$ ../gcc/configure \
--prefix=${PREFIX} \
--exec-prefix=${PREFIX} \
--sysconfdir=${PREFIX}/etc \
--libdir=${PREFIX}/lib \
--libexecdir=${PREFIX}/lib \
--with-datarootdir=${PREFIX}/share \
--enable-languages=c,c++,objc,fortran,java \
--with-gcc \
--enable-nls \
--without-included-gettext \
--enable-version-specific-runtime-libs \
--without-x \
--enable-libgcj \
--disable-java-awt \
--with-system-zlib \
--enable-interpreter \
--disable-libgcj-debug \
--enable-threads=posix \
--enable-java-gc=boehm \
--disable-win32-registry \
--disable-sjlj-exceptions \
--enable-hash-synchronization \
--enable-libstdcxx-debug \
--enable-cxx-flags='-fno-function-sections -fno-data-sections' \
--disable-symvers \
--enable-libgomp \
--with-arch=i486 \
--with-tune=i686 \
--disable-werror \
--disable-shared
Where PREFIX=/opt (I had already built and installed binutils with the
same PREFIX).
$ make bootstrap 2>err.log 1>out.log
This made it all the way thru the three-stage bootstrap, and built most
of the libraries. However, the build failed in libjava, due to stack
overflow in jc1.exe. After manually relinking cc1.exe and jc1.exe with
100MB of stack (-Wl,--stack,102400000) as recommended here:
http://gcc.gnu.org/ml/gcc/2007-06/msg00151.html
I kicked off the build again (see below). Check 'out.log' to get the
correct commandline to relink those two apps, and then just add
-Wl,--stack,102400000
$ make all-target LDFLAGS="-L<BUILDDIR>/i686-pc-cygwin/libgcc" \
2>err2.log 1>out2.log
NOTE: I added the absolute path to the libgcc target directory to
LDFLAGS because otherwise, when trying to link the applications, any
installed libgcc.a in the target ${PREFIX}/lib/gcc/${ARCH}/4.3.0/
directory will be used, instead of the newly built one. In my case, the
installed one was an older 4.3.0 version without the necessary DWARF2
unwind symbols, and ... boom.
NOTE2: I also had a weird but transient problem with missing symbols
related to the HTML_401F class in libjava. As it happened, I ran out of
virtual memory while trying to compile that class, so I ended up with a
HTML_401F.o that had NO symbols at all. After rebooting and shutting
down all unnecessary processes, I was able to get that file to compile
correctly. It required just over 1GB of memory to compile that ONE
file: on my 512MB machine with 1GB VM file, that was...painful.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1-stdio-fix.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070613/4cbc118b/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 2-cygwin-EXFUN.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070613/4cbc118b/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 3-gcc-pr24196.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070613/4cbc118b/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4-gcc-dwarf2-danny-smith-20070530.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070613/4cbc118b/attachment-0003.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 5-gcc-dwarf2-danny-smith-20070530-EXTRA.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070613/4cbc118b/attachment-0004.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 6-boehm-gc-win32thr.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070613/4cbc118b/attachment-0005.ksh>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list