开发者

Same sources but compiled binary different

Hi I develop C/C++ for VxWorks on WinXP using ccarm compiler. And I would like to add a hot fix for on t开发者_如何转开发op of a released delivery which was build long time ago. Sources are kept on Clear Case and every delivery is labeled. So it's possible to access the source codes of a certain delivery.

In order to be sure of nothing is changed from the original released version I must make sure that I can build same output file again.

Here is the problem; I retrieve the sources from CC server and build them. Then I compare the output file to corresponding release output(output file is of type *.lad file + file format elf32-littlearm). And the difference is huge (not some time stamps).On the other hand I also compare assembly listings and they are different too.

Do you have any idea what can causes such a difference ? In my opinion list of items which can cause such a difference -Released output was build on a different PC (WinXP again) with auto build script.New output is build on my local with the same compiler and settings. -Retrieved wrong label from repository

any thing to add ?

thanks in advance


You could use readelf or objdump to get some details on your binarie files, including a list of symbols.

By comparing the two you can maybe find out the cause of the differences.

If you have never used readelf or objdump before, you can find plenty of articles and documentation online.

But if you are using the same label, with the same toolchain (and the same options) there is no reason for the output to be different.


Hi My search over net shows that binary reproducibility is related to incremental build issue.

If your build system is configured to non-incremental , everything is build from scratch. With this configuration even two successive builds yields huge differences in output image and asm listing. (I use objdump -d to get asm listing)

But if incremental build is used altough output image has still huge differences,asm listing has only 1-2 lines of difference.

My strategy will be counting on CM tool&labels. But I'll check readelf beforehand. Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜