-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
can't compile libstd with -Z debug-info #9167
Comments
possibly related to |
Heads up @michaelwoerister. |
even better
|
This should fix some outstanding namespace issues. It also fixes an issue with LLVM metadata uniquing that caused an LLVM assertion when compiling libstd. One thing to keep in mind is that the `-O` flag and the debug info flags are essentially incompatible. It may work but I would not consider this in any way supported at the moment. On the other hand, there is also good news: With the changes in this PR I am able to compile all of rust with extra-debug-info: ``` make RUSTFLAGS_STAGE2='-Zextra-debug-info' check ``` compiles the whole thing without warning and passes the whole test suite (given that `configure` is run with `--disable-optimize`). That's kind of nice `:)` Still, I'm reluctant to automatically close the related issues (#9167, #9190, #9268) without confirmation from the openers. I'll post to the individual threads once this gets merged.
As of #9658 being merged into master, the errors described here (both by @glycerine and @enomado) do not occur anymore (tested on 32 and 64 bit Linux, with |
@michaelwoerister does this mean we can compile the stdlib & compiler with |
@huonw Yes, that should work now, albeit only with optimizations turned off. |
https://gist.github.com/pnkfelix/6892686 (never mind though, those are failures from passing these flags to the stage0 rustc...) |
Nonetheless, we still should explicitly track the problems that arise when you have optimizations turned on. There are two classes of potential problems: Issues where the debug-info does not properly reflect the program state (a common problem in any programming language when mixing optimizations and debug-info), and Issues where the compiler actually fails to compile a program correctly (ignoring the output debug-info). If we are getting LLVM assertion failures, then we are effectively seeing the latter, since the assertion failure will cause a debug-build of LLVM to die. |
From some initial experiments, I can confirm that one can bootstrap a non-optimized rustc build with It would be good for us to address the assertion failures, but I'll probably first take the step I outlined in #9770 of extending the configure script with a flag to turn this stuff on for the libraries built during rustc bootstrapping. |
Yes, that's a bit tricky until we have a new snapshot. I always used
Yes, it's definitely the second kind of failure. And as far as I can tell from my (rather preliminary) investigation of the problem, it happens before any optimization passes even run. That is, if my mental model of
If it really works that way then we are just using LLVM's Adding debug info options to the configure script can't hurt, I guess. I'd definitely use them |
…, r=flip1995 Fixes [`trait_duplication_in_bounds`] false positives Fixes rust-lang#9076 rust-lang#9151 rust-lang#8757. Partially fixes rust-lang#8771. changelog: [`trait_duplication_in_bounds`]: Reduce number of false positives.
version:
libextra and libsyntax seem to build okay with -Z debug-info, but libstd complains:
The text was updated successfully, but these errors were encountered: