cmake: strip_nondeterminism_if_found() on all .a library files #17494
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Post process libraries if find_program(strip-nondeterminism) succeeds,
do nothing otherwise.
This has been successfully tested on Ubuntu 18.04 with a full
sanitycheck run including all the default samples/ and tests/
Two very important caveats:
This required a couple of fixes on top of "apt-get install
non-determinism" version 0.040-1.1~build1. These fixes are available
at https://salsa.debian.org/reproducible-builds/strip-nondeterminism/merge_requests/4
The entire ar.pm handler has been removed in more recent (1.0.0+)
strip-nondeterminism releases! The commit message 366d60c9cc16 says:
"Drop .ar handler; binutils is reproducible". The corresponding bugs
and discussions seem to show a concern than ar.pm could hide bugs in
binutils or llvm-ar. Supporting older or non-debian systems doesn't
seem to be desired.
So the preferred alternative is to use a toolchain like the Zephyr SDK
that supports creating deterministic .a files and (if not the default)
pass the -D option to (GNU) ar thanks to
CMAKE_LANG_CREATE_STATIC_LIBRARY
Signed-off-by: Marc Herbert marc.herbert@intel.com