EmbDev.net

Forum: ARM programming with GCC/GNU tools library size limit ?


von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Hi all,

I'm about to use the cryptolib on an arm7 , but i got a strange problem
at link.

I have cross-compiled the library with sucess but a could not link with
it.

I put the .a in the same directory of the makefile.

here the link command.

arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -DVECTORS_IN_RAM -D__WinARM__  -Os -ffunction-sections
-fdata-sections -Wall -Wcast-align -Wimplicit  -Wpointer-arith -Wswitch
-Wredundant-decls -Wreturn-type -Wshadow -Wunused
-Wa,-adhlns=common/Cstartup.lst  -I./common -I../library/cryptoLib -MD
-MP -MF .dep/main.elf.d common/Cstartup.o common/swi_handler.o
common/Cstartup_SAM7.o dbgu.o syscalls.o swi_handler_user.o  main.o
--output main.elf -nostartfiles -Wl,-Map=main.map,--cref,--gc-sections
-lc  -lm -lc -lgcc  -lstdc++  -llibcryptopp
-T./common/AT91SAM7S64-ROM.ld

here the answer:

c:/program
files/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.ex 
e:
cannot find -llibcryptopp
collect2: ld returned 1 exit status
arm_make: *** [main.elf] Error 1

I try the -llibcryptopp.a and it cannot be found ethier.

The library is 60megs in size.

regards

Jonathan

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Never mind, I will probably gave up on this library since this use many
templating aspect of CPP and I think the libstd++ is not build with this
support ?

Jonathan

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:
>
> Never mind, I will probably gave up on this library since this use many
> templating aspect of CPP and I think the libstd++ is not build with this
> support ?
>
> Jonathan

I found that i need to use the exception to be able to use this library.
Is ther a problem using exeption in the libstd++ ?

Right now, I have put all the cpp file in my makefile and try to compile
it directly instead of using .a files.

from now it build with some warning about cast but i will try figureout
the problem.

Regards

Jonathan

von Kees S. (kees)


Rate this post
useful
not useful
Hi Jonathan

I don't if you still want to use the crypt library or not, but anyway
let me give you a suggestion as to what can be the problem.

Normally the name of a library has to start with lib and has to have an
extension of .a Hence the gcc library itself is named libgcc.a To add
this library to your own object files, you have to specify the name
without the 'lib' and without the '.a'. So again in case of libgcc.a,
you have to specify -lgcc So in case of the cryptopp library, I think
that you should specify -lcryptopp (so without the lib part) This is, if
the library is called libcryptopp.a

Hope this helps,
KS




> Jonathan Dumaresq wrote:
>>
>> Never mind, I will probably gave up on this library since this use many
>> templating aspect of CPP and I think the libstd++ is not build with this
>> support ?
>>
>> Jonathan
>
> I found that i need to use the exception to be able to use this library.
> Is ther a problem using exeption in the libstd++ ?
>
> Right now, I have put all the cpp file in my makefile and try to compile
> it directly instead of using .a files.
>
> from now it build with some warning about cast but i will try figureout
> the problem.
>
> Regards
>
> Jonathan

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Kees Stoop wrote:
> Hi Jonathan
>
> Normally the name of a library has to start with lib and has to have an
> extension of .a Hence the gcc library itself is named libgcc.a To add
> this library to your own object files, you have to specify the name
> without the 'lib' and without the '.a'. So again in case of libgcc.a,
> you have to specify -lgcc So in case of the cryptopp library, I think
> that you should specify -lcryptopp (so without the lib part) This is, if
> the library is called libcryptopp.a

Thats explain alot !!!

This is probably why this don't work. I will try it.

regards
Jonathan

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:
> Kees Stoop wrote:
>> Hi Jonathan
>>
>> Normally the name of a library has to start with lib and has to have an
>> extension of .a Hence the gcc library itself is named libgcc.a To add
>> this library to your own object files, you have to specify the name
>> without the 'lib' and without the '.a'. So again in case of libgcc.a,
>> you have to specify -lgcc So in case of the cryptopp library, I think
>> that you should specify -lcryptopp (so without the lib part) This is, if
>> the library is called libcryptopp.a
>
> Thats explain alot !!!
>
> This is probably why this don't work. I will try it.
>
> regards
> Jonathan

Thats fix this error.

Now well see if i can use this lib on 250K Flash parts !

Jonathan

von Clifford S. (clifford)


Rate this post
useful
not useful
> The library is 60megs in size.

A library (or archive - hence the .a extension) is a collection of
separately compiled compiled object code in a single file. The linker
only extracts and links those object files that are needed to resolve
the references in your code. So it is   not likely that your code will
be anywhere close to this size. The object code may also contain large
amounts of symbolic information (for linkage and debug) that does not
ultimately end up in the binary. This information can be quite large if
there are many symbols and long identifier names.

Clifford

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Clifford Slocombe wrote:
>> The library is 60megs in size.
>
> A library (or archive - hence the .a extension) is a collection of
> separately compiled compiled object code in a single file. The linker
> only extracts and links those object files that are needed to resolve
> the references in your code. So it is   not likely that your code will
> be anywhere close to this size. The object code may also contain large
> amounts of symbolic information (for linkage and debug) that does not
> ultimately end up in the binary. This information can be quite large if
> there are many symbols and long identifier names.
>
> Clifford

Yeah i know this. I have just use 1 function that i need of this library
and the code goes to 500K. SO this library is not possible to use on
small device like SAM7S parts.

So I will try to find another solution.

Thanx for the info !

Jonathan

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.