Correct way to configure a Cygwin toolchain on Linux?
Dave Korn
dave.korn.cygwin@googlemail.com
Wed Aug 5 13:19:00 GMT 2009
Jason Pyeron wrote:
>> FTR: I ran into some serious complication (to do with the
>> layout of headers and libs and having stuff in a w32api
>> subdir) and it appears that something is not quite working
>> when it comes to building a cross-compiler by the standard
>> procedures. It'll take me a little time to hack my way
>> through and figure out what's going on (and I'll be
>> multitasking with a few other projects I have running), so
>> I'll get back to the list with a HOWTO when I've worked it all out.
>
> If there is something I could throw my spare cycles at?
If you'd like. The problem is that the build fails when it tries to build libgcc:
> /home/davek/cyg-sysroot/obj-gcc/./gcc/xgcc -B/home/davek/cyg-sysroot/obj-gcc/./gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -O2 -g -g -O2 -O2 -O2 -g -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/. -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../include -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libcpp/include -I/usr/include -I/usr/include -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber/dpd -I../libdecnumber -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -I. -I. -I../.././gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/lib
gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/. -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../include -o crtbegin.o -MT crtbegin.o -MD -MP -MF crtbegin.dep -fno-omit-frame-pointer -c \
> /home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc/config/i386/cygming-crtbegin.c
> In file included from ../.././gcc/tm.h:11,
> from /home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc/config/i386/cygming-crtbegin.c:39:
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc/config/i386/cygwin.h:282:21: error: windows.h: No such file or directory
> /home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc/config/i386/cygming-crtbegin.c: In function ‘__gcc_register_frame’:
> /home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc/config/i386/cygming-crtbegin.c:106: error: ‘HANDLE’ undeclared (first use in this function)
[ snip many more errors, all related to lack of windows.h ]
Trying the failing commandline manually with -v added shows that there's no
way it's going to find w32api headers:
> Reading specs from /home/davek/cyg-sysroot/obj-gcc/./gcc/specs
> Target: i686-pc-cygwin
> Configured with: /home/davek/cyg-sysroot/gcc-4.3.2/configure --prefix=/usr/local --target=i686-pc-cygwin --with-sysroot=/usr/local/i686-pc-cygwin/sysroot -v --with-gmp=/usr --with-mpfr=/usr --enable-version-specific-runtime-libs --enable-static --enable-shared --enable-shared-libgcc --enable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix
> Thread model: posix
> gcc version 4.3.2 20080827 (beta) 2 (GCC)
> COLLECT_GCC_OPTIONS='-B/home/davek/cyg-sysroot/obj-gcc/./gcc/' '-B/usr/local/i686-pc-cygwin/bin/' '-B/usr/local/i686-pc-cygwin/lib/' '-isystem' '/usr/local/i686-pc-cygwin/include' '-isystem' '/usr/local/i686-pc-cygwin/sys-include' '-O2' '-g' '-g' '-O2' '-O2' '-O2' '-g' '-g' '-O2' '-DIN_GCC' '-DCROSS_DIRECTORY_STRUCTURE' '-W' '-Wall' '-Wwrite-strings' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wold-style-definition' '-isystem' './include' '-I.' '-I.' '-I/home/davek/cyg-sysroot/gcc-4.3.2/gcc' '-I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/.' '-I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../include' '-I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libcpp/include' '-I/usr/include' '-I/usr/include' '-I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber' '-I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber/dpd' '-I../libdecnumber' '-g0' '-finhibit-size-directive' '-fno-inline-functions' '-fno-exceptions' '-fno-zero-initialized-in-bss' '-fno-toplevel-reorder' '-fno-tree-vectorize' '-I.
' '-I.' '-I../.././gcc' '-I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc' '-I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/.' '-I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc' '-I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../include' '-o' 'crtbegin.o' '-MT' 'crtbegin.o' '-MD' '-MP' '-MF' 'crtbegin.dep' '-fno-omit-frame-pointer' '-c' '-v' '-mtune=generic'
> /home/davek/cyg-sysroot/obj-gcc/./gcc/cc1 -quiet -v -I. -I. -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/. -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../include -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libcpp/include -I/usr/include -I/usr/include -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber -I/home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber/dpd -I../libdecnumber -I. -I. -I../.././gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/. -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc -I/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../include -iprefix /home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/i686-pc-cygwin/4.3.2/ -isystem /home/davek/cyg-sysroot/obj-gcc/./gcc/include -isystem /home/davek/cyg-sysroot/obj-gcc/./gcc/include-fixed -MD crtbegin.d -MF crtbegin.dep -MP -MT crtbegin.o -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter ../include/w32api -idirafter ../../include/w32
api -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -isystem ./include /home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc/config/i386/cygming-crtbegin.c -quiet -dumpbase cygming-crtbegin.c -mtune=generic -auxbase-strip crtbegin.o -g -g -g -g -g0 -O2 -O2 -O2 -O2 -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -fno-omit-frame-pointer -o /tmp/cc3XJ1rE.s
> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include"
> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/sys-include"
> ignoring nonexistent directory "./include"
> ignoring nonexistent directory "/home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/i686-pc-cygwin/4.3.2/include"
> ignoring nonexistent directory "/home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/i686-pc-cygwin/4.3.2/include-fixed"
> ignoring nonexistent directory "/home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/include"
> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/sysroot/usr/local/include"
> ignoring nonexistent directory "/home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/../../lib/gcc/i686-pc-cygwin/4.3.2/include"
> ignoring nonexistent directory "/home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/../../lib/gcc/i686-pc-cygwin/4.3.2/include-fixed"
> ignoring nonexistent directory "/home/davek/cyg-sysroot/obj-gcc/gcc/../lib/gcc/../../lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/include"
> ignoring nonexistent directory "../include/w32api"
> ignoring nonexistent directory "../../include/w32api"
> ignoring duplicate directory "."
> ignoring duplicate directory "/home/davek/cyg-sysroot/gcc-4.3.2/gcc/."
> ignoring duplicate directory "/usr/include"
[ Aside: Hmm, that really doesn't belong there. ]
> ignoring nonexistent directory "../libdecnumber"
> ignoring duplicate directory "."
> ignoring duplicate directory "."
> ignoring duplicate directory "/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/."
> ignoring duplicate directory "/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc"
> ignoring duplicate directory "/home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../include"
> #include "..." search starts here:
> #include <...> search starts here:
> .
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc/../include
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libcpp/include
> /usr/include
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc/../libdecnumber/dpd
> ../.././gcc
> /home/davek/cyg-sysroot/gcc-4.3.2/libgcc
> /home/davek/cyg-sysroot/obj-gcc/./gcc/include
> /home/davek/cyg-sysroot/obj-gcc/./gcc/include-fixed
> /usr/local/i686-pc-cygwin/sysroot/usr/include
> End of search list.
> GNU C (GCC) version 4.3.2 20080827 (beta) 2 (i686-pc-cygwin)
> compiled by GNU C version 4.3.2 20081105 (Red Hat 4.3.2-7), GMP version 4.2.2, MPFR version 2.3.2.
> GGC heuristics: --param ggc-min-expand=81 --param ggc-min-heapsize=96699
> Compiler executable checksum: 4a3fad25cd621de8569ecad57eb31cfe
> In file included from ../.././gcc/tm.h:11,
> from /home/davek/cyg-sysroot/gcc-4.3.2/libgcc/../gcc/config/i386/cygming-crtbegin.c:39:
> /home/davek/cyg-sysroot/gcc-4.3.2/gcc/config/i386/cygwin.h:282:21: error: windows.h: No such file or directory
... because those relative paths:
>> ignoring nonexistent directory "../include/w32api"
>> ignoring nonexistent directory "../../include/w32api"
... aren't going to work anywhere in $objdir, and certainly not from
$objdir/i686-pc-cygwin/libgcc. In a regular build, those -idirafter options
> -idirafter ../include/w32api -idirafter ../../include/w32api
become prefixed (this is from the Cygwin distro compiler):
> /usr/lib/gcc/i686-pc-cygwin/4.3.2/cc1.exe -E -quiet -v -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/lib/../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/lib/../../include/w32api - -mtune=generic
and it has the path to the startfiles prefix:
> -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/lib/../include/w32api
> -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/lib/../../include/w32api
These two options come from CPP_SPEC and use a %s modifier, which is supposed
to make it relative to.. well:
> `%s'
> Current argument is the name of a library or startup file of some
> sort. Search for that file in a standard list of directories and
> substitute the full name found.
So, it seems that the "standard list", wherever that may be, perhaps isn't
adequately configured for a --with-sysroot build. I'm tempted to just fall back
on --with-headers/--with-libs, which copies stuff into the new $prefix/$target,
and looks like it might work, owing to the presence of the
>> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include"
>> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/sys-include"
include paths.
(FTR, I'm trying to build the distro compiler with the cygwin-specific
patches, which have turned out to need a couple of minor tweaks en route).
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list