Stefan Viljoen
2018-Jul-18 09:37 UTC
[asterisk-users] Recompiling Ast results in a binary with differing SHA256 sums?
Hi Guys If I recompile Asterisk (on a Centos 7 test box, Asterisk 1.8.32.3) multiple times in a row, e. g. make clean;configure;make menuselect;make I note that the asterisk binary in the /main folder in the source tree, has a different SHA256 hash each time I recompile Asterisk using the above commands. I do not change anything on the system or in the menuselect configs for each run. But each time the checksum for the "asterisk" binary is different. Why is that? Shouldn't a freshly compiled binary off the same source, with no changes in the Asterisk menuselect, with nothing changed on the rest of the system, result each time in an IDENTICAL binary, down to the last byte? Why am I getting a completely different "asterisk" ELF binary each time I recompile asterisk, according to checksum? Can someone shed light... Thanks, Stefan
Richard Mudgett
2018-Jul-20 16:19 UTC
[asterisk-users] Recompiling Ast results in a binary with differing SHA256 sums?
On Wed, Jul 18, 2018 at 4:37 AM, Stefan Viljoen <viljoens at verishare.co.za> wrote:> Hi Guys > > If I recompile Asterisk (on a Centos 7 test box, Asterisk 1.8.32.3) > multiple > times in a row, e. g. > > make clean;configure;make menuselect;make > > I note that the asterisk binary in the /main folder in the source tree, has > a different SHA256 hash each time I recompile Asterisk using the above > commands. > > I do not change anything on the system or in the menuselect configs for > each > run. > > But each time the checksum for the "asterisk" binary is different. > > Why is that? Shouldn't a freshly compiled binary off the same source, with > no changes in the Asterisk menuselect, with nothing changed on the rest of > the system, result each time in an IDENTICAL binary, down to the last byte? > > Why am I getting a completely different "asterisk" ELF binary each time I > recompile asterisk, according to checksum? > > Can someone shed light... >A timestamp is added to the version string when you build Asterisk. Thus every time you recompile Asterisk you get a different timestamp in the version string. Thus the checksum will be different every time. Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180720/2bf8eef7/attachment.html>
Tony Mountifield
2018-Jul-20 16:28 UTC
[asterisk-users] Recompiling Ast results in a binary with differing SHA256 sums?
In article <007401d41e7a$edc7e190$c957a4b0$@verishare.co.za>, Stefan Viljoen <viljoens at verishare.co.za> wrote:> Hi Guys > > If I recompile Asterisk (on a Centos 7 test box, Asterisk 1.8.32.3) multiple > times in a row, e. g. > > make clean;configure;make menuselect;make > > I note that the asterisk binary in the /main folder in the source tree, has > a different SHA256 hash each time I recompile Asterisk using the above > commands. > > I do not change anything on the system or in the menuselect configs for each > run. > > But each time the checksum for the "asterisk" binary is different. > > Why is that? Shouldn't a freshly compiled binary off the same source, with > no changes in the Asterisk menuselect, with nothing changed on the rest of > the system, result each time in an IDENTICAL binary, down to the last byte? > > Why am I getting a completely different "asterisk" ELF binary each time I > recompile asterisk, according to checksum? > > Can someone shed light...Most likely there is a text string in there somewhere indicating the date or time of compilation. Why don't you save the binary, recompile, then compare the first binary with the recompiled one? At the simplest level use "cmp -l". Or maybe convert each binary to a hexdump with "hexdump -C", and then use diff or vimdiff to compare them. Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org