Repository navigation
GNU toolchain on Windows can't build compiler plugins since nightly 2017-12-15. #47029
Description
Activity
I suspect the issue is a result of ea35192, which added
backtraceas a dependency to therustcpackage.backtraceagain depends ondbghelp-sys, which causes the linking issue I believe.The standard library seems to use
dbghelpthrough adlopeninstead of compile time linking:rust/src/libstd/sys/windows/backtrace/mod.rs
Lines 51 to 59 in f1ea23e
pub fn unwind_backtrace(frames: &mut [Frame]) -> io::Result<(usize, BacktraceContext)> { let dbghelp = DynamicLibrary::open("dbghelp.dll")?; // Fetch the symbols necessary from dbghelp.dll let SymInitialize = sym!(dbghelp, "SymInitialize", SymInitializeFn)?; let SymCleanup = sym!(dbghelp, "SymCleanup", SymCleanupFn)?; let StackWalk64 = sym!(dbghelp, "StackWalk64", StackWalk64Fn)?; Wouldn't this approach work for
backtrace-rsas well?dbghelp-sysbundleslibdbghelp.aso depending on it normally works. However when the precompiled version is distributed inside rustc internal crates,libdbghelp.ais not brought along, causing stuff to fail to link. The simplest solution on Rust's side is to simply addlibdbghelp.ato the set of mingw import libraries that it bundles.- addedO-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsA-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.Category: This is a bug.
on Jan 30, 2018 Compiler plugins are now deprecated so this works even less now with the whole
rustc_pluginbeing unavailable. I'm sure there's some way to get these working, but given the deprecation, I've got no motivation to figure that out. :)(I'm encountering a compilation issue before linking. I don't think this is anything GNU-toolchain specific at the moment.)
lib.rs
Building the above file as a dylib (or alternatively using cargo and
plugin = true) fails:The full error can be seen on AppVeyor for example:
https://ci.appveyor.com/project/Rantanen/intercom/build/129/job/0k9k54hkwk1f0sfw
The build works just fine on the previous nightly.
As far as I can tell,
dbghelpis an MSVC dependency and should be omitted for the GNU toolchain.