how to reduce the library file size

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to reduce the library file size

Jump to solution
1,006 Views
u2bpavankumar
Contributor I

Hi all,

 

I am using code warriors to build ARM object library. The code is getting compiled successfully and the static library (.a extension) is generated. But the size of the generated library is coming close to 900KB. When the same code is compiled using GNU tool chain on linux the library file size is coming close to 100 KB. Please let me know if there are any compiler options by using which the generated library file size can be reduced.

 

Thanks in advance

 

Regards,

Pavan

0 Kudos
1 Solution
835 Views
CompilerGuru
NXP Employee
NXP Employee

Could it be that the CW built lib contains debug info and the linux built one does not?

 

Anyhow, the file size of a static library does not tipically matter at all, at least in the usual case when the library is only used on the host for cross compilation.

 

 

View solution in original post

0 Kudos
2 Replies
836 Views
CompilerGuru
NXP Employee
NXP Employee

Could it be that the CW built lib contains debug info and the linux built one does not?

 

Anyhow, the file size of a static library does not tipically matter at all, at least in the usual case when the library is only used on the host for cross compilation.

 

 

0 Kudos
835 Views
J2MEJediMaster
Specialist I

In the build settings for the project, check the settings for the linker input. Is the Dead-strip Unused Code option checked?

 

Also, you may want to disable the generation of debug information, which can add the the file size. You would do that only after you have the code debugged, of course.

 

---Tom

0 Kudos