This is the mail archive of the crossgcc@sourceware.cygnus.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]

Not configuring linker correctly?


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 <stdio.h>
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


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