[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-libsigsegv] mingw failure
From: |
Eric Blake |
Subject: |
Re: [bug-libsigsegv] mingw failure |
Date: |
Tue, 23 Aug 2011 15:29:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11 |
On 08/23/2011 03:18 PM, Sam Steingold wrote:
* Eric Blake<address@hidden> [2011-08-23 15:02:52 -0600]:
On 08/23/2011 02:52 PM, Sam Steingold wrote:
../configure --prefix=/cygdrive/c/sds/src/top-mingw/ CC=i686-pc-mingw32-gcc
...
libtool: link: i686-pc-mingw32-gcc -g -O2 -o cygwin1.exe cygwin1.o
Why is a mingw build trying to compile a cygwin-specific test? You
didn't call configure correctly to let it know that you intended to do
cross-compilation. Try this:
./configure --prefix=/cygdrive/c/sds/src/top-mingw \
--host=i686-pc-mingw32 --build-i686-pc-mingw32
Typo: I meant --build=, not --build-.
That will automatically tell configure that you are doing cross
compilation, and default to finding CC=i686-poc-mingw32-gcc without you
having to explicitly request $CC.
I thought that setting CC would take care of this, i.e., configure
should call CC with -dumpmachine and compare that with the output of
uname (or whatever)... Sorry.
Nope. Doesn't work that way. -dumpmachine is gcc-specific, but not all
cross-compilers are gcc, so there is no portable way to tell if an
arbitrary $CC is a cross-compiler by using options to $CC. Rather, the
autoconf way (as documented in the generic INSTALL file in so many
packages) has _always_ been that to specify cross-compilation, you
specify the --host argument to ./configure; and to avoid warnings, you
also specify the --build argument (the --build argument is the one that
is auto-probed by running config.guess, but for compatibility reasons,
./configure emits a warning if you specify --host without --build).
The only way to expect sane results when cross-compiling for mingw from
a cygwin environment is to not lie to configure about the fact that you
are cross-compiling.
still I see this:
checking whether we are cross compiling... no
Huh? Oh, maybe you hit my typo. What was your exact command line?
When I do:
$ ../configure --host=i686-w64-mingw32 --build=i686-pc-cygwin
...
checking for i686-w64-mingw32-strip... i686-w64-mingw32-strip
...
checking whether we are cross compiling... yes
so it properly found my cross-toolchain, and detected cross compilation.
After that, I got flawless test results:
Test passed.
PASS: sigsegv1.exe
Test passed.
PASS: sigsegv2.exe
Doing SIGSEGV pass 1.
Stack overflow 1 caught.
Doing SIGSEGV pass 2.
Stack overflow 2 caught.
Test passed.
PASS: sigsegv3.exe
Starting recursion pass 1.
Stack overflow 1 caught.
Starting recursion pass 2.
Stack overflow 2 caught.
Test passed.
PASS: stackoverflow1.exe
Starting recursion pass 1.
Stack overflow 1 caught.
Starting recursion pass 2.
Stack overflow 2 caught.
Segmentation violation correctly detected.
Segmentation violation correctly detected.
Test passed.
PASS: stackoverflow2.exe
==================
All 5 tests passed
==================
libsigsegv: i686-w64-mingw32 | yes | yes | 2.10
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org