public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Not configuring linker correctly?
@ 2000-05-25 10:30 Brian McGovern
  2000-05-25 11:46 ` Rich Pinkall-Pollei
  0 siblings, 1 reply; 3+ messages in thread
From: Brian McGovern @ 2000-05-25 10:30 UTC (permalink / raw)
  To: crossgcc

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Not configuring linker correctly?
  2000-05-25 10:30 Not configuring linker correctly? Brian McGovern
@ 2000-05-25 11:46 ` Rich Pinkall-Pollei
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Pinkall-Pollei @ 2000-05-25 11:46 UTC (permalink / raw)
  To: crossgcc

+-+-----------------------------------------------------------------+-+
|o|                                                                 |o|
|o|  > checking whether the C compiler                              |o|
|o|  > (/usr/tmp/cross/build/gcc/xgcc -B/usr/tmp/cross/build/gcc/   |o|
|o|  > -B/usr/local/cross/sparc/sparc-sun-solaris2.1.5/bin/ -g )    |o|
|o|  > works... no                                                  |o|
|o|  >                                                              |o|
|o|  > configure: error: installation or configuration problem: C   |o|
|o|  > compiler cannot create executables.                          |o|
|o|                                                                 |o|
+-+-----------------------------------------------------------------+-+

First a suggestion: it's easier to check the file `config.log' in the
directory in which the error is occurring than hand running the same
tests.

Assuming the errors you got were essentially the same as the log would
show, you should check a couple of things.  First, the target
`libc.so' should be checked (it's a C text file) that the `GROUP' call
points to the correct files.  If this isn't the problem, check that
any symbolic links in your libraries or headers are pointing
correctly.


Rich Pinkall-Pollei
---
Simulations are like miniskirts, they show a lot and hide the essentials.
		-- Hubert Kirrman



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Not configuring linker correctly?
       [not found] <C5B7AD50B789D31191B400805F9F52CB1FCAB3@exchange1.abl.ca>
@ 2000-05-25 11:31 ` Brian McGovern
  0 siblings, 0 replies; 3+ messages in thread
From: Brian McGovern @ 2000-05-25 11:31 UTC (permalink / raw)
  To: Stephane Dalton; +Cc: crossgcc

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-05-25 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-25 10:30 Not configuring linker correctly? Brian McGovern
2000-05-25 11:46 ` Rich Pinkall-Pollei
     [not found] <C5B7AD50B789D31191B400805F9F52CB1FCAB3@exchange1.abl.ca>
2000-05-25 11:31 ` Brian McGovern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).