This is the mail archive of the 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]

Now uploaded: gcc-3.3.1, with gnat, java, c++, fortran, objc and c


gcc-3.3.1 binaries are uploaded:

(Note that the the source package is still uploading now, please fetch
the original 3.3.1 source package or the 3.3 source and 3.3-3.3.1.diff
from one of the original GCC mirrors ->

The README at this site:

GCC 3.3.1 for Cygwin >= 1.5.2

This is my private compiler which I run just for fun, don't use it,
build it yourself, that is the most fun;)

Enabled languages: c,c++,f77,objc,ada,java

What is here in this directory:

    This file


There is one big package which includes everything, executables 
are stripped:

There are also several packages with the different backends separated,
if you fetch all the small packages, you'll get the same as included
in the one big package (besides the binaries are not stripped here):

Core includes C compiler, is needed always:

Language backends:    

The source:


The diff is the original diff file fetched from one of the gcc mirrors,
applying it to gcc-3.3 will result in gcc-3.3.1.  But you may want to 
use one of the GCC mirrors to get the source from since this server
has *very* limited bandwidth ->

The patch against this source:

Cygwin GNAT binary package which I used to build Cygwin 1.5.2 GNAT

This includes the C and the Ada backend and I think it cannot be used
to bootstrap gcc-3.3.1 (the Ada part is working, the C part not...) 
with Cygwin 1.5.2.  For details please see HOWTO below.

Build the source, quickstart:

  Unpack the source package
    tar xjf gcc-3.3-src.tar.bz2
  Unpack the diff
    bunzip2 gcc-3.3-3.3.1.diff.bz2
  Apply the diff
    cd gcc-3.3
    patch -p1<../gcc-3.3-3.3.1.diff
    cd ..
  Unpack the patch and rename the source directory
    mv gcc-3.3 gcc-3.3.1
    bunzip2 gcc-3.3.1-76.patch.bz2
    cd gcc-3.3.1
    patch -p1 <../gcc-3.3.1-76.patch
    cd ..

Run the four scripts in this order:

HOWTO build GNAT for Cygwin 1.5.2 with David's GNAT

Get a Cygwin ADA compiler gcc-3.2, built from David Billinghurst using 
a Win32 version here:, or 
the version I modified to fit in one package which installs into the 
correct path when extracted from root and where I renamed gcc.exe to 
gnatgcc.exe because I was not able to use this 'old' gcc-3.2 to compile 

$ wget

This means you'll have two different GCC installations, one default
and one with ADA backend in /usr/local/gcc-3_2.

Unpack the ADA package from your Cygwin root:

$ ( cd / ; tar xjf /path/gcc-ada-3.2.tar.bz2 )

it installs into /usr/local/gcc-3_2.

(Rename gcc.exe to gnatgcc.exe if you use David's original packages 
before removing files!)

Remove all from /usr/local/gcc-3_2/bin besides gnatbind.exe, 
gnatgcc.exe and gnatlink.exe.

Add the /usr/local/gcc-3_2/bin directory to your PATH:

$ export PATH=/usr/local/gcc-3_2/bin:$PATH

Get GCC 3.3.1 sources:

Unpack it to /somewhere/you/like, change the location in the scripts 
below to match your local source path.

Apply the Cygwin/Mingw32 patch (initial great work by Danny Smith,
slightly enhanced by Gerrit P. Haase):

$ wget
$ bunzip2 /path/to/gcc-3.3.1-76.patch.bz2
$ ( cd gcc-3.3.1 ; patch -p1</path/to/gcc-3.3.1-76.patch )

Modified by me: 
- boehm-gc updated to 6.2
- '#include "tm.h"' in cygwin2.c removed
- problems when compiling libjava: gethostname() detection by configure
  fails, wrong detection of inet6 structures which are actually not yet
  implemented in Cygwin. Wrong pathseparator for bootclasspath problem.
- Problem with Ada Makefiles, gnatmake is used to generate docs during 
  the build before you have a working gnatmake, I removed this.  


I use this script to configure:

# modify to your needs
export builddir=/tmp/gcc/gcc-build
export gccsrc=/tmp/gcc/gcc-3.3.1
export inst=/tmp/gcc/inst

mkdir -p old/
mv ${builddir} old/
mv ${inst} old/
mkdir -m 777 -p ${builddir}
mkdir -m 777 -p ${inst}

cd ${builddir}

${gccsrc}/configure     \
        --with-gcc      \
        --with-gnu-ld   \
        --with-gnu-as   \
        --enable-languages=c,c++,f77,objc,ada,java \
        --enable-libgcj \
        --enable-threads=posix  \
        --with-system-zlib      \
        --disable-nls   \
        --without-included-gettext      \
        --enable-interpreter    \
        --disable-sjlj-exceptions \
        --disable-version-specific-runtime-libs \
        --disable-shared        \
        --enable-haifa  \
        --prefix=/usr   \
        --exec-prefix=/usr      \
        --sysconfdir=/etc       \
        --libdir=/usr/lib       \
        --libexecdir=/usr/sbin  \
        --disable-win32-registry        \
        --enable-java-gc=boehm  \
        --enable-hash-synchronization   \
        2>&1 | tee log.configure00

# Script end

Doublcheck that configure found the gnatgcc.exe.
Looks like this in the configure output:
checking for gnatbind... gnatbind
checking for compiler driver that understands Ada... gnatgcc

The --enable-hash-synchronization may be a problem, it is 
undefined in libjava's, but it gets overridden
by this configure flag, at least my example below 
works with hash-synchronization enabled, if you get problems,
try to rebuild without this flag or tell me how to reproduce 
the problem and I'll build again with hash-syncronisation 


I use this script to bootstrap:
export builddir=/tmp/gcc/gcc-build
export gccsrc=/tmp/gcc/gcc-3.3.1
export inst=/tmp/gcc/inst

# This is needed, the manual says you need it if using a minimal
# Ada compiler which we are going to do here.
cd ${gccsrc}/gcc/ada
touch [es]info.h[bs]

cd ${builddir}

# Want 8MB stack because the default on Cygwin
# with 2MB is too small.
make "CFLAGS=-O2" \
     "GCJFLAGS=-O2" \
     "LDFLAGS=-s -Wl,--stack=0x00800000" \
     bootstrap \
     2>&1 | tee ${builddir}/log.bootstrap00

# Script end

If the make ends with an error, don't start the same script 
again, this breaks the Ada build, some Ada objects will be 
recompiled which is superflous and also failed for me.  So if 
the build stocks, fix the problem and run 'cleanstrap' instead 
of 'bootstrap' to restart from scratch, or if the bootstrap 
already was finished, run 'quickstrap' instead of 'bootstrap', 
just change the target in the above script, or copy it to 
another script with another name and another target.

Extra compile step after bootstrap for Ada lib and tools.

I use this script:
export builddir=/tmp/gcc/gcc-build
export gccsrc=/tmp/gcc/gcc-3.3.1
export inst=/tmp/gcc/inst

cd ${builddir}/gcc

make "CFLAGS=-O2" \
     "LDFLAGS=-s" \
     gnatlib_and_tools \
     2>&1 | tee ${builddir}/log.ada-bootstrap00

# Script end


I use this script:
export builddir=/tmp/gcc/gcc-build
export gccsrc=/tmp/gcc/gcc-3.3.1
export inst=/tmp/gcc/inst

cd ${builddir}

make install prefix=${inst}/usr exec_prefix=${inst}/usr \
  bindir=${inst}/usr/bin libdir=${inst}/usr/lib \
  sysconfdir=${inst}/etc includedir=${inst}/usr/include \
  tooldir=${inst}/usr 2>&1 | tee log.install00

rm -f ${inst}/usr/info/dir

cd ${inst}
# I don't strip the binaries for now
# find . -name "*.exe" | xargs strip
tar -cjf gcc-3.3.1-76.tar.bz2 usr/

# Script end

Use it.

$ ( cd / ; tar xjvf ${inst}/gcc-3.3.1-76.tar.bz2 )

#! /bin/sh
# ultra minimalistic compiler test gcc-3.3.1
set -x
echo 'with Text_Io; use Text_Io;' > hello.adb
echo 'procedure hello is' >> hello.adb
echo 'begin' >> hello.adb
echo '  put ("Hello world!");' >> hello.adb
echo 'end hello;' >> hello.adb
/usr/bin/gnatmake hello
# GCJ:
echo 'public class Hello_j {' >
echo 'public static void main(String[] args) {' >>
echo '        System.out.println("Just another Java hacker,");' >>
echo '        }' >>
echo '}' >>
/usr/bin/gcj --main=Hello_j -o Hello_j
# G++:
echo '#include<iostream>' >
echo 'using namespace std;' >>
echo '#define VOID_PTR void *' >>
echo 'int main() {' >>
echo '  cout << "__CYGWIN__ pointer size is: " << (int)sizeof(VOID_PTR) << "\n";' >>
echo '}' >>
/usr/bin/g++ -o pointersize
# G77:
echo '       print *,"Hello world!"' > hello.f
echo '       end' >> hello.f
/usr/bin/g77 -o hello_f hello.f
echo '/*   hello.m' > hello.m
echo ' *   gcc -o hello hello.m -lobjc' >> hello.m
echo ' */' >> hello.m
echo 'main()' >> hello.m
echo '{' >> hello.m
echo '    printf("Hello World,\n");' >> hello.m
echo '}' >> hello.m
/usr/bin/gcc -o hello_o hello.m -lobjc
# C
echo '#include <stdio.h>' > hello.c
echo 'int main() {' >> hello.c
echo '  puts("hello, world");' >> hello.c
echo '  return 0;' >> hello.c
echo '}' >> hello.c
/usr/bin/gcc -o hello_c hello.c

Hurra, it works!

Now after it works for me(tm), you can also fetch the binary
of gcc-3.3.1 which was created during this README was written
to get an Ada compiler for Cygwin.

Fetch it here:

Gerrit P. Haase, 2003-08-17, <gp at familiehaase dot de>

Unsubscribe info:
Problem reports:

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