public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Dalas Yoo <dalasyoo@gmail.com>, newlib@sourceware.org
Subject: Re: cannot find crt0.o file
Date: Fri, 8 Apr 2022 15:05:41 +0100	[thread overview]
Message-ID: <dbf45860-4977-1eb0-9fc2-145e00c71501@foss.arm.com> (raw)
In-Reply-To: <CALb-SNqjk7Ts3hr3jXNDOnqZBfcMQBp1AbbhT_BDRUXe6OGxxA@mail.gmail.com>



On 25/03/2022 10:30, Dalas Yoo wrote:
> Hello, I tried to build a newlib for cross-compile toolchain.
> 
> I configured it as below.
> 
> ../newlib/configure --disable-newlib-io-float
> --disable-newlib-supplied-syscalls --target=arm-none-eabi
> 
> With the configuration, the newlib was successfully built. But when trying
> to compile and link the program, the arm-none-eabi-gcc prints error "crt0.o
> not found".
> When searching the newlib lib directory, crt0.o file is not found though
> other types of crt0.o are found such as rdimon-crt0.o.
> 
> If the arm-none-eabi-gcc gets applied with --specs=rdimon.specs options, it
> compiles the program fine.
> But if the newlib is configured without --disable-newlib-supplied-syscalls,
> it normally generates crt0.o.
> 
> Would there be any suggestions on this case?
> Thanks,
> Dalas

Newlib is constructed in a way that allows significant customization for 
different boards.  Most of that customization lives in libgloss (if you 
build newlib with the embedded syscalls then you lose all that ability 
to customize for your own platform).

When you target the 'bare metal' for a specific board you will likely 
need to do your own customization and provide your own startup code to 
handle the very first few operations of your program.  The code in 
libgloss can then act as a guide for what you need to do.  In particular 
you will likely need to write a customized gcc driver script.  Some 
examples come with libgloss, such as rdimon.specs which is a 
customization for using newlib with Arm's semihosting protocol.  There 
are other examples, such as one using redboot as well.

R.

      parent reply	other threads:[~2022-04-08 14:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 10:30 Dalas Yoo
2022-03-25 10:58 ` R. Diez
2022-03-25 12:10   ` Dalas Yoo
2022-04-08 14:05 ` Richard Earnshaw [this message]

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=dbf45860-4977-1eb0-9fc2-145e00c71501@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=dalasyoo@gmail.com \
    --cc=newlib@sourceware.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).