# Forum: ARM programming with GCC/GNU tools gcc interwork init code

 Author: Liam Staskawicz (liamstask) Posted on: 2008-11-21 21:21

Rate this post
 0 ▲ useful ▼ not useful
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!

 Author: Shachar Shachar (shachar) Posted on: 2008-12-25 09:40

Rate this post
 0 ▲ useful ▼ not useful
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

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

### Rules — please read before posting

• Post long source code as attachment, not in the text
• Posting advertisements is forbidden.

### Formatting options

• [c]C code[/c]
• [avrasm]AVR assembler code[/avrasm]
• [code]code in other languages, ASCII drawings[/code]
• $formula (LaTeX syntax)$
 Name: E-mail address (not visible): Subject: Searching for similar topics... Attachment: Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one. Text: