public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@wippies.com>
To: gcc-help@gcc.gnu.org
Subject: Re: An error on building the GCC tic6x cross compiler
Date: Fri, 12 Oct 2012 18:02:00 -0000	[thread overview]
Message-ID: <50786069.8040502@wippies.com> (raw)
In-Reply-To: <50781247.80907@wippies.com>

Kai Ruottu wrote:
> 12.10.2012 10:47, m9802119 kirjoitti:
>> hello:
>>
>> I tried to build tic6x cross compiler in recent days, but always fail.
>>
>> after installation, I haved compile the .c file. Then the error occur. The message as shown in below:
>>
>> $ tic6x-elf-gcc helloworld.c 
>> /usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000008100
>> /usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
>> /home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58: undefined reference to `sbrk'
>> Every thing is OK when I build arm cross compiler and compile the .c or .cpp files.
>> Can you tell me what happen and how to solve it ?
>>
> 
> You should learn what a "real target" is and how to link apps for it,
> what are start files, 'crt*.o', what
> low-level routines for the hardware, linker scripts etc...

The 'arm-elf' or 'arm-eabi' (expected) case used to have a default "real target",
some ARM-CPU board with a default monitor firmware on it and when linking using
low-level routines (read(), write(),...) using the monitor firmware to interface
the hardware system.

But the tic6x-elf seems to belong to the "unreal elves" category meaning that
it has no TI C6X CPU-board with some firmware or operating system as the default
target system.  So you MUST know what you have and use the right linker script
(and it using the right glue library) for it - if that linker script is provided
with newlib-1.20.0 !


  reply	other threads:[~2012-10-12 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12  7:47 m9802119
2012-10-12 12:51 ` Kai Ruottu
2012-10-12 18:02   ` Kai Ruottu [this message]
2012-10-13  3:57 WJ Wang
2012-10-13 22:46 ` WJ Wang
2012-10-14 11:37 ` WJ Wang

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=50786069.8040502@wippies.com \
    --to=kai.ruottu@wippies.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).