crossbuild cygwin-1.7.6-1 on linux x64

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Aug 26 15:06:00 GMT 2010


On Aug 26 08:49, Charles Wilson wrote:
> That's why it is kinda surprising that (a) there is apparently no
> documentation anywhere on how one should properly build such a
> toolchain,

In theory it should be buildable like any other cross toolchain.

> (b) no existing downloadable version anywhere -- not even
> from un-approved, non-cygwin.com sites, and (c) that the only responses
> I've gotten on these two threads are from somebody else whose procedure
> ALSO produces a broken toolchain, or metadiscussions like this subthread.

Here's how I created the cross toolchain.  It's *very* certainly NOT the
official way of doing it, bootstrapping from scratch and all that, but
it works for slackers like me:

- Create a src dir in which you unpack the Cygwin binutils and gcc4
  source packages.  Unpack the gcc tar file and apply all of Dave's
  patches.
  
- This one is important: Check the cygport file to find the zillion of
  configure options required for Cygwin's gcc.

- Now create a build dir for binutils and gcc-4.  Start building binutils
  with all of the same options as for gcc-4 (doesn't hurt), and with
  --prefix set to some directory of your choice.  Mine is

    /opt/redhat/cross-cygwin

  Eventually call `make install' for binutils.

- Do the same for gcc-4.

- Now cd into /opt/redhat/cross-cygwin and create a convenience symlink:

    ln -s i686-pc-cygwin usr

- Still in /opt/redhat/cross-cygwin, unpack a couple of Cygwin distro
  packages with the following options:

    tar -xjf $PACKAGE-$VERSION.tar.bz2 usr/include usr/lib

  with $VERSION the latest you can get, and with $PACKAGE in

    binutils		(dumper needs libbfd.a)
    cygwin
    gettext		(dumper needs libintl.a)
    libiconv		(dumper needs libiconv.a)
    mingw-runtime	(Only for cyglsa, afair)
    mingw-zlib-devel	(cygcheck)
    w32api
    zlib-devel		(dumper again)
    (*)

- Postinstall:

    find i686-pc-cygwin/lib -name '*.dll.a' -o -name '*.la' | xargs rm
    cd ..
    mkdir i686-pc-mingw32
    ln -s ../i686-pc-cygwin/bin bin
    ln -s ../i686-pc-cygwin/include/mingw include
    ln -s ../i686-pc-cygwin/lib/mingw lib

- Eventually

   export PATH=/opt/redhat/cross-cygwin:$PATH

  and you're all set to build Cygwin from CVS.  From the build dir,
  which is hopefully not the source dir:

    ${CYGWIN_SRCDIR}/configure \
	    --prefix=/usr \
	    --sysconfdir=/etc \
	    --host=i686-pc-cygwin \
	    --target=i686-pc-cygwin
    make


Corinna


(*) I may have missed a package, but I think that's it.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list