[BUG] Compiling i386-mingw32 cross compiler

Mumit Khan khan@xraylith.wisc.EDU
Mon May 31 16:56:00 GMT 1999


Brian Macy <bmacy@sunshinecomputing.com> writes:
> Steps:
> - build i386-mingw32 binutils from CVS into /usr/local/mingw32
> - Pull down latest code from cvs into /usr/local/src/egcs
> - cd /usr/local/src/egcs
> - mkdir CROSS
> - cd CROSS
> - ../configure --target=i386-mingw32 --host=i686-linux
> --prefix=/usr/local/mingw32/CROSS
> - cd gcc; make installdirs
> - export PATH=$PATH:/usr/local/mingw32/bin
> - make
> ** First error... egcs/CROSS/gcc/fixinc.sh is not found... creating a
> link to egcs/gcc/fixinc.sh fixes that

I don't see this. Also, may want to leave out the host spec; let configure
figure it out that you're hosting on i686-pc-linux-gnu instead.

> ** Second error... stdlib.h and unistd.h not found when compiling
> gcc/libgcc2.c... commenting them out allows it to compile

Don't see this either. If the runtime headers are installed in the right place,
it should find it. Try the following and see where it's searching:
  
  $ cd <objdir>/gcc
  $ echo > foo.c
  $ ./xgcc -B./ -c -v foo.c

Given your prefix, the runtime headers should be in:
  
  /usr/local/mingw32/i386-mingw32/include

and libraries in:

  /usr/local/mingw32/i386-mingw32/lib

> ** Third error (which I haven't found a way around)...
> egcs/CROSS/gcc/xgcc can not build executables. try to run it manually
> with "#include <stdio.h> int main() {}" as an input file gives:
> cpp: unrecognized option `-remap'
> cpp: -lang-c: linker input file unused since linking not done
> xgcc: installation problem, cannot exec `c1': No such file or directory

You're quite possibly running the wrong cpp. Make sure you don't have
GCC_EXEC_PREFIX, LIBRARY_PATH, etc not defined in the environment.
Clean out environment completely (other than PATH of course ;-) and
see if the situation improves.

What does:
  
  $ ./xgcc -B./ -print-prog-name=cpp

say? Is it picking up cpp from gcc build directory?

Regards,
Mumit



More information about the Gcc-bugs mailing list