compiler-wrapper: set -frandom-seed="$*" for gcc - #4718
Closed
haampie wants to merge 1 commit into
Closed
Conversation
haampie
force-pushed
the
hs/compiler-wrapper/reproducible
branch
2 times, most recently
from
May 13, 2026 08:38
d22de77 to
6e3bbe0
Compare
haampie
marked this pull request as ready for review
May 13, 2026 08:40
haampie
marked this pull request as draft
May 13, 2026 09:35
To make builds deterministic with GCC, use `-frandom-seed` with the value set to all command line arguments. Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
haampie
force-pushed
the
hs/compiler-wrapper/reproducible
branch
from
May 13, 2026 09:53
6e3bbe0 to
ea7c243
Compare
-frandom-seed=$* for gcc
-frandom-seed=$* for gcc-frandom-seed="$*" for gcc
haampie
marked this pull request as ready for review
May 13, 2026 10:04
Member
Author
|
Regarding binutils, we can assume it's configured with The only non-determinism can come from |
haampie
marked this pull request as draft
May 13, 2026 14:38
Member
Author
|
Converted to draft cause I've submitted this to |
Member
Author
|
Combined with #4829 to avoid double full rebuild. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
To make builds deterministic with GCC, use
-frandom-seedwith thevalue set to all command line arguments. GCC uses the CRC checksum of
this string to initialize its random number generator.
LLVM is deterministic by default.
One concern could be "Argument list too long", but I think this one extra
flag is typically smaller than all the
-I,-L,-Wl,flags we inject.