This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

i686-pc-cygwin to mips64orion-elf cross compiler


I've been attempting to build a i686-pc-cygwin to mips64orion-elf cross
compiler with cygwin 1.1.4 installed.  I have run into a series of issues
along the way, and I am still stuck at this point.

I originally attempted to build the cross compiler using the following
cygwin tree components from 1.1.4:
  binutils-20000722-1
  gcc-2.95.2-2.

The parameters I used with configure for binutils and gcc are:
--host=i686-pc-cygwin --target=mips64orion-elf --prefix=/gcc-mips --with
gnu-ld --with-gnu-as -v

I built binutils with: make all install.  There were no errors.
I then put $prefix/bin in $PATH so gcc could find the target specific
utilities.

I then built gcc with: make all LANGUAGES="C C++" install.

The first problem I had was a prototype conflict for make_temp_file():

gcc -c -DCROSS_COMPILE -DIN_GCC     -g -O2  -DHAVE_CONFIG_H    -I. -I../../g
cc-2.95.2-2/gcc -I../../gcc-2.95.2-2/gcc/config -I../../gcc-2.95.2-2/gcc/../
include../../gcc-2.95.2-2/gcc/config/mips/mips.c
../../gcc-2.95.2-2/gcc/config/mips/mips.c:96: conflicting types for
`make_temp_file'
../../gcc-2.95.2-2/gcc/../include/libiberty.h:69: previous declaration of
`make_temp_file'
make[1]: *** [mips.o] Error 1
make[1]: Leaving directory `/cygdrive/d/gnu/build-gcc-2.95.2-2/gcc'
make: *** [all-gcc] Error 2

I commented out the offending prototype in
gcc-2.95.2-2/gcc/../include/libiberty.h:69 since its return type was
different than the rest of the mips routines.

The second make gcc make attempt produced the following error:

Testing libgcc1.  Ignore linker warning messages.
/cygdrive/d/gnu/build-gcc-2.95.2-2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95
.2-2/gcc/ -B/gcc-mips-cygwin/mips64orion-elf/bin/ -I/gcc-mips-cygwin/mips64o
rion-elf/include -DCROSS_COMPILE -DIN_GCC     -g -O2 -I./include
libgcc1-test.o -o libg
cc1-test \
  -nostartfiles -nostdlib
`/cygdrive/d/gnu/build-gcc-2.95.2-2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.9
5.2-2/gcc/ -B/gcc-mips-cygwin/mips64orion-elf/bin/ -I/gcc-mips-cygwin/mips64
orion-elf/include --print-libgcc-file-name`
collect2: ld terminated with signal 11 [Segmentation fault]
      0 [main] ld 8214 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
  16956 [main] ld 8214 stackdump: Dumping stack trace to ld.exe.stackdump
make[1]: *** [libgcc1-test] Error 1
make[1]: Leaving directory `/cygdrive/d/gnu/build-gcc-2.95.2-2/gcc'
make: *** [all-gcc] Error 2

Here's the contents of the stack trace file:
Exception: STATUS_ACCESS_VIOLATION at eip=0045B901
eax=00000002 ebx=00000000 ecx=00000000 edx=00000000 esi=00000000
edi=00000001
ebp=0259F800 esp=0259FAB8
program=D:\cygwin\gcc-mips-cygwin\mips64orion-elf\bin\ld.exe
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0259F800  0045B901  (00000000, 00000000, 00000000, 00000000)
0259FB20  0045B901  (0A060588, 004914AC, 0A060CD8, 0A061D30)
0259FC80  0043E508  (0A060588, 004914AC, 0259FCE0, 00000000)
0259FCA0  0043BDAA  (0A060588, 004914AC, 0259FCDC, 6102285E)
0259FCE0  004135A3  (0A052B00, 0259FD28, 0259FD30, 00413FFA)
0259FD30  00414004  (0A052A60, 00000000, 0259FD70, 00417ACE)
0259FD70  00417AE8  (0A0529D8, 0A051CA8, 00000000, 6103EF38)
0259FDA0  0041ADF4  (00000008, 0A0529D8, 0A051CA8, 61002241)
0259FF10  61002272  (FFFFFFFF, 00000000, 77F763D3, 77F763DB)
0259FF70  61002805  (0041A758, 00000000, 0259FFA0, 0048C89D)
0259FF80  61002843  (00000000, 00000000, 00000000, 00000000)
0259FFA0  0048C89D  (0041A758, 81491460, 81491300, 77F1B9E7)
0259FFC0  00401035  (00000000, 00000000, 7FFDF000, 7FFDF000)
0259FFF0  77F1B9EA  (00401000, 00000000, 000000B0, 00000100)
End of stack trace

I gave up at this point with this setup but would like some direction, if
there is somewhere I can go with this.  It looks to me like the linker is
hosed for mips.

I decided to attempt to build a cross compiler from a non-cygnus tree.

I used binutils-2.10 and gcc-2.95.2 this time and use the same configuration
options (after wiping out the previous attempt of course).  I built binutils
without a hitch and the build of gcc did not require the header file
modification.  But, this time I got the following while building gcc:

make[2]: Leaving directory
`/cygdrive/d/gnu/build-gcc-2.95.2/mips64orion-elf/lib
io'
cd ../libiberty ; make "SHELL=/bin/sh" "INSTALL=/bin/sh
/cygdrive/d/gnu/gcc-2.95.2/install-sh -c" "INSTALL_DATA=/bin/sh
/cygdrive/d/gnu/gcc-2.95.2/install-sh -c -m 644" "INSTALL_PROGRAM=/bin/sh
/cygdrive/d/gnu/gcc-2.95.2/install-sh -c " "prefix=/gcc-mips"
"exec_prefix=/gcc-mips" "tooldir=/gcc-mips/mips64orion-elf"
"gxx_include_dir=/gcc-mips/include/g++-3"
"libsubdir=/gcc-mips/lib/gcc-lib/mips64orion-elf/2.95.2"
"gcc_version=2.95.2"
"gcc_version_trigger=/cygdrive/d/gnu/gcc-2.95.2/gcc/version.c"
"AR=mips64orion-elf-ar" "AR_FLAGS=rc"
"CC=/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.
95.2/gcc/ -B/gcc-mips/mips64orion-elf/bin/"
"CXX=/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2
.95.2/gcc/ -B/gcc-mips/mips64orion-elf/bin/" "CFLAGS=-g -O2"
"CXXFLAGS=-g -O2" "NM=mips64orion-elf-nm" "RANLIB=mips64orion-elf-ranlib"
"LIBCFLAGS=-g -O2" "LIBCXXFLAGS=-g -O2 -fno-implicit-templates" "LOADLIBES="
"LDFLAGS="
"MAKEINFO=/cygdrive/d/gnu/build-gcc-2.95.2/texinfo/makeinfo/makeinfo "
"SHLIB=libstdc++.so.2.10.0" "SHCURSES=" "RUNTESTFLAGS="
make[2]: Entering directory
`/cygdrive/d/gnu/build-gcc-2.95.2/mips64orion-elf/libiberty'
make[2]: *** No targets specified and no makefile found.  Stop.
make[2]: Leaving directory
`/cygdrive/d/gnu/build-gcc-2.95.2/mips64orion-elf/libiberty'
make[1]: *** [../libiberty/libiberty.a] Error 2
make[1]: Leaving directory
`/cygdrive/d/gnu/build-gcc-2.95.2/mips64orion-elf/libstdc++'
make: *** [all-target-libstdc++] Error 2

Here is the contents of config.log from
`/cygdrive/d/gnu/build-gcc-2.95.2/mips64orion-elf/libiberty':
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:591: checking host system type
configure:614: checking build system type
configure:640: checking for mips64orion-elf-ar
configure:672: checking for mips64orion-elf-ranlib
configure:749: checking for gcc
configure:828: checking whether we are using GNU C
configure:837:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E conftest.c
configure:852: checking whether
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ accepts -g
configure:881: checking for POSIXized ISC
configure:919: checking for a BSD compatible install
configure:980: checking how to run the C preprocessor
configure:1001:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for sys/file.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for sys/param.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for stdlib.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for string.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for unistd.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for strings.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for sys/time.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1063: checking for sys/resource.h
configure:1073:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -E  conftest.c >/dev/null
2>conftest.out
configure:1100: checking for sys/wait.h that is POSIX.1 compatible
configure:1121:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -c -g -O2  conftest.c 1>&5
configure:1749: checking whether the C compiler
(/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.
2/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -g -O2 ) works
configure:1765:
/cygdrive/d/gnu/build-gcc-2.95.2/gcc/xgcc -B/cygdrive/d/gnu/build-gcc-2.95.2
/gcc/ -B/gcc-mips/mips64orion-elf/bin/ -o conftest -g -O2   conftest.c  1>&5
/gcc-mips/mips64orion-elf/bin/ld: cannot open crt0.o: No such file or
directory
collect2: ld returned 1 exit status
configure: failed program was:

#line 1760 "configure"
#include "confdefs.h"

main(){return(0);}

It looks like to me that I need crt0.o for ld to work correctly.  So, how do
I create this file and does it have to be made for the host or the target?
It is not addresses in the crossgcc FAQ.

One last thing...  I was assuming that I did not need to build a native
toolchain with the non-cygnus tree before I built the cross compiler.  Is
this a correct assumption?  I read the entire crossgcc FAQ and did not see
an answer to this question.

Any help would be greatly appreciated.

Thanks,

Jeff Domogala


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]