Skip to content
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

[LLD] Version script support #65

Open
mati865 opened this issue Nov 29, 2019 · 32 comments
Open

[LLD] Version script support #65

mati865 opened this issue Nov 29, 2019 · 32 comments

Comments

@mati865
Copy link
Contributor

mati865 commented Nov 29, 2019

Moving from #56

It's not top priority but would be nice to support it at some point.

@mati865
Copy link
Contributor Author

mati865 commented Feb 28, 2020

Continuation to discussion in #56

Seems like reusing .def files created for link.exe isn't viable option because Binutils LD doesn't understand them.
Universal solution working for both LD and LLD is necessary because Rust calls CC (both GCC and Clang do work) so it cannot distinguish the linker.

Supporting LLD will have to wait until then.

@mstorsjo
Copy link
Owner

Seems like reusing .def files created for link.exe isn't viable option because Binutils LD doesn't understand them.

That's surprising - which aspect of them doesn't binutils ld support? As far as I know they handle them just fine; you pass the name of the def file as one of the input files, and it handles at least the normal list of exports that GNU ld, lld and msvc link.exe all handle the same.

@mati865
Copy link
Contributor Author

mati865 commented Feb 28, 2020

Passed to Clang with "-Wl,C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcylZC2s\\list":

D:\msys64\mingw64\bin\ld:
  C:\Users\mateusz\AppData\Local\Temp\rustcNDaPN4\list: file format not recognized; treating as linker script
D:\msys64\mingw64\bin\ld:
  C:\Users\mateusz\AppData\Local\Temp\rustcNDaPN4\list:2: syntax error

Def file contents: https://gist.github.com/mati865/85265364bcaaacc101e33a77f059a896

@mstorsjo
Copy link
Owner

Three things come to mind:

  • Would it work better if you gave the file a .def suffix?
  • Not sure if GNU ld might have an issue with the $ chars in some of the symbol names
  • Not sure if GNU ld might have an issue with the LIBRARY line without an actual dll file name - try either leaving it out or adding a dll name there

@mati865
Copy link
Contributor Author

mati865 commented Feb 28, 2020

It's the same result (file format not recognized) when it's named list.def.
There is defparse code inside binutils repo but it appears to be used only by dlltool: https://github.com/bminor/binutils-gdb/search?p=1&q=defparse

@mstorsjo
Copy link
Owner

Works fine for me in a minimal testcase:

$ cat test.c
void a(void) {}
void b(void) {}
void c(void) {}
$ cat test.def
EXPORTS
a
b
$ x86_64-w64-mingw32-gcc -c test.c -o test.o
$ x86_64-w64-mingw32-ld --version
GNU ld (GNU Binutils) 2.25
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ x86_64-w64-mingw32-ld test.o test.def -o test.dll -shared 
$ llvm-readobj --coff-exports test.dll

File: test.dll
Format: COFF-x86-64
Arch: x86_64
AddressSize: 64bit
Export {
  Ordinal: 1
  Name: a
  RVA: 0x1000
}
Export {
  Ordinal: 2
  Name: b
  RVA: 0x1007
}

@mati865
Copy link
Contributor Author

mati865 commented Feb 28, 2020

Builds are taking quite some time but now I can confirm LD does work when LIBRARY is gone and the file has .def extension.
Thank you for your time!

@mati865
Copy link
Contributor Author

mati865 commented Apr 13, 2020

Update on this topic:
I copied MSVC code for generating the script (modulo LIBRARY section) in rust-lang/rust#70852 and it causes regressions:

  • DLLs have additional dependencies:
    • symbols exported via .def (bad):
      $ ntldd cci_const_block.dll
              std-979e3b2f81b3e5a5.dll => D:\Projekty\rust\build\x86_64-pc-windows-gnu\stage2\bin\std-979e3b2f81b3e5a5.dll (0x0000000000ef0000)
              KERNEL32.dll => C:\WINDOWS\SYSTEM32\KERNEL32.dll (0x00000000016f0000)
              msvcrt.dll => C:\WINDOWS\SYSTEM32\msvcrt.dll (0x00000000006e0000)
      
    • symbols exported via version-script (good):
      $ ntldd cci_const_block.dll
              KERNEL32.dll => C:\WINDOWS\SYSTEM32\KERNEL32.dll (0x0000000000eb0000)
              msvcrt.dll => C:\WINDOWS\SYSTEM32\msvcrt.dll (0x0000000000eb0000)
      
  • linking to DLLs via implibs causes segfaults (direct linking to DLL with LD works):
    • .def (bad):
      $ nm libcci_const_block.dll.a | grep BLOCK_FN_DEF
      0000000000000000 I __imp__ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      0000000000000000 T _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      
    • version-script (good):
      $ nm const-block-cross-crate-fn/auxiliary/libcci_const_block.dll.a | grep BLOCK_FN_DEF
      0000000000000000 I __imp__ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      0000000000000000 I __nm__ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      
    • the DLL:
      $ nm cci_const_block.dll | grep BLOCK_FN_DEF
      0000000067cc5000 R _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      0000000067cc13b0 t _ZN15cci_const_block12BLOCK_FN_DEF3foo17h3d71b48312ebbcc6E
      
`.def` file from above case:
EXPORTS
  _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
  __rust_alloc
  __rust_alloc_zeroed
  __rust_dealloc
  __rust_realloc
  rust_metadata_cci_const_block_8787f43e282added376259c1adb08b80
`linker-script` from above case:
{
  global:
    _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE;
    __rust_alloc;
    __rust_alloc_zeroed;
    __rust_dealloc;
    __rust_realloc;
    rust_metadata_cci_const_block_8787f43e282added376259c1adb08b80;

  local:
    *;
};

I don't full understand what is going on so Rust support for LLD with MinGW targets will wait for now.

@mstorsjo
Copy link
Owner

Update on this topic:
I copied MSVC code for generating the script (modulo LIBRARY section) in rust-lang/rust#70852 and it causes regressions:

  • DLLs have additional dependencies:

    • symbols exported via .def (bad):
      $ ntldd cci_const_block.dll
              std-979e3b2f81b3e5a5.dll => D:\Projekty\rust\build\x86_64-pc-windows-gnu\stage2\bin\std-979e3b2f81b3e5a5.dll (0x0000000000ef0000)
              KERNEL32.dll => C:\WINDOWS\SYSTEM32\KERNEL32.dll (0x00000000016f0000)
              msvcrt.dll => C:\WINDOWS\SYSTEM32\msvcrt.dll (0x00000000006e0000)
      
    • symbols exported via version-script (good):
      $ ntldd cci_const_block.dll
              KERNEL32.dll => C:\WINDOWS\SYSTEM32\KERNEL32.dll (0x0000000000eb0000)
              msvcrt.dll => C:\WINDOWS\SYSTEM32\msvcrt.dll (0x0000000000eb0000)
      
  • linking to DLLs via implibs causes segfaults (direct linking to DLL with LD works):

    • .def (bad):
      $ nm libcci_const_block.dll.a | grep BLOCK_FN_DEF
      0000000000000000 I __imp__ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      0000000000000000 T _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      
    • version-script (good):
      $ nm const-block-cross-crate-fn/auxiliary/libcci_const_block.dll.a | grep BLOCK_FN_DEF
      0000000000000000 I __imp__ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      0000000000000000 I __nm__ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      
    • the DLL:
      $ nm cci_const_block.dll | grep BLOCK_FN_DEF
      0000000067cc5000 R _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE
      0000000067cc13b0 t _ZN15cci_const_block12BLOCK_FN_DEF3foo17h3d71b48312ebbcc6E
      

.def file from above case:
linker-script from above case:
I don't full understand what is going on so Rust support for LLD with MinGW targets will wait for now.

Was this with def files, with LLD? To narrow things down, if you have time, it could be useful to try applying that on a normal GCC/binutils based build, to see if that aspect is creating issues, or if it's just other aspects of LLD vs ld.bfd vs link.exe.

@mati865
Copy link
Contributor Author

mati865 commented Apr 13, 2020

Those results are the same with ld.bfd and LLD. Though I mostly test ld.bfd since import libs are not always generated yet so using LLD requires a lot manual work.

@mstorsjo
Copy link
Owner

Those results are the same with ld.bfd and LLD. Though I mostly test ld.bfd since import libs are not always generated yet so using LLD requires a lot manual work.

Oh, ok, that's weird then. Maybe the def file generation scripts need to know about and handle some other mingw-ism...

@mati865
Copy link
Contributor Author

mati865 commented Apr 13, 2020

Oh, ok, that's weird then. Maybe the def file generation scripts need to know about and handle some other mingw-ism...

I tried adding –export-all-symbols after reading https://sourceware.org/binutils/docs/ld/WIN32.html but builds failed because there were too many symbols.

I'll inspect ELF LLD code for version-script, probably adapting it for MinGW would be easier (and more time consuming) than using def files.

@mstorsjo
Copy link
Owner

I'll inspect ELF LLD code for version-script, probably adapting it for MinGW would be easier (and more time consuming) than using def files.

I've looked at it a few times, and version script seems to be a subset of full linker script, and linker script is essentially a script that controls the whole linker, which in the ELF linker is very closely integrated with the whole linker. But maybe it's possible to extract out the bits necessary for version script without bringing all of it. Having support for version script would indeed be great.

@mati865
Copy link
Contributor Author

mati865 commented Apr 13, 2020

Oh, this part linking to DLLs via implibs causes segfaults (direct linking to DLL with LD works) applies only to the ld.bfd. LLD errors about missing symbols.

EDIT: Also those are isolated cases (from testsuite), def file works most of the time.

@SquallATF
Copy link

SquallATF commented Apr 13, 2020

Was this with def files, with LLD? To narrow things down, if you have time, it could be useful to try applying that on a normal GCC/binutils based build, to see if that aspect is creating issues, or if it's just other aspects of LLD vs ld.bfd vs link.exe.

I think the other problem is ld.bfd not support lto, because llvm gold plugin not support PE/COFF target. and if use ld.bfd need rebuild mingw-w64 crt with binutils, otherwise it will cause link failure. By the way. is there any way let llvm gold plugin support PE/COFF like gcc lto plugin?

@mati865
Copy link
Contributor Author

mati865 commented Apr 14, 2020

I'll inspect ELF LLD code for version-script, probably adapting it for MinGW would be easier (and more time consuming) than using def files.

Extracting the parser properly (by not duplicating) the code is indeed very hard task.
Extracting ScriptLexer and duplicating version-script parts from ScriptPareser is easy but wiring it to COFF Driver is compilcated.

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

So I have solution for BFD:
Add DATA to the every symbol other than __rust* and rust* (there must be better way though).
So the .def file becomes:

EXPORTS
  _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE DATA
  __rust_alloc
  __rust_alloc_zeroed
  __rust_dealloc
  __rust_realloc
  rust_metadata_cci_const_block_8787f43e282added376259c1adb08b80

That way whole testsuite passes with Clang + BFD.

No idea if I had issue with my previous LLD config or upgrade to LLD 10 broke it but I'm unable to link Rust with it's std library when using LLD because of undefined reference ... errors.
Turns out import library (libstd-<hash>.dll.a) made by LLD is missing a lot of symbols when compared to BFD even when using MSVC style .def without DATA. Using BFD style results in even more missing symbols (I can upload them).

@mstorsjo
Copy link
Owner

mstorsjo commented May 6, 2020

So I have solution for BFD:
Add DATA to the every symbol other than __rust* and rust* (there must be better way though).
So the .def file becomes:

EXPORTS
  _ZN15cci_const_block12BLOCK_FN_DEF17h2bbe18e6734ce46cE DATA
  __rust_alloc
  __rust_alloc_zeroed
  __rust_dealloc
  __rust_realloc
  rust_metadata_cci_const_block_8787f43e282added376259c1adb08b80

That way whole testsuite passes with Clang + BFD.

That's great!

Needing to specify DATA sounds like it is data symbols (so one has to actually get the right address, instead of for code where it's ok to jump via a thunk) - but the fact that it accesses them without the dllimport mechanism (i.e. missing the necessary __imp_ prefix, and missing one level of indirection in the generated code). Does rust generally access them that way even when operating in MSVC mode (where autoimport isn't supported), or why is the dllimport mechanism missing here?

No idea if I had issue with my previous LLD config or upgrade to LLD 10 broke it but I'm unable to link Rust with it's std library when using LLD because of undefined reference ... errors.
Turns out import library (libstd-<hash>.dll.a) made by LLD is missing a lot of symbols when compared to BFD even when using MSVC style .def without DATA. Using BFD style results in even more missing symbols (I can upload them).

Can you isolate one of the missing symbols in the LLD case - the thing to investigate then is, given the same input to both LLD and ld.bfd, why does ld.bfd export that symbol but LLD doesn't?

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

.def file:
_ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE DATA

$ llvm-nm -A */*std-0ff9e225a311b7d3.dll* | grep 10into_inner17h6a4ea254abb7529eE:
BFD dll and import library:

ld/libstd-0ff9e225a311b7d3.dll.a:d000057.o: 00000000 I __imp__ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE
ld/libstd-0ff9e225a311b7d3.dll.a:d000057.o: 00000000 I __nm__ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE
ld/std-0ff9e225a311b7d3.dll: 66944d20 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE

LLD dll and import library (.def with DATA`):

lld/std-0ff9e225a311b7d3.dll: 180004d20 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE

LLD dll and import library (.def without DATA`):

lld-nodata/std-0ff9e225a311b7d3.dll: 180004d20 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE

I think it's related to whether compiler decides the functions can be inlined since all the missing functions I have randomly checked are either marked with #[inline] or small enough to be inlined by the compiler.

Example of slightly bigger function:

$ llvm-nm -A */*std-0ff9e225a311b7d3.dll* | grep from_small17ha0ae0e6ed592467eE
ld/libstd-0ff9e225a311b7d3.dll.a:d000983.o: 00000000 I __imp__ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
ld/libstd-0ff9e225a311b7d3.dll.a:d000983.o: 00000000 I __nm__ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
ld/std-0ff9e225a311b7d3.dll: 6698ff90 T _ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
lld/libstd-0ff9e225a311b7d3.dll.a:std-0ff9e225a311b7d3.dll: 00000000 D __imp__ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
lld/std-0ff9e225a311b7d3.dll: 18005da60 T _ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
lld-nodata/libstd-0ff9e225a311b7d3.dll.a:std-0ff9e225a311b7d3.dll: 00000000 T _ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
lld-nodata/libstd-0ff9e225a311b7d3.dll.a:std-0ff9e225a311b7d3.dll: 00000000 T __imp__ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE
lld-nodata/std-0ff9e225a311b7d3.dll: 18005da60 T _ZN4core3num6bignum8Big32x4010from_small17ha0ae0e6ed592467eE

Using BFD style results in even more missing symbols (I can upload them).

Correction: amount of the symbols is the same, they are just imported differently.

@mstorsjo
Copy link
Owner

mstorsjo commented May 6, 2020

.def file:
_ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE DATA

$ llvm-nm -A */*std-0ff9e225a311b7d3.dll* | grep 10into_inner17h6a4ea254abb7529eE:
BFD dll and import library:

ld/libstd-0ff9e225a311b7d3.dll.a:d000057.o: 00000000 I __imp__ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE
ld/libstd-0ff9e225a311b7d3.dll.a:d000057.o: 00000000 I __nm__ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE
ld/std-0ff9e225a311b7d3.dll: 66944d20 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE

LLD dll and import library (.def with DATA):

lld/std-0ff9e225a311b7d3.dll: 180004d20 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h6a4ea254abb7529eE

Note that nm (at least llvm-nm) doesn't list whether a function is exported, it just checks the symbol table of the dll - a stripped dll (or at least one built with -Wl,-s) wouldn't have the symbol table at all. To see if the symbol is exported, you can check with llvm-readobj --coff-exports *.dll.

I think the issue here could be the slightly unexpected chars in the symbol names ($, and to a lesser extent maybe . as well). If you have a build of lld where you can easily poke into it and rebuild, try looking at what the def file parser gets for those lines - I think it might simply be missing them and not exporting them properly. (Although I don't know if that would cause errors for functions that it tries to export that aren't found...)

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

Does rust generally access them that way even when operating in MSVC mode (where autoimport isn't supported), or why is the dllimport mechanism missing here?

IIRC dllimport was used in Rust years ago but most of it usage was removed. Well, it appears this was the missing bit: https://github.com/rust-lang/rust/blob/c1e05528696ca523055b0f7ce94b8033dcbaa39e/src/librustc_codegen_llvm/context.rs#L218-L261

$ llvm-nm /c/Users/mateusz/.rustup/toolchains/nightly-x86_64-pc-windows-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/std-c74d8e9f6a073a0c.dll.lib | grep std..process..ChildStderr.*std..sys_common..IntoInner
00000000 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h077e5c224e926029E
00000000 T __imp__ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h077e5c224e926029E

I think the issue here could be the slightly unexpected chars in the symbol names ($, and to a lesser extent maybe . as well)

Interesting. When looking at LLD import lib there is no single symbol which would match std.*\$ regex but there are symbols matching core.*\$:
00000000 D __imp__ZN4core3f3221_$LT$impl$u20$f32$GT$8classify17h9f485d5b4d4ec6daE
None of LLD exported symbols have . inside their name.

@mstorsjo
Copy link
Owner

mstorsjo commented May 6, 2020

Does rust generally access them that way even when operating in MSVC mode (where autoimport isn't supported), or why is the dllimport mechanism missing here?

IIRC dllimport was used in Rust years ago but most of it usage was removed. Well, it appears this was the missing bit: https://github.com/rust-lang/rust/blob/c1e05528696ca523055b0f7ce94b8033dcbaa39e/src/librustc_codegen_llvm/context.rs#L218-L261

Ok, I see, so with MSVC like tools, it tried to use dllimport as needed, reluctantly.

With MinGW like tools, it knows the linker will fix things up as needed, so no need to worry. But that "fixing things up as needed" relies on the import lib flagging functions vs data correctly, and what happens correctly when using a version script, but when using a def file, the def file needs to know what's data and what's a function, otherwise the attempts at reading "data" will actually read the jmp instruction in the thunk instead.

$ llvm-nm /c/Users/mateusz/.rustup/toolchains/nightly-x86_64-pc-windows-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/std-c74d8e9f6a073a0c.dll.lib | grep std..process..ChildStderr.*std..sys_common..IntoInner
00000000 T _ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h077e5c224e926029E
00000000 T __imp__ZN113_$LT$std..process..ChildStderr$u20$as$u20$std..sys_common..IntoInner$LT$std..sys..windows..pipe..AnonPipe$GT$$GT$10into_inner17h077e5c224e926029E

I think the issue here could be the slightly unexpected chars in the symbol names ($, and to a lesser extent maybe . as well)

Interesting. When looking at LLD import lib there is no single symbol which would match std.*\$ regex but there are symbols matching core.*\$:
00000000 D __imp__ZN4core3f3221_$LT$impl$u20$f32$GT$8classify17h9f485d5b4d4ec6daE
None of LLD exported symbols have . inside their name.

Ok, hopefully that's it. In the best case, this is a couple-lines fix somewhere in the def file parser (llvm/lib/Object/COFF* iirc), unless there's conflicting syntax elements.

Using dllexport attributes (as in the MSVC tools case) instead of a def file would have the upside that the compiler generates what's needed (including the DATA tags) and hopefully . is allowed there as well.

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

Ok so I've tried enabling dllimport and it doesn't look like DATA is added to the symbols since BFD fails to build the compiler with errors like:

in function `core::sync::atomic::atomic_load':
          D:\Projekty\rust\src\libcore\sync/atomic.rs:2275: undefined reference to `__imp__ZN10proc_macro6bridge6client44_$LT$impl$u20$proc_macro..bridge..Bridge$GT$5enter28HIDE_PANICS_DURING_EXPANSION17h1b484dc66920211aE'

It's a static which I suppose should be marked with DATA: https://github.com/rust-lang/rust/blob/fc145e19d05e8f2ee0aad77a0eba93292ebd3887/src/libproc_macro/bridge/client.rs#L303

LLD fails even earlier than BFD because symbols with . are still not exported.

@mstorsjo
Copy link
Owner

mstorsjo commented May 6, 2020

Ok, so that sounds like the dllimport gets applied correctly, but the dllexport doesn't take effect (maybe an incompatibility between dllexport attributes embedded in the object files vs how ld.bfd interprets them?).

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

Probably the last straight, during building of rustc_driver-<hash>.dll:

error: linking with `clang1` failed: exit code: 1
  |
  = note: "clang1" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\dllcrt2.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.10tsda78z2bei46p.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1197hgukkxvnemr.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.121dbctdm89g67n9.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.12y4ltbdqj6rbmgd.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1337e7upobphlhr2.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.14a74obwjzbqd15w.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.16f9dwljie3y8j0n.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.16ldqmfhlam13uhs.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.16s1ou2dmerz3yas.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.17i38whqf47g4bll.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.17xsielf41jo3mhw.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.193waxnxe987ekti.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1aedqsewljsabmwv.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1ioyumoxj5p1cmh3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1izz6l7qg5e1gteg.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1n5ginqfyg1duvoj.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1out2vwva2d0vvbu.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1slrmugz5x5uwmu6.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1t3n1zjk2llew1j.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1tg3sfl9edsi6wj6.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1ub6d35jebuxrl2k.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1wq9hc3m1otpzhqn.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1yemw800yqthstfr.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.1znjzgwa0bkdlqq4.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.206m8nu7wegoyfsn.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.20op2qxz49qdy55e.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.218qfxx3jedkszno.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.25l51suux4cy4lnx.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.26i6zgn0v4i87utb.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.27y9jv67dx943gdv.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.28boqq8nxoleaofp.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2b4wohvfvxmtr6m9.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2d623siyoh8e6ni6.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2degh7ccrmbdec0m.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2e54p41853ouj8j3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2e9swaw6qjszn5uh.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2fk6a7th15wuojrv.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2hbm1aiy1iw97lnz.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2ixzydsah9prorfo.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2j6lbhjsaxm3405.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2juk6f217hufu7ra.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2ko6h8ix7khpmptg.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2lpdy194v361o4mq.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2nn0gbnar2blu6h0.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2nxqszudhon0n9n.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2od8g5ffv46zi3sh.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2oosz7qvl8gmia6w.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2owzie9cr5s5g7v8.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2rzqgh4jnrx799fp.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2uci6wm3jyjufhss.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2wukn7n8z3sol0jh.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2xulk6ap097ptadt.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.2yy423299h24acpu.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.303ygnuvif72sc12.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.31c9hnz8zjmqt50c.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.31fgqfl42wcl0aq5.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.31ineyo4o8bmpuy3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.31m91iliq1zz1ez0.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.32ipe28iklpu42ce.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.333bsroefy277gbz.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.33oy340w5xuagii9.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.33srcrs04tdqow63.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.345ejpz68enskxln.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3810ai6w5sxtuygb.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3accht7qo1l0xshv.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3ae0dpai8cr12nmi.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3ahw7kesoeq9fhln.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3dqtnerik5j2dhqj.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3dyo2gghwftvv3mn.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3evu6or22d88152x.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3exwdjro5lgnqulc.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3g964ur9onnf06ye.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3j9dy9zu9jgvcpsb.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3n2kh34imdjkpzb6.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3p9s70o5v3un469c.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3pe1lii8adlrum1w.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3s1lfabt8nu6ak7h.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3vwqwgsvz1k79i6q.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3x3s0l2ax3e3p8ke.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3xldrlrj7w4uzne6.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3y4064dpd8h023gd.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3z00a8ovh3bh8vek.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3zsi8glvx8tkehh.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.407b2vm82hwde1s3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.41b3aeas8ewnvgig.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.41ksur58gmyqhjth.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.41msy4lnhxg8xzn3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.41p76ey1v8dmx6f9.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.42pgahw0g98kkcgk.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.43c7hr0ok3bu36x.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.457oq1t39t9py60q.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.48wx3dnnkkdjvgic.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4c2bcif5auv60oi.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4ck59w3adhvp8lm.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4csfk423fz73rgju.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4foq5xz1bvecko1w.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4gs78o1xoaeg36r1.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4gtwhz55hzfx9zm8.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4ieur1b3cschj46f.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4ih728fvw5wyyfgy.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4jv0qhcdg0n5yimj.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4lsu442o7fvcu7av.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4nqvibhod4ix9vfu.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4nrmbbta9fde26he.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4pvddfj6igoyvnpa.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4s3fyqkobzghoavd.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4t2c2zfgf4us1z5p.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4wbm4xh5efkicxde.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4xg17y5sv8o5y85b.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4xhjpxifhnw81zs4.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4z6hi7ma9xejmus8.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.4zyb68m3cwev3c2a.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.501xb8vr8dieysk.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.50ofjjn8zcav8tej.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.517frhm1haijs7s8.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.53hjnituyviskzqr.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.53yc1l81202w0el2.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.53zaxrtvmwinpwhr.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.550ya3l78wbl8s81.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.56w7q09aph8cewda.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.58pvr7uaovhqfena.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5ag73op6my4f7xst.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5ccg0yy88gisa8o0.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5crvismg688crsfr.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5csgpcxf4la1734c.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5duizwqvj8du6i4y.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5ebsr9eb0c0oplm.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.5ephmnbovukicacd.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.6tb8uvp54sr21y8.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.9576djn93fjozks.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.9lxzjecv64jl0j3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.benyf57lbeuiskt.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.c0aa6u2avusublp.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.c6bp8r4kycy11gy.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.cdq36zkg7k92aot.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.f7ixavnk5kh00gx.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.fn8gw4f8rfax79g.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.igrifwq21ssgwwp.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.ivbf3t8pxx68qjo.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.krz8jton65anac2.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.kuzewz7n2x0j86c.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.l06zkrid02tm60v.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.me4j3e6d19qrsk7.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.mn5zhmev9heaslq.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.sd7v82c9y2wthhl.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.sy1y7nnj73m7nz0.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.vaix7yx1gkm6k5x.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.vome81dmyrvey6s.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.w09ptokft8qyol3.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.zm2rx5wx8edtngo.rcgu.o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.zqrzhm3bqkmfw82.rcgu.o" "-o" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.dll" "-Wl,C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\list.def" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-eef8b635b20e55e3.3kzbcd8159pzd2qg.rcgu.o" "-nodefaultlibs" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\release\\deps" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\build\\backtrace-sys-de702c5b64aec588\\out" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_llvm-8b47a890f006d187\\out" "-L" "D:/Projekty/rust/build/x86_64-pc-windows-gnu/llvm/build/lib" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libenv_logger-3f0b57405f11b4f7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_error_codes-b3fde36a9462d516.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_save_analysis-d0d6a71b23eaf62e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libserde_json-cd0ad231a5f105d1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libryu-82916e09164e8030.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libitoa-fd5e991849fb3af3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librls_data-38a263986e4efd14.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librls_span-6d857d9584aede8c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libserde-a395061ddf7efad2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_interface-fb3a19424c258a35.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_codegen_llvm-6e29d72f08c3358a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_llvm-0f40d0846a717041.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libonce_cell-f19e77772d5fa5a9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_ty-c2886b4549e9b0e7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_traits-767de675ed2f535f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_privacy-19723d48197764ca.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_builtin_macros-4e33cd21f93c7907.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_typeck-b5d341424348846e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_resolve-c774bb9f17297f95.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_ast_lowering-3cb7f954cf092065.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_passes-1a2bd87ae342d560.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_mir_build-d4380d75bfc1e975.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_mir-c4c6ab4550072968.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\liblog_settings-541ccaf8cde5aa07.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_codegen_ssa-c501daf97a078395.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_symbol_mangling-a8c60ab0dd7f8999.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libpunycode-2436c2e766df66ca.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_incremental-180ba8c521114c74.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libtempfile-0fa12d41c7018445.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librand-dfc891ce2d40d91d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librand_chacha-40f29805d91210d1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libc2_chacha-7f7343eccf7869fa.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libppv_lite86-76854efa067b33ec.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librand_core-8aecca40b53153f1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libgetrandom-ba916727bf375361.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libremove_dir_all-aa0f35cb166ced15.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libcc-7ad41aa6ce98e934.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_plugin_impl-1efd2c5aefe64967.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_metadata-5ec9e79d6ba4635d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_hir_pretty-fe70f54d2193f668.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libflate2-26507a72238a538c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libminiz_oxide-30df66b52aebc25b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libadler32-7da8000632b3c2cc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libcrc32fast-7588f258b0658f0a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_expand-c678759059c63ccf.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_ast_passes-267c889dba0ff5f4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libitertools-a9ac806f7f99a74a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libeither-1187d7fa7de839da.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_parse-12eff9c8c42e8fe7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libunicode_normalization-31edcdd9a362f836.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libproc_macro-5b2c1174bcb62315.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_lint-d15d049e41ff65f5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libunicode_security-62143018ccb29a7b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libunicode_script-5cce047d6ecae685.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_trait_selection-a59c17f6956cba1d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libfmt_macros-79c025695a5df68d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_infer-e0f19d163ba881ad.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_middle-a8ffa35ccd65a82d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_apfloat-8c9c8e2550ef88a3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libbacktrace-261f7181ca57af6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libbacktrace_sys-974d1ea021f865ed.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\liblibc-031c99edf9400c70.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_demangle-060d905b172c6404.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libpolonius_engine-e2096f6866c093e4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libdatafrog-eb327cac926016c4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_attr-24051ff0870ddc70.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_ast_pretty-926973b06742c463.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_session-66c7df7f1fdcc5f3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libnum_cpus-0c7198d8dd77b3a3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libgetopts-aec671770fd4cbb1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_fs_util-5884242c9af517ae.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_feature-73ecf115af2e865d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_query_system-bab2ec7e30cc54fd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_errors-f27ed56b12495a87.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libtermize-c8786eddc586d14d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libatty-ad3f65bf1fa1778c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libannotate_snippets-1f977d38b6c9a53a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libtermcolor-aeb677dc35e67b64.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libwincolor-128a7ebb5e98c081.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libwinapi_util-9040e18c9d4395ed.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_hir-37bc8677f634d973.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_target-ac168d9657f3b074.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_ast-6ed30a80047c6c30.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_lexer-f4140d4972846f11.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libunicode_xid-7ba688bd9621edf5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_span-140d4491796f9187.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libsha1-b0b2d789077991e2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libfake_simd-ee808572aa3ab265.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libmd5-a4b22e4913449379.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libdigest-dd86eea44fc09c62.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libopaque_debug-c4e0aee0216a2ef6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libblock_buffer-87de4e352341ceda.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libgeneric_array-486c6a3b74b43f48.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libtypenum-ee9a64830c76caf3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libblock_padding-9b5d85d27f626cce.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libbyte_tools-56a0adceecf99df5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libunicode_width-0f5086379cc38bf2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libarena-c0700bc71ade9e41.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_data_structures-3e5c7cd3e7ba22e2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libparking_lot-59cd250ad922edd0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libparking_lot_core-ca6f519db575e5cd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libmeasureme-c6b2974d9757134e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libmemmap-52d217244a28df73.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libparking_lot-676a44b2a8830d92.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libparking_lot_core-4e1695907b0f56f5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libwinapi-99efb9534e9f085a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libsmallvec-65b4abcd12891b6d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\liblock_api-1ff61b340ecff8b2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libscopeguard-1a985cd2212df396.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libena-721ac13c7ff51571.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libstable_deref_trait-cb35f8cff916e76c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libgraphviz-fb6701cd7068b113.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libjobserver-a4f3afbd966843d5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_index-38aa3e622a03881b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libserialize-75d1464b4b07168a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libindexmap-0644f64b4010b42c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libsmallvec-6574c08380a2d8eb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\librustc_hash-28c4e46aacb4ef43.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libbyteorder-f63cae5f14cce98c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libscoped_tls-b74f80b9cf614db8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libbitflags-6b217411b40cecc1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\liblazy_static-0901236be4486d1b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\liblog-542ab0a15d678da7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libcfg_if-fa8880302607ad19.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-L" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bdynamic" "-lstd-0ff9e225a311b7d3" "-Wl,--end-group" "-Wl,-Bstatic" "C:\\Users\\mateusz\\AppData\\Local\\Temp\\rustcl2Lph2\\libcompiler_builtins-4e01abeb99c1393c.rlib" "-Wl,-Bdynamic" "-lpsapi" "-lshell32" "-lole32" "-ladvapi32" "-lstdc++" "-Wl,-Bstatic" "-lgcc_s" "-lpthread" "-Wl,-Bdynamic" "-luuid" "-ladvapi32" "-ladvapi32" "-lole32" "-loleaut32" "-ladvapi32" "-lcfgmgr32" "-lgdi32" "-lkernel32" "-lmsimg32" "-lopengl32" "-lpsapi" "-lsynchronization" "-luser32" "-lwinspool" "-ladvapi32" "-lws2_32" "-luserenv" "-shared" "-Wl,--out-implib,D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\librustc_driver-eef8b635b20e55e3.dll.a" "-lmingwex" "-lmingw32" "-lmsvcrt" "-lmsvcrt" "-luser32" "-lkernel32" "-lgcc_s" "-lgcc" "-lkernel32" "D:\\Projekty\\rust\\build\\x86_64-pc-windows-gnu\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: D:\msys64\mingw64\bin\ld: D:\Projekty\rust\build\x86_64-pc-windows-gnu\stage1-rustc\x86_64-pc-windows-gnu\release\deps\rustc_driver-eef8b635b20e55e3.4csfk423fz73rgju.rcgu.o: in function `rustc_driver::diagnostics_registry':
          D:\Projekty\rust/src\librustc_driver/lib.rs:133: undefined reference to `__imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE'
          D:\msys64\mingw64\bin\ld: D:\Projekty\rust/src\librustc_driver/lib.rs:133: undefined reference to `__imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE'
          D:\msys64\mingw64\bin\ld: D:\Projekty\rust/src\librustc_driver/lib.rs:133: undefined reference to `__imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE'
          D:\msys64\mingw64\bin\ld: D:\Projekty\rust/src\librustc_driver/lib.rs:133: undefined reference to `__imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

DIAGNOSTICS is a static array FTR.

$ llvm-nm /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-rustc/x86_64-pc-windows-gnu/release/deps/librustc_error_codes-b3fde36a9462d516.rlib | grep 17h14a72433b55619afE
000537c0 R _ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE

$ llvm-nm /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-rustc/x86_64-pc-windows-gnu/release/deps/librustc_driver-eef8b635b20e55e3.dll.a | grep 17h14a72433b55619afE
00000000 T _ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE
00000000 I __imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE

$ llvm-nm /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-rustc/x86_64-pc-windows-gnu/release/deps/rustc_driver-eef8b635b20e55e3.4csfk423fz73rgju.rcgu.o | grep 17h14a72433b55619afE
         U __imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE

There is probably another missing bit somewhere else. Maybe I should build Rust with MSVC and disable incremental compilation to compare them?

@mstorsjo
Copy link
Owner

mstorsjo commented May 6, 2020

I'm not sure how to interpret this last error message. So there's an undefined reference against a symbol __imp__ZN17rustc_error_codes11error_codes11DIAGNOSTICS17h14a72433b55619afE, and librustc_driver-eef8b635b20e55e3.dll.a (a normal import library?) contains that symbol, but librustc_error_codes-b3fde36a9462d516.rlib doesn't? And it tries to link against the rlib, not the dll.a?

That sounds like a case where dllimport was used when compiling the code that refers to it, but it turns out to be linked statically instead of dynamically as expected.

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

BFD always creates import libraries like that:

00000000 T symbol
00000000 T __imp_symbol

That symbol is actually present inside librustc_error_codes-b3fde36a9462d516.rlib read only data section as static OFC.
I had wiped stage1 build and redid the build before reporting here but that didn't help. What helped was totally clean build with disabled incremental compilation so let's hope it was just a build system cache issue.

LLD still fails to link with errors like lld-link: error: undefined symbol: _$LT$core..alloc..layout..LayoutErr$u20$as$u20$core..fmt..Debug$GT$::fmt::h21d247820343f0d8. I'll try to create minimal example that would be easier to work with.

$ llvm-nm /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-std/x86_64-pc-windows-gnu/release/std.dll | grep h21d247820343f0d8
180083b30 T _ZN67_$LT$core..alloc..layout..LayoutErr$u20$as$u20$core..fmt..Debug$GT$3fmt17h21d247820343f0d8E

$ llvm-nm /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-std/x86_64-pc-windows-gnu/release/libstd.dll.a | grep h21d247820343f0d8

$ llvm-readobj --coff-exports /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-std/x86_64-pc-windows-gnu/release/libstd.dll.a | grep h21d247820343f0d8

$ llvm-readobj --coff-exports /d/Projekty/rust/build/x86_64-pc-windows-gnu/stage1-std/x86_64-pc-windows-gnu/release/std.dll | grep h21d247820343f0d8

@mati865
Copy link
Contributor Author

mati865 commented May 6, 2020

OK it surely is .def parsing issue:

.global _main
.global _foo$foo
.global _bar.bar
.text
_main:
  ret
_foo$foo:
  ret
_bar.bar:
  ret
.section .drectve
.ascii "-export:foo$foo -export:bar.bar"

Looks fine:

$ llvm-readobj --coff-exports libfoo.dll.a

File: libfoo.dll.a(foo.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: libfoo.dll.a(foo.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: libfoo.dll.a(foo.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: foo.dll
Format: COFF-import-file
Type: code
Name type: noprefix
Symbol: __imp__bar.bar
Symbol: _bar.bar

File: foo.dll
Format: COFF-import-file
Type: code
Name type: noprefix
Symbol: __imp__foo$foo
Symbol: _foo$foo

Now move .ascii "-export:foo$foo -export:bar.bar" to .def:

EXPORTS
  foo$foo
  bar.bar

And we get:

$ llvm-readobj --coff-exports libfoo2.dll.a

File: libfoo2.dll.a(foo2.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: libfoo2.dll.a(foo2.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: libfoo2.dll.a(foo2.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: foo2.dll
Format: COFF-import-file
Type: code
Name type: name
Symbol: __imp_
Symbol:

File: foo2.dll
Format: COFF-import-file
Type: code
Name type: noprefix
Symbol: __imp__foo$foo
Symbol: _foo$foo

So lld-link -safeseh:no -dll -out:foo.dll -entry:main foo.o -implib:libfoo.dll.a -def:lib.def gives empty symbol but MSVC's link -safeseh:no -dll -out:foo3.dll -entry:main foo.o -implib:libfoo3.dll.a -def:lib.def works fine:

$ llvm-readobj --coff-exports libfoo3.dll.a

File: libfoo3.dll.a(foo3.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: libfoo3.dll.a(foo3.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: libfoo3.dll.a(foo3.dll)
Format: COFF-i386
Arch: i386
AddressSize: 32bit

File: foo3.dll
Format: COFF-import-file
Type: code
Name type: noprefix
Symbol: __imp__bar.bar
Symbol: _bar.bar

File: foo3.dll
Format: COFF-import-file
Type: code
Name type: noprefix
Symbol: __imp__foo$foo
Symbol: _foo$foo

Which kinda surprises me because folks were already using LLD to develop Rust.

@mstorsjo
Copy link
Owner

mstorsjo commented May 7, 2020

OK it surely is .def parsing issue:
[...]
So lld-link -safeseh:no -dll -out:foo.dll -entry:main foo.o -implib:libfoo.dll.a -def:lib.def gives empty symbol but MSVC's link -safeseh:no -dll -out:foo3.dll -entry:main foo.o -implib:libfoo3.dll.a -def:lib.def works fine:

[...]

Which kinda surprises me because folks were already using LLD to develop Rust.

Well, where LLD already is used, they use the MSVC workflow of only using dllexport/dllimport, not def files?

Thanks for the repro cases and for verifying. Especially as link.exe handles . in symbol names in def files, it should be doable without conflicts to fix it in lld as well.

Also fwiw, llvm-readobj --coff-exports is the right tool for checking exports on an actual DLL, but it doesn't really do much on an import library - on import libraries llvm-nm works just as well (and has more compact output).

@mati865
Copy link
Contributor Author

mati865 commented May 7, 2020

Well, where LLD already is used, they use the MSVC workflow of only using dllexport/dllimport, not def files?

Def files are always enabled for MSVC unless building executable.

Apparently they use workaround forcing link.exe when linking std library.

Thanks for the repro cases and for verifying. Especially as link.exe handles . in symbol names in def files, it should be doable without conflicts to fix it in lld as well.

I'll try to find it and eventually fix it unless you beat me to it 😉.

@mstorsjo
Copy link
Owner

mstorsjo commented May 8, 2020

I posted a fix for the LLD period in symbol names in def files issue at https://reviews.llvm.org/D79619, fwiw.

@mati865
Copy link
Contributor Author

mati865 commented May 8, 2020

I was looking at that code yesterday but postponed it till today.

Thank you for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants