Newbie: ARM cross compiler GCC

F. Fennek fennek100@gmail.com
Mon Nov 23 11:21:00 GMT 2009


On Mon, Nov 23, 2009 at 12:07 PM, Andrew Haley <aph@redhat.com> wrote:
> F. Fennek wrote:
>
>> On Mon, Nov 23, 2009 at 11:44 AM, Andrew Haley <aph@redhat.com> wrote:
>>> F. Fennek wrote:
>>>
>>>> I am trying to build a cross compiler for a cortex M3 ARM target on a
>>>> Linux host.
>>>> And I have a rather basic question.
>>>> If I google on ARM toolchain I find a lot of help BUT most toolchain
>>>> builders are scripts and most of them use patches of some sort.
>>>> The scripts (or work flow) are mostly explained rather good but where
>>>> the used patches come from are never explained.
>>>> So my question is:
>>>> Do I need patches to build an ARM cross compiler when I use the GCC source code?
>>> It depends on your target OS.  When I build a ARM Linux cross-compiler, I use
>>> unpatched gcc sources.
>>>
>> I'm trying to use gcc for an embedded system (no OS, or maybe a simple RTOS).
>> Possibly I don't even want to use newlib or glibc, but that's a new
>> question I think. I make one step at a time.
>
> Well, that's going to be much harder.  You can't build a compliant C
> compiler without some kind of library, which is why people who want
> naked systems build a gcc for newlib.  There's no reason not to build
> a gcc that targets newlib, as you don't have to call newlib if you
> don't want to, and it makes building everything much easier.
>
> Andrew.
>
>
OK, thanks, that helped a lot. So as long as I don't call any newlib
functions in my embedded program my target resources will not be used,
right?
If that's the case I will build gcc for newlib, no problem.
That only leaves my first question, do I need a patch for a naked system?
Thanks, Robert.



More information about the Gcc-help mailing list