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]

Re: Not configuring linker correctly?


 > > From:	Brian McGovern [SMTP:bmcgover@cisco.com]
 > > Sent:	Thursday, May 25, 2000 1:30 PM
 > > To:	crossgcc@sourceware.cygnus.com
 > > Subject:	Not configuring linker correctly?
 > > 
 > > 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.
 > 	[Stephane Dalton]  you can have a more details by taking a look at
 > the config.log which you'll obviously find (because you have an error!) in
 > the directory where the configure scripts failed


config.log file:

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 sparc-sun-solaris2.5.1-ar
configure:672: checking for sparc-sun-solaris2.5.1-ranlib
configure:749: checking for gcc
configure:828: checking whether we are using GNU C
configure:837: /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/ -E conftest.c
configure:852: checking whether /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/ 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: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for sys/file.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for sys/param.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for stdlib.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for string.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for unistd.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for strings.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for sys/time.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1063: checking for sys/resource.h
configure:1073: /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/ -E  conftest.c >/dev/null 2>conftest.out
configure:1100: checking for sys/wait.h that is POSIX.1 compatible
configure:1121: /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/ -c -g -O2  conftest.c 1>&5
configure:1749: checking whether the C compiler (/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 ) works
configure:1765: /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/ -o conftest -g -O2   conftest.c  1>&5
/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
configure: failed program was:

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

main(){return(0);}


Pretty much looks the same.

 > > 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.
 > 	[Stephane Dalton]  its probably the linker script you're using has
 > an error, and when you don't give your own linker script to ld it uses the
 > specs file given by gcc installation you'll find this file in the gcc
 > directory of your gcc installation but just to make sure use:
 > 	/usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/
 > -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/  -v, this way gcc will
 > tell you which specs file you're using. In this spec file you'll find a
 > section about linking inside this section one of the line will contains a -T
 > directive with a filename just after. Find this file on your system and take
 > a look at it.

Ok. It was in /usr/tmp/cross/build/gcc, which is where I'm trying to build 
from. The link relevant lines I could find are:

*link:
%{h*} %{v:-V}    %{b} %{Wl,*:%*}    %{static:-dn -Bstatic}    %{shared:-G -dy %{!mimpure-text:-z text}}    %{symbolic:-Bsymbolic -G -dy -z text}    %{G:-G}    %{YP,*}    %{R*}    %{compat-bsd:      %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        %{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}}      -R /usr/ucblib}    %{!compat-bsd:      %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}}    %{Qy:} %{!Qn:-Qy}

*linker:
collect2

*link_command:
%{!fsyntax-only:  %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} 			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}			%{static:} %{L*} %D %o			%{!nostdlib:%{!nodefaultlibs:%G %L %G}}			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}			%{T*}			
 }}}}}}


The only file I seem to be able to find is the "collect2", which is a binary
in the gcc directory. Its a binary, so its not being too useful.

 > 
 > 	This should help a bit, I'm in the process of writing a howto and I
 > should publish it on this list very soon you might want to have a look at
 > it.
 > 

I'll be more than happy to take a look. I've been using the steps from
http://www.objsw.com/CrossGCC (Section 4), and that is how I've gotten myself
down this road.

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