[gccsdk] Building GCC4 in Cygwin

John Tytgat John.Tytgat at aaug.net
Mon Jan 28 12:31:51 PST 2008


In message <c62c31684f.admin at snowstone.org.uk>
          Adam <lists at snowstone.org.uk> wrote:

> In message <276952654f.admin at snowstone.org.uk>, Adam wrote:
> 
> > In message <BAY101-W2094760EC5A0CEDD51C6B6F03E0 at phx.gbl>, alan buckley
> > wrote:
> > 
> > > 
> > > > On Wed Jan 16 20:06:12 GMT 2008  Adam wrote:
> > > 
> > > > Upon further investigation it seems there is some problem with the
> > > > version of Autogen I've got. I'll try and get it sorted out and try
> > > > again.
> > > 
> > > Have you got any further with this as I'd now like to try to build
> > > GCC4 on Cygwin as well?
> > 
> > Unfortunately not :(
> 
> OK, I've got a bit further now. I've completed the built-it stage

That's very good news.  Could you add your experience & specifics you
had to do to <URL:http://www.riscos.info/index.php/Cygwin_setup> page ?

> (but blimey it took a long time - about a day on this dual-core machine).

A day ?! That's possibly the overhead of having a Windows subsystem then as
it takes about 20 minutes on one core of AMD64 X2 4400 processor here
(Linux).

You could try '-j2' to have a parallel build so that could cut some time
but I think we're currently having a dependency missing as I sometimes
seem to hit a build problem with it (and this since a couple of months)
and I never found the time to investigate this properly.

> I can. If anyone's interested in the (9MB!) log I can host it somewhere.

I don't mind to have a look at it (zip it first) and compare it with mine.

> I wasn't quite sure from the instructions in the ReadMe if, after
> built-it, I was supposed to have a completly-built installation,

Yes. You have now a fully installed cross-compiler at
$GCCSDK_INSTALL_CROSSBIN/.. directory ("make install" is part of build-it
script).

> but I haven't got a riscos directory anywhere,

Why you're expecting a 'riscos' directory ? Or where ? Or is that
part of $GCCSDK_INSTALL_CROSSBIN/.. ?

> so I assumed not and continued with the builddir-cross "make".

No that's not needed. You're actually restarting the build.  In fact it is
not wrong perse as I do that myself after making changes in the gcc/binutils
sources and avoiding a full build again.  However, it is not always
bullet proof and some dependencies are not checked for (e.g. when you do
linker changes, don't expect that all gcc binaries get relinked when
building the native RISC OS compiler).

UnixLib hackers do typically:

  $ cd builddir-cross/arm-unknown-riscos/libunixlib
  $ make
  $ make install

Replace 'libunixlib' by 'libscl' for SharedCLibrary stubs rebuild.

> Unfortunately that finished with an error:
> 
> 
> [snip]
> Checking multilib configuration...
> /home/adamr/gccsdk/gcc/srcdir/move-if-change: line 23: cmp: command not found

When you see stuff like this "command not found", try to fix this. I guess
you're missing the 'cmp' binary in your installation.

> /bin/sh /home/adamr/gccsdk/gcc/srcdir/mkinstalldirs arm-unknown-riscos/libunixli
> b ; \
>         rm -f arm-unknown-riscos/libunixlib/Makefile || : ; \
>         cp multilib.out arm-unknown-riscos/libunixlib/multilib.out
> Configuring in arm-unknown-riscos/libunixlib
> configure: WARNING: If you wanted to set the --build type, don't use --host.
>     If a cross compiler is detected then cross compile mode will be used.

The WARNING can be ignored.

> configure: loading cache ./config.cache
> configure: error: `CXX' has changed since the previous run:
> configure:   former value:  /home/adamr/gccsdk/gcc/builddir-cross/./gcc/g++ -B/h
> ome/adamr/gccsdk/gcc/builddir-cross/./gcc/ -nostdinc++  -L/home/adamr/gccsdk/gcc
> /builddir-cross/arm-unknown-riscos/libstdc++-v3/src -L/home/adamr/gccsdk/gcc/bui
> lddir-cross/arm-unknown-riscos/libstdc++-v3/src/.libs -B/home/adamr/gccsdk/gcc/b
> uilddir-cross/arm-unknown-riscos/libunixlib/ -B/home/adamr/gccsdk/gcc/builddir-c
> ross/arm-unknown-riscos/libunixlib/.libs/ -isystem /home/adamr/gccsdk/gcc/srcdir
> /libunixlib/include -B/home/adamr/gccsdk/gcc/cross/arm-unknown-riscos/bin/ -B/ho
> me/adamr/gccsdk/gcc/cross/arm-unknown-riscos/lib/ -isystem /home/adamr/gccsdk/gc
> c/cross/arm-unknown-riscos/include -isystem /home/adamr/gccsdk/gcc/cross/arm-unk
> nown-riscos/sys-include -L/home/adamr/gccsdk/gcc/builddir-cross/./ld
> configure:   current value: /home/adamr/gccsdk/gcc/builddir-cross/./gcc/g++ -B/h
> ome/adamr/gccsdk/gcc/builddir-cross/./gcc/ -nostdinc++ -nostdinc++ -I/home/adamr
> /gccsdk/gcc/builddir-cross/arm-unknown-riscos/libstdc++-v3/include/arm-unknown-r
> iscos -I/home/adamr/gccsdk/gcc/builddir-cross/arm-unknown-riscos/libstdc++-v3/in
> clude -I/home/adamr/gccsdk/gcc/srcdir/libstdc++-v3/libsupc++ -I -I/home/adamr/gc
> csdk/gcc/srcdir/libstdc++-v3/include/backward -I/home/adamr/gccsdk/gcc/srcdir/li
> bstdc++-v3/testsuite -L/home/adamr/gccsdk/gcc/builddir-cross/arm-unknown-riscos/
> libstdc++-v3/src -L/home/adamr/gccsdk/gcc/builddir-cross/arm-unknown-riscos/libs
> tdc++-v3/src/.libs -B/home/adamr/gccsdk/gcc/builddir-cross/arm-unknown-riscos/li
> bunixlib/ -B/home/adamr/gccsdk/gcc/builddir-cross/arm-unknown-riscos/libunixlib/
> .libs/ -isystem /home/adamr/gccsdk/gcc/srcdir/libunixlib/include -B/home/adamr/g
> ccsdk/gcc/cross/arm-unknown-riscos/bin/ -B/home/adamr/gccsdk/gcc/cross/arm-unkno
> wn-riscos/lib/ -isystem /home/adamr/gccsdk/gcc/cross/arm-unknown-riscos/include
> -isystem /home/adamr/gccsdk/gcc/cross/arm-unknown-riscos/sys-include -L/home/ada
> mr/gccsdk/gcc/builddir-cross/./ld
> configure: error: changes in the environment can compromise the build
> configure: error: run `make distclean' and/or `rm ./config.cache' and start over
> 
> make[1]: *** [configure-target-libunixlib] Error 1
> make[1]: Leaving directory `/home/adamr/gccsdk/gcc/builddir-cross'

What you see is the internal build detection going off on the fact that
it detects meaningful configuration differences.  I'm not sure why this
goes off in your case (as I don't think you have reconfigured one of the
parts of the build tree) but it could be because of the failing 'cmp'
binary. I would install it and see if you have this problem when:

  $ cd builddir-cross
  $ make
  $ make install

But again, those 3 lines are not necessary to build the cross-compiler
after a succesful ./build-it.

When you have your cross-compiler, do './install-env' and then you're
completely ready to use Autobuilder and create your own ELF binaries.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven




More information about the gcc mailing list