EmbDev.net

Forum: ARM programming with GCC/GNU tools arm-elf-ld and default paths for library search


Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 useful
not useful
1) Do i need to provide the arm-elf-ld with default paths for finding
libraries libc.a, libma.a and libgcc.a ?
2) If yes, which option should be used to make the arm-elf-ld search the
path to find these libraries?

Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 useful
not useful
Vinit Bidkar wrote:
> 1) Do i need to provide the arm-elf-ld with default paths for finding
> libraries libc.a, libma.a and libgcc.a ?
> 2) If yes, which option should be used to make the arm-elf-ld search the
> path to find these libraries?

Environment details (Yagarto):

make:                3.18
binutils:            2.18
arm-elf-gcc:         4.2.2
newlib:              1.16.0
gdb:                 6.8.50-20080308-cvs

Is there any way by which i can include the libc.a, libm.a and libgcc.a
from the default (Yagarto) locations?

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Vinit Bidkar wrote:
> Vinit Bidkar wrote:
>> 1) Do i need to provide the arm-elf-ld with default paths for finding
>> libraries libc.a, libma.a and libgcc.a ?
>> 2) If yes, which option should be used to make the arm-elf-ld search the
>> path to find these libraries?
>
> Environment details (Yagarto):
>
> make:                3.18
> binutils:            2.18
> arm-elf-gcc:         4.2.2
> newlib:              1.16.0
> gdb:                 6.8.50-20080308-cvs
>
> Is there any way by which i can include the libc.a, libm.a and libgcc.a
> from the default (Yagarto) locations?

Yes, don't use arm-elf-ld directly but link with the compiler-frontend
(arm-elf-gcc). You may look into a makefile from one of my examples on
www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects to see how this can
be done.

Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Vinit Bidkar wrote:
>> Vinit Bidkar wrote:
>>> 1) Do i need to provide the arm-elf-ld with default paths for finding
>>> libraries libc.a, libma.a and libgcc.a ?
>>> 2) If yes, which option should be used to make the arm-elf-ld search the
>>> path to find these libraries?
>>
>> Environment details (Yagarto):
>>
>> make:                3.18
>> binutils:            2.18
>> arm-elf-gcc:         4.2.2
>> newlib:              1.16.0
>> gdb:                 6.8.50-20080308-cvs
>>
>> Is there any way by which i can include the libc.a, libm.a and libgcc.a
>> from the default (Yagarto) locations?
>
> Yes, don't use arm-elf-ld directly but link with the compiler-frontend

Thnak you Martin Thomas.
It helped, but i had to use -Xlinker option as -Wl giving errors.

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Yes, don't use arm-elf-ld directly but link with the compiler-frontend

Personally I prefer to use the linker directly, but the advantage of
using the compiler to drive the linker is that it sets the default
library paths according to the architecture options, whereas when you
invoke the linker you have to select the appropriate libraries yourself.

Whether you choose to invoke the linker directly or not explicit paths
may be set with -L<path> options. Moreover you can specify -nostlibs and
be responsible for specifying your own libraries with -l<libname>
options. This is useful perhaps if you need a custom library build - as
I did to support the VFP math co-processor not yet in the standard
build.

Mostly however, do what Martin suggested, since it is harder to get it
wrong. :-)

Clifford

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]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.