From: Andrew Haley <aph@redhat.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Link error
Date: Thu, 12 Aug 2010 10:18:00 -0000 [thread overview]
Message-ID: <4C63CA77.5070701@redhat.com> (raw)
In-Reply-To: <AANLkTiniPnQ-ioijpQXhMC1ygSqNSZsEGW2O-OVS5Qa8@mail.gmail.com>
On 08/09/2010 02:59 PM, Phung Nguyen wrote:
> Dear all,
>
> I am trying to build cross compiler for xc16x. I built successfully
> binutils 2.18; gcc 4.0 and newlib 1.18. Everything is fine when
> compiling a simple C file without any library call. It is also fine
> when making a simple call to printf like printf("Hello world").
> However, i got error message from linker when call printf("i=%i",i);
> The error message is as follows
>
> /home/guest/xc16x/lib/gcc/xc16x-elf/lib/xc16xl/libc.a(lib_a-sbrkr.o):
> In function _sbrk_r:
> /home/guest/newlib-1.18.0/newlib/libc/reent/sbrkr.c:60: undefined
> reference to __sbrk
> /home/guest/fromKpit/newlib-1.18.0/newlib/libc/reent/sbrkr.c:60:
> undefined reference to __sbrk
> ....
>
> collect2: ld returned 1 exit status
> make: *** [bubble.out] Error 1
>
>
> Is there any idea how to solve the problem? I highly appreciate any help.
You have to provide sbrk.
See http://sca.uwaterloo.ca/coldfire/gcc-doc/docs/porting_3.html
Andrew.
next parent reply other threads:[~2010-08-12 10:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTiniPnQ-ioijpQXhMC1ygSqNSZsEGW2O-OVS5Qa8@mail.gmail.com>
2010-08-12 10:18 ` Andrew Haley [this message]
2010-08-23 20:33 ` Fwd: " Phung Nguyen
2009-04-01 13:23 link error Duan Wang
2009-04-01 13:42 ` Axel Freyn
-- strict thread matches above, loose matches on Subject: below --
2008-08-15 20:39 Link error Vardhan, Sundara (GE Infra, Energy)
2008-07-24 21:03 Vardhan, Sundara (GE Infra, Energy)
2008-07-24 23:55 ` Rob Sherry
2008-07-25 13:32 ` Vardhan, Sundara (GE Infra, Energy)
2008-07-28 11:41 ` Andrew Haley
2008-07-28 12:14 ` Vardhan, Sundara (GE Infra, Energy)
2008-07-28 13:26 ` Andrew Haley
2008-07-29 8:56 ` Ralf Wildenhues
2008-07-29 11:49 ` Andrew Haley
2008-07-29 13:43 ` Vardhan, Sundara (GE Infra, Energy)
2008-07-24 10:04 Vardhan, Sundara (GE Infra, Energy)
2005-10-21 20:22 link error Moon Hwang
2005-10-21 23:08 ` Brian Dessent
2002-10-17 8:11 Link error HKOELMAN
2002-08-13 6:54 Link Error Tom Browder
2002-08-13 7:16 ` Ish Rattan
2002-08-13 7:30 ` Tom Browder
2002-08-13 7:59 ` Ish Rattan
2001-06-05 14:22 link error Alex Fridman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C63CA77.5070701@redhat.com \
--to=aph@redhat.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).