public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Linker problem?
@ 2000-10-05  5:55 Torbjørn Heltne
  2000-10-05 21:37 ` Noah Aklilu
  2000-10-29 15:05 ` Jonathan Larmour
  0 siblings, 2 replies; 3+ messages in thread
From: Torbjørn Heltne @ 2000-10-05  5:55 UTC (permalink / raw)
  To: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

Hello list members!

I'm pretty new to this... but I have followed the instructions on
http://sources.redhat.com/ecos/tools/linux-arm-elf.html to install,
configure and build the arm-elf-gcc and friends. 

It went pretty smooth except that I had to use LANGUAGES="c" under "Build
and install GCC". Don't think that causes my problem though... :-)

Anyway: trying to build the well-known "hello, world!" I bump into a
problem. Seen this one before, anyone?

[etotorh@eto00840 ]$ make
arm-elf-gcc -O2   -c -o hello.o hello.c
arm-elf-gcc -o hello.elf startup.o syscalls.o hello.o -nostartfiles \
  -Wl,-Ttext,0,-Tdata,0x300000
/tools/H-i686-pc-linux-gnu/arm-elf/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
[etotorh@eto00840 ]$

What's this "-lc" that the linker can't find?

-- 
Torbjørn Heltne


------
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: Linker problem?
  2000-10-05  5:55 Linker problem? Torbjørn Heltne
@ 2000-10-05 21:37 ` Noah Aklilu
  2000-10-29 15:05 ` Jonathan Larmour
  1 sibling, 0 replies; 3+ messages in thread
From: Noah Aklilu @ 2000-10-05 21:37 UTC (permalink / raw)
  To: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]

-lc is the option that tells the linker to tie in the libc (or newlib)
library.  You are probably using printf which is in this library.  Your
linker doesn't know where to find your libc.a archive, so you will
have to give it a -L option to let it know what the library path is.

This is assuming that you installed newlib (it is separate from gcc),
if you haven't that is your problem.

Noah.

On 5 Oct 2000, at 14:55, Torbjørn Heltne wrote:

> Hello list members!
>
> I'm pretty new to this... but I have followed the instructions on
> http://sources.redhat.com/ecos/tools/linux-arm-elf.html to install,
> configure and build the arm-elf-gcc and friends.
>
> It went pretty smooth except that I had to use LANGUAGES="c" under "Build
> and install GCC". Don't think that causes my problem though... :-)
>
> Anyway: trying to build the well-known "hello, world!" I bump into a
> problem. Seen this one before, anyone?
>
> [etotorh@eto00840 ]$ make
> arm-elf-gcc -O2   -c -o hello.o hello.c
> arm-elf-gcc -o hello.elf startup.o syscalls.o hello.o -nostartfiles \
>   -Wl,-Ttext,0,-Tdata,0x300000
> /tools/H-i686-pc-linux-gnu/arm-elf/bin/ld: cannot find -lc
> collect2: ld returned 1 exit status
> make: *** [hello.elf] Error 1
> [etotorh@eto00840 ]$
>
> What's this "-lc" that the linker can't find?
>
> --
> Torbjørn Heltne
>
>
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



------------------------------------------
Noah Aklilu
http://www.ee.ualberta.ca/~aklilu/
naklilu@ualberta.ca

------
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: Linker problem?
  2000-10-05  5:55 Linker problem? Torbjørn Heltne
  2000-10-05 21:37 ` Noah Aklilu
@ 2000-10-29 15:05 ` Jonathan Larmour
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2000-10-29 15:05 UTC (permalink / raw)
  To: Torbjørn Heltne; +Cc: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1881 bytes --]

Torbjørn Heltne wrote:
> 
> Hello list members!
> 
> I'm pretty new to this... but I have followed the instructions on
> http://sources.redhat.com/ecos/tools/linux-arm-elf.html to install,
> configure and build the arm-elf-gcc and friends.

These instructions describe how to be build an ARM compiler solely for the
purposes of eCos. This means that what you get out of it is not a general
purpose C compiler, and in particular does not contain a C library or any
startup code.

> It went pretty smooth except that I had to use LANGUAGES="c" under "Build
> and install GCC". Don't think that causes my problem though... :-)

We haven't heard any problems with LANGUAGES="c c++" before.
 
> Anyway: trying to build the well-known "hello, world!" I bump into a
> problem. Seen this one before, anyone?
> 
> [etotorh@eto00840 ]$ make
> arm-elf-gcc -O2   -c -o hello.o hello.c
> arm-elf-gcc -o hello.elf startup.o syscalls.o hello.o -nostartfiles \
>   -Wl,-Ttext,0,-Tdata,0x300000
> /tools/H-i686-pc-linux-gnu/arm-elf/bin/ld: cannot find -lc
> collect2: ld returned 1 exit status
> make: *** [hello.elf] Error 1
> [etotorh@eto00840 ]$
> 
> What's this "-lc" that the linker can't find?

You need to follow the instructions in the eCos Getting Started manual
(available on-line at http://sources.redhat.com/ecos ). If you have
followed the instructions for building a compiler for eCos, the above
compiler commands are not appropriate - you have to use the include files
and linker scripts from a built eCos configuration.

Sorry this was a bit late. HTH,

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

------
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-10-29 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-05  5:55 Linker problem? Torbjørn Heltne
2000-10-05 21:37 ` Noah Aklilu
2000-10-29 15:05 ` Jonathan Larmour

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