Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 19, 2019

Conversation

jgalenson
Copy link

…compiler supports it.

@alexcrichton
Copy link
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
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
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
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
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.

None yet

2 participants