This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
compile checksums?
- From: Paul Boyle <paulcboyle at gmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 8 Sep 2009 13:33:05 +0100
- Subject: compile checksums?
Hi,
Hopefully someone on this thread can help me. Every time I compile any
source code that includes 'iostream' is results in different
assembler. Does anyone know what the underline reason for this is? Is
this a known characteristic, or is there a known way of working around
this? I need to develop a mechanism to guarantee that builds from
source code generate identical binaries and was planing to use the
binaries' checksum, but this characteristic is preventing this.
I've tried this different versions of libstdc and am getting similar results.
libstdc++-4.1.2-42.el5
libstdc++-3.4.6-8
I've reduced the code to the most trivial example possible to
demonstrate what I am seeing; only including the iostream header.
[pcb@alpha Tmp]$ echo "#include <iostream>" > sum.cpp ; g++ -S sum.cpp
; sum sum.s
27435 7
[pcb@alpha Tmp]$ echo "#include <iostream>" > sum.cpp ; g++ -S sum.cpp
; sum sum.s
64411 7
[pcb@alpha Tmp]$ echo "#include <iostream>" > sum.cpp ; g++ -S sum.cpp
; sum sum.s
52977 7
An example diff is as follows:
200,201c200,201
< .type _GLOBAL__I_sum.cpp_9D2164D3_
40537BE5, @function
< _GLOBAL__I_sum.cpp_9D2164D3_40537BE5:
---
> .type _GLOBAL__I_sum.cpp_9D2164D3_D6DB2116, @function
> _GLOBAL__I_sum.cpp_9D2164D3_D6DB2116:
218c218
< .size _GLOBAL__I_sum.cpp_9D2164D3_40537BE5,
.-_GLOBAL__I_sum.cpp_9D2164D3_40537BE5
---
> .size _GLOBAL__I_sum.cpp_9D2164D3_D6DB2116, .-_GLOBAL__I_sum.cpp_9D2164D3_D6DB2116
221c221
< .long _GLOBAL__I_sum.cpp_9D2164D3_40537BE5
---
> .long _GLOBAL__I_sum.cpp_9D2164D3_D6DB2116
Thanks,