public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem building g++ 4.1.1 on Cygwin
@ 2007-01-10  6:37 Dave Yost
  2007-01-10  6:55 ` Brian Dessent
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Yost @ 2007-01-10  6:37 UTC (permalink / raw)
  To: gcc-help

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.

Any help would be greatly appreciated!

Thanks

Dave Yost

Z% uname -a
CYGWIN_NT-5.1 daveyost599f 1.5.23(0.156/4/2) 2006-12-19 10:52 i686 Cygwin
Z% cd /usr/local/src/packages
Z% for x in ../downloads/gcc-core-4.1.1.tar.bz2 
../downloads/gcc-g++-4.1.1.tar.bz2
for> bunzip2 < $x | tar xf -
Z% cd gcc-4.1.1
Z% ./configure \
    --prefix=/usr/local \
    --enable-version-specific-runtime-libs \
    --disable-nls \
      --host=i686-pc-cygwin \
    --target=i686-pc-mingw32
...
Z% make
...
make[2]: Entering directory 
`/usr/local/src/packages/gcc-4.1.1/host-i686-pc-cygwin/gcc'
TARGET_CPU_DEFAULT="" \
         HEADERS="auto-host.h ansidecl.h config/i386/xm-cygwin.h" DEFINES="" \
         /bin/sh ../.././gcc/mkconfig.sh config.h
...
chmod a+r include/limits.h
rm -f include/READMEcp ../.././gcc/../fixincludes/README-fixinc include/README
chmod a+r include/README
echo timestamp > stmp-int-hdrsmake[2]: *** No rule to make target 
`/usr/local/bin/i686-pc-mingw32-as.exe', needed by `stamp-as'.  Stop.
make[2]: Leaving directory 
`/usr/local/src/packages/gcc-4.1.1/host-i686-pc-cygwin/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/usr/local/src/packages/gcc-4.1.1'
make: *** [all] Error 2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem building g++ 4.1.1 on Cygwin
  2007-01-10  6:37 Problem building g++ 4.1.1 on Cygwin Dave Yost
@ 2007-01-10  6:55 ` Brian Dessent
  2007-01-10 17:14   ` Dave Yost
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Dessent @ 2007-01-10  6:55 UTC (permalink / raw)
  To: Dave Yost; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem building g++ 4.1.1 on Cygwin
  2007-01-10  6:55 ` Brian Dessent
@ 2007-01-10 17:14   ` Dave Yost
  2007-01-10 18:35     ` Brian Dessent
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Yost @ 2007-01-10 17:14 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem building g++ 4.1.1 on Cygwin
  2007-01-10 17:14   ` Dave Yost
@ 2007-01-10 18:35     ` Brian Dessent
  2007-01-10 19:01       ` Dave Yost
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Dessent @ 2007-01-10 18:35 UTC (permalink / raw)
  To: Dave Yost; +Cc: gcc-help

Dave Yost wrote:

> 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?

-mno-cygwin and MinGW are the same thing.  That flag is just a shortcut
to invoking a copy of the MinGW version of the compiler.  It removes
Cygwin entirely from the picture and switches the toolchain to a
completely different target, just as if you were cross compiling.  So,
just build/use the MinGW version of gcc if that's what you want.  To get
"gcc -mno-cygwin" working requires that you build and install two
separate versions of gcc, which is pointless if all you are doing is
using MinGW anyway.

> 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/.

I don't understand.  Why are you building a 4.x compiler if you already
know that what you're trying to do only works with 3.4?

Brian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem building g++ 4.1.1 on Cygwin
  2007-01-10 18:35     ` Brian Dessent
@ 2007-01-10 19:01       ` Dave Yost
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Yost @ 2007-01-10 19:01 UTC (permalink / raw)
  To: gcc-help

At 10:35 AM -0800 2007-01-10, Brian Dessent wrote:
>
>I don't understand.  Why are you building a 4.x compiler if you already
>know that what you're trying to do only works with 3.4?

1. The C++ code that needs to go into the dll that will be loaded by Java will not compile with anything less than 4.1.x.

2. Java works with code compiled with 3.4 only if -no-cygwin is used.

3. So far, I have not found a way to get code compiled with 4.1.x to work with Java.

Therefore, it seems that I need to be able to compile with 4.1.x but without using Cygwin libraries.  Or maybe there is some other problem.

Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-10 19:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-10  6:37 Problem building g++ 4.1.1 on Cygwin Dave Yost
2007-01-10  6:55 ` Brian Dessent
2007-01-10 17:14   ` Dave Yost
2007-01-10 18:35     ` Brian Dessent
2007-01-10 19:01       ` Dave Yost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).