Note: I write about ar below, but all of this also applies to ranlib, strip and objcopy. Description of problem: GNU ar adds UIDs, GIDs file modes and timestamps to .a files. Because of this, two builds from the same sources yield different results if they include static archives. I'm currently working towards reproducible builds for Fedora, so that you can e.g. rebuild a srpm to confirm that the binary matches the one you downloaded. This metadata in .a files is of course detrimental to that because they will always differ just by virtue of not having been built at the exact same time. Steps to Reproduce: 1. build static library 2. build same library again 3. diff both --> They differ Proposed solution: ar has a command line switch 'D': 'When adding files and the archive index use zero for UIDs, GIDs, timestamps, and use consistent file modes for all files'[1] However, it is impractical to add that to every build, so binutils upstream provides a configure option '--enable-deterministic-archives', which makes this behaviour the default, though it can still be disabled at runtime via the 'u' switch, in case someone wants to use ar to pack non-library files in an archive and cares about the metadata. I propose we add this flag to our binutils build. [1] https://sourceware.org/binutils/docs/binutils/ar-cmdline.html
Hi Benedikt, Please try out: binutils-2.24-20.fc22 Cheers Nick
Hi Nick, Thanks for adding that. It is probably to late for f21, right?
make 4.0-3.fc22 fails to build on AArch64 unless --enable-deterministic-archives is disabled: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=2603405 make check-local make[2]: Entering directory '/builddir/build/BUILD/make-4.0' cd tests && perl ./run_make_tests.pl -srcdir /builddir/build/BUILD/make-4.0 -make ../make ------------------------------------------------------------------------------ Running tests for GNU make on Linux apm-mustang-ev3-12.ml3.eng.bos.redhat.com 3.15.0-0.36.sa2.aarch64 aarch64 GNU Make 4.0 ------------------------------------------------------------------------------ Finding tests... features/archives ....................................... FAILED (3/10 passed) I did checks with binutils 2.24-18/-19/-20 and it was -20 when it failed. Built -23 without --enable-deterministic-archives option and it passed again. But it is probably bug in make testsuite rather than in binutils.
i'm going to assume this isn't aarch64 specific, and is only biting us here since we're doing the rebuild with newer package versions than the fedora rebuild. i'll take a look at the make testsuite on x86_64.
Closing this one, as I've cloned 1136481 for the make issue.