-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
codegen-units setting in Cargo.toml causes LLVM error with nightly-i686-pc-windows-msvc #36309
Comments
cc @mw |
Nominating for @rust-lang/compiler triage. |
I have a dim memory of fixing this exact same problem two months ago... 😕 |
I knew that I had seen this problem before somewhere: #33890 (comment) |
…r=nikomatsakis trans: Only instantiate #[inline] functions in codegen units referencing them This PR changes how `#[inline]` functions are translated. Before, there was one "master instance" of the function with `external` linkage and a number of on-demand instances with `available_externally` linkage in each codegen unit that referenced the function. This had two downsides: * Public functions marked with `#[inline]` would be present in machine code of libraries unnecessarily (see #36280 for an example) * LLVM would crash on `i686-pc-windows-msvc` due to what I suspect to be a bug in LLVM's Win32 exception handling code, because it doesn't like `available_externally` there (#36309). This PR changes the behavior, so that there is no master instance and only on-demand instances with `internal` linkage. The downside of this is potential code-bloat if LLVM does not completely inline away the `internal` instances because then there'd be N instances of the function instead of 1. However, this can only become a problem when using more than one codegen unit per crate. cc @rust-lang/compiler
@michaelwoerister is this fixed? |
@Boscop maybe you can check if this is fixed? |
It should be fixed but I'm not sure the fix is in nightly yet. |
@michaelwoerister it should be in nightly, the most recent one is: rustc 1.13.0-nightly (4f9812a 2016-09-21) |
I spent some time trying to write a small test case without success. Since this is fixed for |
Using the latest nightly
rustc 1.13.0-nightly (cbe4de78e 2016-09-05)
I'm getting this error on a project that uses euclid which uses xml-rs:LLVM ERROR: assembler label 'L__ehtable$_ZN3xml6reader6parser10MarkupData13take_ encoding17hb15412b3bac19ec7E' can not be undefined error: Could not compile
xml-rs.
This happens only when I have
codegen-units = 4
in my Cargo.toml and only with the 32bit version of the toolchain, only withnightly-i686-pc-windows-msvc
not withnightly-x86_64-pc-windows-msvc
.(I tested 4 configs: with/without
codegen-units = 4
in Cargo.toml ⨯ 32/64 bit)The text was updated successfully, but these errors were encountered: