Skip to content

Support deterministic builds by remapping the __FILE__ prefix if the …#309

Merged
alexcrichton merged 2 commits into
rust-lang:masterfrom
jgalenson:file-prefix-map
Aug 19, 2019
Merged

Support deterministic builds by remapping the __FILE__ prefix if the …#309
alexcrichton merged 2 commits into
rust-lang:masterfrom
jgalenson:file-prefix-map

Conversation

@jgalenson

Copy link
Copy Markdown

…compiler supports it.

@alexcrichton

Copy link
Copy Markdown
Member

Thanks for the PR! Do you know which file is using __FILE__? Or is there perhaps a command line option we could pass like NDEBUG which would disable its usage? It'd be interesting if we could get MSVC to be more deterministic here as well.

@jgalenson

Copy link
Copy Markdown
Author

The problematic line in compiler-rt is https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/int_util.h#L21, which is used by (at least) absvdi2, absvsi2, absvti2, addvdi3, addvsi3, addvti3, mulvdi3, mulvsi3, mulvti3, negvdi2, negvsi2, negvti2, subvdi3, subvsi3, and subvti3.

There is currently no NDEBUG macro we can use. An alternative to this patch is of course to add something like it, but since compiler-rt doesn't seem to use NDEBUG at all, I decided to do this. We can do DNDEBUG in addition to (or instead of) this patch if you would prefer.

@alexcrichton

Copy link
Copy Markdown
Member

Nah ok this sounds good to me in that case! Mind including that header file reference in the comment in the source and I'll merge?

@jgalenson

Copy link
Copy Markdown
Author

Done. I suppose it might be worth also trying to get NDEBUG into compiler-rt to support compilers that don't have -ffile-prefix-map, but merging this will help anyway. Thanks!

@alexcrichton alexcrichton merged commit f0b4323 into rust-lang:master Aug 19, 2019
@alexcrichton

Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants