Discussion:
building a cross-compiler for Linux/OSX
Fabiano Sidler
2011-02-07 09:50:40 UTC
Permalink
Hi folks!

I'm trying to build a cross-compiler under Linux and MacOSX using this
script: http://sourceware.org/ml/cygwin/2010-08/txt00010.txt
I get the same error on Linux and MacOSX after the make of line 340:
=== snip ===
[...]
i686-pc-cygwin-c++ -L/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup -L/opt
/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup/cygwin -L/opt/devel/cygwin/buil
d/cygwin/i686-pc-cygwin/winsup/w32api/lib -isystem /opt/devel/cygwin/src/cygwin-
1.7.6-1/winsup/include -isystem /opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygw
in/include -isystem /opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/w32api/include -
B/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/newlib/ -isystem /opt/devel/cygwi
n/build/cygwin/i686-pc-cygwin/newlib/targ-include -isystem /opt/devel/cygwin/src
/cygwin-1.7.6-1/newlib/libc/include -c -nostdinc++ -DHAVE_CONFIG_H -g -O2 -
Wno-error -MMD -fomit-frame-pointer -Werror -fmerge-constants -ftracer -mno-use-
libstdc-wrappers -Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbu
iltin -fmessage-length=0 -I. -I/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cyg
win -I/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/w32api/include -I/opt/devel/c
ygwin/src/cygwin-1.7.6-1/winsup/cygwin/config/i386 -I/opt/devel/cygwin/lib/gcc/i
686-pc-cygwin/4.5.0/include -fno-rtti -fno-exceptions -o ./fhandler_floppy.o /op
t/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygwin/fhandler_floppy.cc
cc1plus: warnings being treated as errors
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygwin/fhandler_floppy.cc: In member
function ?int fhandler_dev_floppy::get_drive_info(hd_geometry*)?:
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygwin/fhandler_floppy.cc:59:37: err
or: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [fhandler_floppy.o] Error 1
make[3]: Leaving directory `/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup
/cygwin'
make[2]: *** [cygwin] Error 1
make[2]: Leaving directory `/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup
'
make[1]: *** [all-target-winsup] Error 2
make[1]: Leaving directory `/opt/devel/cygwin/build/cygwin'
make: *** [all] Error 2
=== snap ===

Anyone able to run the script to completion or a different (and working) way
to build a cross-compiler for cygwin on Linux and OSX?

Greetings,
F. Sidler
Fabiano Sidler
2011-02-09 20:09:17 UTC
Permalink
Hello? Noone building cross-compilers for cygwin?
Post by Fabiano Sidler
Hi folks!
I'm trying to build a cross-compiler under Linux and MacOSX using this
script: http://sourceware.org/ml/cygwin/2010-08/txt00010.txt
=== snip ===
[...]
i686-pc-cygwin-c++ -L/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup -L/opt
/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup/cygwin -L/opt/devel/cygwin/buil
d/cygwin/i686-pc-cygwin/winsup/w32api/lib -isystem /opt/devel/cygwin/src/cygwin-
1.7.6-1/winsup/include -isystem /opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygw
in/include -isystem /opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/w32api/include -
B/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/newlib/ -isystem /opt/devel/cygwi
n/build/cygwin/i686-pc-cygwin/newlib/targ-include -isystem /opt/devel/cygwin/src
/cygwin-1.7.6-1/newlib/libc/include -c -nostdinc++ -DHAVE_CONFIG_H -g -O2 -
Wno-error -MMD -fomit-frame-pointer -Werror -fmerge-constants -ftracer -mno-use-
libstdc-wrappers -Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbu
iltin -fmessage-length=0 -I. -I/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cyg
win -I/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/w32api/include -I/opt/devel/c
ygwin/src/cygwin-1.7.6-1/winsup/cygwin/config/i386 -I/opt/devel/cygwin/lib/gcc/i
686-pc-cygwin/4.5.0/include -fno-rtti -fno-exceptions -o ./fhandler_floppy.o /op
t/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygwin/fhandler_floppy.cc
cc1plus: warnings being treated as errors
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygwin/fhandler_floppy.cc: In member
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/cygwin/fhandler_floppy.cc:59:37: err
or: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [fhandler_floppy.o] Error 1
make[3]: Leaving directory `/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup
/cygwin'
make[2]: *** [cygwin] Error 1
make[2]: Leaving directory `/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup
'
make[1]: *** [all-target-winsup] Error 2
make[1]: Leaving directory `/opt/devel/cygwin/build/cygwin'
make: *** [all] Error 2
=== snap ===
Anyone able to run the script to completion or a different (and working) way
to build a cross-compiler for cygwin on Linux and OSX?
Greetings,
F. Sidler
Peter John Acklam
2011-02-10 09:26:56 UTC
Permalink
Post by Fabiano Sidler
Hello? Noone building cross-compilers for cygwin?
I tried several times building a cross-compiler for sparc Solaris. I tried using the headers for Solaris 8, 9, and 10, but I never succeeded. I was able to build binutils, though, but not gcc. I have never tried Linux/OSX.

Peter
Yaakov (Cygwin/X)
2011-02-10 11:48:27 UTC
Permalink
Post by Peter John Acklam
Post by Fabiano Sidler
Hello? Noone building cross-compilers for cygwin?
I tried several times building a cross-compiler for sparc Solaris. I tried
using the headers for Solaris 8, 9, and 10, but I never succeeded. I was
able to build binutils, though, but not gcc. I have never tried Linux/OSX.
IIUC the OP is trying to build a linux-to-cygwin cross-compiler. It
sounds like you're trying to build a cygwin-to-solaris cross-compiler,
and there is such a toolchain available in Ports:

http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/solaris10-sparc-binutils
http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/solaris10-sparc-gcc
http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/solaris10-x86-binutils
http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/solaris10-x86-gcc

The GCC .cygport files explain how to get the necessary libc/libm
headers and libraries off of a Solaris system and where to place them on
the Cygwin system.


Yaakov
Cygwin Ports
Yaakov (Cygwin/X)
2011-02-10 11:05:27 UTC
Permalink
Post by Fabiano Sidler
I'm trying to build a cross-compiler under Linux and MacOSX using this
script: http://sourceware.org/ml/cygwin/2010-08/txt00010.txt
Cygwin normally builds with -Werror but there are a few warnings
generated by GCC 4.5 which haven't been fixed yet in the code. Remove
-Werror from $top_builddir/i686-pc-cygwin/winsup/cygwin/Makefile and the
rest of the build should precede without any further difficulties.


Yaakov
Cygwin Ports
Fabiano Sidler
2011-02-14 21:01:48 UTC
Permalink
Sorry for replying so late.
Post by Yaakov (Cygwin/X)
Post by Fabiano Sidler
I'm trying to build a cross-compiler under Linux and MacOSX using this
script: http://sourceware.org/ml/cygwin/2010-08/txt00010.txt
Cygwin normally builds with -Werror but there are a few warnings
generated by GCC 4.5 which haven't been fixed yet in the code. Remove
-Werror from $top_builddir/i686-pc-cygwin/winsup/cygwin/Makefile and the
rest of the build should precede without any further difficulties.
Not without any further difficulties, but at least with a different error:

=== snip ===
[...]
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/utils/mingw i686-pc-cygwin-gcc -c -D
__CRTDLL__ -U__MSVCRT__ -g -O2 -Wno-error -I/opt/devel/cygwin/src/cygwin-1.7.6-1
/winsup/mingw/include -I/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/mingw/../inc
lude -nostdinc -iwithprefixbefore include -I /opt/devel/cygwin/src/cygwin-1.7.6-
1/winsup/mingw/../w32api/include /opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/min
gw/crt1.c -o crt1.o
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/utils/mingw: couldn't find i686-pc-m
ingw32 directory
make[3]: *** [crt1.o] Error 1
make[3]: Leaving directory `/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup
/mingw'
make[2]: *** [mingw] Error 1
make[2]: Leaving directory `/opt/devel/cygwin/build/cygwin/i686-pc-cygwin/winsup
'
make[1]: *** [all-target-winsup] Error 2
make[1]: Leaving directory `/opt/devel/cygwin/build/cygwin'
make: *** [all] Error 2
=== snap ===

Again, the same error on Linux and OSX.

Thank you for helping, btw! ;)

Greetings,
Fabiano
Yaakov (Cygwin/X)
2011-02-15 12:47:18 UTC
Permalink
Post by Fabiano Sidler
/opt/devel/cygwin/src/cygwin-1.7.6-1/winsup/utils/mingw: couldn't find i686-pc-m
ingw32 directory
make[3]: *** [crt1.o] Error 1
You need to have mingw.org runtime and w32api files installed, such as
Fedora Linux's mingw32-runtime and mingw32-w32api packages. Otherwise,
unpack the binary packages found here into your system root:

http://cygutils.fruitbat.org/ITP/mingw-gcc/release/mingw/mingw-runtime/
http://cygutils.fruitbat.org/ITP/mingw-gcc/release/mingw/mingw-w32api/

HTH,


Yaakov
Yaakov (Cygwin/X)
2011-02-17 12:26:34 UTC
Permalink
Post by Fabiano Sidler
=== snip ===
Again, the same error on Linux and OSX.
Depending on your distro, this might make things a bit easier:

http://cygwinports.blogspot.com/2011/02/across-and-back-again.html

As for OSX, you'll need the patches from git, but the directions from
the .spec files will likely need some adjustments.

HTH,


Yaakov
Cygwin Ports

Loading...