EmbDev.net

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


von Vinit B. (vinitbidkar)


Rate this post
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?

von Vinit B. (vinitbidkar)


Rate this post
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?

von Martin T. (mthomas) (Moderator)


Rate this post
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.

von Vinit B. (vinitbidkar)


Rate this post
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.

von Clifford S. (clifford)


Rate this post
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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.