Skip to content

Installing Rust on Windows via the installer may lead to linking failures/conflicts #13784

@pcwiek

Description

@pcwiek

At first glance, it looks like a PATH-related mingw issue. I may be wrong though, happy investigating! :)

Steps:

  1. Install mingw first (or at least something that adds ld to PATH), in my case it came with Haskell 2013.2.0.0 for Windows.
  2. Install Rust from the nightly Windows installer
  3. Create any Rust program ('Hello world' is sufficient) and try to compile it.
  4. Witness the aftermath.

F:\Rust\TestProj>rustc test.rs
error: linking with `gcc` failed: exit code: 1
note: gcc arguments: '-m32' '-LC:\Program Files (x86)\Rust\bin\rustlib\i686-pc-m
ingw32\lib' '-o' 'test' 'test.o' '-lmorestack' '-shared-libgcc' '-Wl,--enable-lo
ng-section-names' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\l
ibnative-83574243-0.11-pre.rlib' 'C:\Program Files (x86)\Rust\bin\rustlib\i686-p
c-mingw32\lib\libstd-aad93cea-0.11-pre.rlib' 'C:\Program Files (x86)\Rust\bin\ru
stlib\i686-pc-mingw32\lib\liblibc-3574b280-0.11-pre.rlib' '-LF:\Rust\TestProj\.r
ust' '-LF:\Rust\TestProj' '-Wl,-Bdynamic' '-lws2_32' '-lgcc_s' '-lcompiler-rt'
note: C:/Program Files (x86)/Haskell Platform/2013.2.0.0/mingw/bin/ld.exe: Dwarf
 Error: Offset (3168) greater than or equal to .debug_abbrev size (972).
C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-aad93cea-0.11
-pre.rlib(r-rustrt-rust_builtin.o):rust_builtin.c:(.text+0x1d0): undefined refer
ence to `_gmtime32'
C:/Program Files (x86)/Haskell Platform/2013.2.0.0/mingw/bin/ld.exe: Dwarf Error
: found dwarf version '0', this reader only handles version 2, 3 and 4 informati
on.
C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-aad93cea-0.11
-pre.rlib(r-rustrt-rust_builtin.o):rust_builtin.c:(.text+0x230): undefined refer
ence to `_localtime32'
C:/Program Files (x86)/Haskell Platform/2013.2.0.0/mingw/bin/ld.exe: Dwarf Error
: found dwarf version '20039', this reader only handles version 2, 3 and 4 infor
mation.
C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-aad93cea-0.11
-pre.rlib(r-rustrt-rust_builtin.o):rust_builtin.c:(.text+0x41c): undefined refer
ence to `_mktime32'
C:/Program Files (x86)/Haskell Platform/2013.2.0.0/mingw/bin/ld.exe: Dwarf Error
: found dwarf version '8259', this reader only handles version 2, 3 and 4 inform
ation.
C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\libstd-aad93cea-0.11
-pre.rlib(r-rustrt-rust_builtin.o):rust_builtin.c:(.text+0x44c): undefined refer
ence to `_mktime32'
collect2: ld returned 1 exit status

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions