[gccsdk] Building GCC4 in Cygwin

Adam lists at snowstone.org.uk
Tue Jan 29 20:42:39 GMT 2008


In message <a8bd68684f.Jo at hobbes.bass-software.com>, John Tytgat wrote:

> 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 ?

I've added a few bits. The main problem is the lack of an official
autogen package in Cygwin.


> > (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).

Strange. I haven't built GCC3.4.6 in a while, but I seem to remember it
taking minutes, not hours - how long does 3.4.6 take for you?


> 
> 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.

http://www.snowstone.org.uk/temp/gcc.zip


> > 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/.. ?

Sorry, it's me getting confused about the use of that variable (again).
The GCC3.4.6 instructions have GCCSDK_INSTALL_CROSSBIN set to
home/riscos/cross/bin so I was looking there. In fact, I hadn't defined
the variable myself, so the files are in $GCCSDK_ROOT/cross/bin.



> 
> > 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.

Yes, sorry that was careless of me. I've now found cmp in the diffutils
package.


> > -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

Hmm, well this time I got:


  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'
  make: *** [all] Error 2


If I do a "make distclean" is that going to take another 20 hours?


> 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.

  $ ./install-env
  Warning: $GCCSDK_INSTALL_CROSSBIN is not defined, using $GCCSDK_ROOT/cross/bin instead.
  $GCCSDK_INSTALL_ENV is not defined
  adamr at Lenny ~/gccsdk/gcc
  $ export GCCSDK_INSTALL_CROSSBIN=$GCCSDK_ROOT/cross/bin
  adamr at Lenny ~/gccsdk/gcc
  $ ./install-env
  $GCCSDK_INSTALL_ENV is not defined

What should I set GCCSDK_INSTALL_ENV to?

Thanks,
Adam

-- 
Adam Richardson          Carpe Diem
http://www.snowstone.org.uk/riscos/



More information about the gcc mailing list