Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ pub trait ArchiveBuilderBuilder {
items: Vec<ImportLibraryItem>,
output_path: &Path,
) {
if common::is_mingw_gnu_toolchain(&sess.target) {
// The binutils linker used on -windows-gnu targets cannot read the import
// libraries generated by LLVM: in our attempts, the linker produced an .EXE
// that loaded but crashed with an AV upon calling one of the imported
// functions. Therefore, use binutils to create the import library instead,
// by writing a .DEF file to the temp dir and calling binutils's dlltool.
if common::is_mingw_gnu_toolchain(&sess.target) && sess.opts.cg.dlltool.is_some() {
// Previously we always used dlltool on -windows-gnu targets due to the binutils
// linker not entirely correctly handling import libraries generated by
// LLVM/ar_archive_writer. This has since been fixed. To ease the transition, will
// temporarily still use dlltool if explicitly specified, but use ar_archive_writer
// like on MSVC if not.
create_mingw_dll_import_lib(sess, lib_name, items, output_path);
} else {
trace!("creating import library");
Expand Down
Loading