how to reduce the library file size

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to reduce the library file size

跳至解决方案
1,047 次查看
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 项奖励
1 解答
876 次查看
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 项奖励
2 回复数
877 次查看
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 项奖励
876 次查看
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 项奖励