Problem building g++ 4.1.1 on Cygwin

Dave Yost Dave@Yost.com
Wed Jan 10 17:14:00 GMT 2007


Thanks.

The problem I'm trying to solve is to compile with the 4.1.1 compiler and its C++ calling conventions but not to use any Cygwin libraries.  Is this even possible?

And the reason I'm trying to solve that problem is that Java's JNI works only with 3.4.4 and only when I compile with -no-cygwin.  I.e. JNI doesn't work when compiled with 4.1.1.  Specifically the JNI example I'm talking about is swig-1.3.31/Examples/java/simple/.

What to do?

Dave

At 10:54 PM -0800 2007-01-09, Brian Dessent wrote:
>Dave Yost wrote:
>
>> I'm trying to build a 4.1.1 on cygwin that will let me use the
>> -mno-cygwin argument.  I looked and looked on the web for the runes
>> and finally heard somewhere in a dark alley that I should try
>> something like the below.  I first ran Cygwin setup, and everything
>> is up to date.
>
>I think you're a little confused here.  There are two main gcc targets
>on win32, Cygwin and MinGW.  The Cygwin gcc target has a -mno-cygwin
>option which is just a shortcut for invoking the MinGW gcc if it is
>installed in the right place (i.e. in a parallel directory structure.)
>
>If you want to compile things with the MinGW gcc then you'll obviously
>have to build that, but if you want to invoke the MinGW gcc as "gcc
>-mno-cygwin" then you'll need to also build the native Cygwin gcc of the
>same version and install them both in the same place.  It seems like a
>lot of work to go through to build two compilers when you could just
>build a native MinGW gcc and invoke it directly.
>
>> Z% ./configure \
>>     --prefix=/usr/local \
>>     --enable-version-specific-runtime-libs \
>>     --disable-nls \
>>       --host=i686-pc-cygwin \
>>     --target=i686-pc-mingw32
>
>Here you are cross compiling (in the eyes of autoconf at least) even
>though both targets are nearly compatible at the assembler and linker
>level.
>
>> echo timestamp > stmp-int-hdrsmake[2]: *** No rule to make target
>> `/usr/local/bin/i686-pc-mingw32-as.exe', needed by `stamp-as'.  Stop.
>
>But here autoconf can't find the assembler for the target you
>specified.  It doesn't know that it can use the native host assembler,
>because it thinks you are cross compiling.  Which you are, technically.
>So you'll need to build a cross-binutils, or at least provide symlinks
>or shell wrappers so that they are available under the target-prefixed
>alias.
>
>Brian



More information about the Gcc-help mailing list