gcc interwork init code

OP #1174604
I'm just now working on converting some of my SAM7X code over to C++,
taking cues from the popular "Building Bare Metal Systems" series of
articles.  I have the C++ runtime in decent shape and most things seem
to be working as expected.

My problem is that the libc.a that my project links against is

/usr/local/arm/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/inte 
rwork/libc.a

and that version of libc.a does not have init.o included.  The function
I'm ultimately trying to get at is __libc_init_array to initialize
static constructors.  The example projects from the Bare Metal series
show the equivalent of

/usr/local/arm/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/libc 
.a

being linked in, which in my toolchain does include init.o and the
symbol for __libc_init_array, but I can't quite figure out how to
specify that.

My project is based on the FreeRTOS, originally from the SAM7X256 lwIP
demo which has a makefile very similar to Martin's.  I'm using the
toolchain compiled by Darrik Spaude for OS X intel - the latest version
he has there is 4.2.2.

Should the interwork version of libc.a include this?  Is some other
aspect of my configuration screwy?  Thanks for any tips!
#1174605
Hi,

Did any one solve this problem ?
I am facing the same problem  when porting the "Building Bare Metal
Systems"  C++ example to SAM7X ARM.

Regards,

Shachar Harussi

Liam Staskawicz wrote:
> I'm just now working on converting some of my SAM7X code over to C++,
> taking cues from the popular "Building Bare Metal Systems" series of
> articles.  I have the C++ runtime in decent shape and most things seem
> to be working as expected.
>
> My problem is that the libc.a that my project links against is
>
> /usr/local/arm/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/inte 
rwork/libc.a
>
> and that version of libc.a does not have init.o included.  The function
> I'm ultimately trying to get at is __libc_init_array to initialize
> static constructors.  The example projects from the Bare Metal series
> show the equivalent of
>
> /usr/local/arm/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/libc .a
>
> being linked in, which in my toolchain does include init.o and the
> symbol for __libc_init_array, but I can't quite figure out how to
> specify that.
>
> My project is based on the FreeRTOS, originally from the SAM7X256 lwIP
> demo which has a makefile very similar to Martin's.  I'm using the
> toolchain compiled by Darrik Spaude for OS X intel - the latest version
> he has there is 4.2.2.
>
> Should the interwork version of libc.a include this?  Is some other
> aspect of my configuration screwy?  Thanks for any tips!

Reply

A question of your own? This thread is over 17 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.