From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian McGovern To: crossgcc@sourceware.cygnus.com Subject: Not configuring linker correctly? Date: Thu, 25 May 2000 10:30:00 -0000 Message-id: <200005251730.NAA52009@bmcgover-pc.cisco.com> X-SW-Source: 2000-q2/msg00186.html I've been trying for the past couple of days to cross-compile a Sparc version of gcc/tools on a FreeBSD system. While a number of things have gone right, I'm getting hung up on one error that I can't seem to fix on my own. I'm not on the list, so please at least cc me when you reply. The problem manifests itself when I'm compiling gcc. Below is the last 20 or so lines of the output. checking for gcc... /usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ checking whether we are using GNU C... yes checking whether /usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ accepts -g... yes checking for POSIXized ISC... no checking for a BSD compatible install... /usr/bin/install -c checking how to run the C preprocessor... /usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ -E checking for sys/file.h... yes checking for sys/param.h... yes checking for stdlib.h... yes checking for string.h... yes checking for unistd.h... yes checking for strings.h... yes checking for sys/time.h... yes checking for sys/resource.h... yes checking for sys/wait.h that is POSIX.1 compatible... yes checking whether the C compiler (/usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ -g ) works... no configure: error: installation or configuration problem: C compiler cannot create executables. *** Error code 1 Stop. I figured that in order to narrow down the problem, I'd try running the command by hand, and got: bash-2.03# /usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ -g xgcc: No input files Ok. Fair enough. Lets give it one. bash-2.03# cat > hello.c #include void main(void) { } And run it again.... bash-2.03# /usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ -g -o hello hello.c hello.c: In function `main': hello.c:3: warning: return type of `main' is not `int' /usr/tmp/cross/build/gcc/collect-ld:built in linker script:1: parse error collect2: ld returned 1 exit status Ok. The warning makes sense. However, it looks like its ld thats barfing. Doing a which ld, I found it was trying to use the system (FreeBSD) linker. So, I added the path to the bintuils I had installed already, and reran it. This time, I got: /usr/tmp/cross/gcc-2.95.2/gcc/xgcc -B/usr/tmp/cross/gcc-2.95.2/gcc/ -B/usr/local/cross/sparc/sparc-sun-solaris2.5.1/bin/ -g -O2 -o hello hello.c /usr/local/cross/sparc/sparc-sun-solaris2.5.1/bin/ld: cannot open values-Xa.o: No such file or directory collect2: ld returned 1 exit status I did not find the file values-Xa.o anywhere on the disk. At this point, I'm completley confused. My configure line is as follows: prefix=/usr/local/cross/sparc target=sparc-sun-solaris2.5.1 i=$prefix/bin configure --target=$target --prefix=$prefix \ --with-headers="/usr/tmp/cross/include" \ --with-libs="/usr/tmp/cross/lib" \ --enable-threads --with-gnu-ld --with-gnu-as -v Any hints would be valuable. A clue as to what I'm doing wrong would be a plus, as I'll have to do the same for HP/UX and AIX once this is working... -Brian ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com