aboutsummaryrefslogtreecommitdiff
path: root/src/link/Coff.zig
AgeCommit message (Collapse)Author
2020-12-09small fixes and zig fmtVexu
2020-12-08stage2: link: properly implement passthrough mode for LLD child procAndrew Kelley
passthrough mode does not mean always exit - it just means to pass through stdio and exit if the child process exits, without doing any special error reporting.
2020-12-08invoke LLD as a child process rather than a libraryAndrew Kelley
Closes #3825
2020-11-19stage2: Make zig cc more verbose (#7166)LemonBoy
* stage2: Make zig cc more verbose Make `zig cc` print more info from Clang itself and from our own linker invocation, this is needed for CMake to properly discover all the include directories and library search paths. Closes #7110 * Update `update_clang_options` * Typo fixes Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-29fix #3237: resolve undefined symbol _DllMainCRTStartupzhaozg
2020-10-17coff: link in CRT for DLLs that want -lcAndrew Kelley
see #5748 closes #5870
2020-10-16std: Add libssp implementation for GNU/Windows targetsLemonBoy
Unlike glibc and musl, MinGW provides no libssp symbols leading to countless compile errors if FORTIFY_SOURCE is defined. Add a (incomplete) implementation of libssp written in Zig so that linking succeeds. Closes #6492
2020-10-15fixups regarding windows wide stringsAndrew Kelley
* remove GetModuleHandleA from kernel32.zig. use of A functions considered harmful. * make it a compile error to expose WinMain instead of wWinMain. same thing. * start code declares wWinMainCRTStartup instead of WinMainCRTStartup when it has the choice.
2020-10-09fixups to previous commitAndrew Kelley
* std.fs.Dir.readFile: add doc comments to explain what it means when the returned slice has the same length as the supplied buffer. * introduce readSmallFile / writeSmallFile to abstract over the decision to use symlink or file contents to store data.
2020-10-09Use regular file for caching stage 1 hash digest instead of symlink, fix zig ↵mlarouche
build caching on Windows Fix #6500
2020-10-04add --image-base supportAndrew Kelley
Based on #6121 by Jay Petacat.
2020-09-29link.Coff: skip redundant (and invalid) copy to same pathAndrew Kelley
2020-09-29improve stage2 COFF LLD linkingAndrew Kelley
* change some {} to be {s} to gain type safety * fix libraries being libfoo.lib instead of foo.lib for COFF * when linking mingw-w64, add the "always link" libs so that we generate DLL import .lib files for them as the linker code relies on. * COFF LLD linker does not support -r so we do a file copy as an alternative to the -r thing that ELF linking does. I will file an issue for the corresponding TODO upon merging this branch, to look into an optimization that possibly elides this copy when the source and destination are both cache directories. * add a CLI error message when trying to link multiple objects into one and using COFF object format.
2020-09-29use Allocator.allocSentinel now that the stage1 bug is fixedAndrew Kelley
Thanks @LemonBoy!
2020-09-28store stage1 flags in a trailing byte in the hash id symlinkAndrew Kelley
When we get a cache hit for a stage1 compilation, we need to know about some of the flags such as have_winmain or have_dllmain to know which subsystem to infer during linking. To do this, we append a hex-encoded byte into the intentionally-dangling symlink which contains the cache hash digest rather than a filename. The hex-encoded byte contains the flags we need to infer the subsystem during linking.
2020-09-28stage2: building mingw-w64 and COFF LDD linkingAndrew Kelley
still TODO is the task of creating import .lib files for DLLs on the fly both for -lfoo and for e.g. `extern "kernel32"`
2020-09-26stage2: implement -fno-emit-binAndrew Kelley
we are now passing the cli tests
2020-09-21rename src-self-hosted/ to src/Andrew Kelley