summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/back/link.rs
AgeCommit message (Collapse)AuthorLines
2019-05-07Auto merge of #60464 - eddyb:not-overly-specific-pipelining, r=alexcrichtonbors-0/+3
rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output. This is my take on #60006 / #60419 (see https://github.com/rust-lang/rust/pull/60006#discussion_r275983732). I'm not too attached the "notifications" part, it's pretty much bikeshed material. **EDIT**: for "artifact", @matklad pointed out Cargo already uses it (in https://github.com/rust-lang/rust/pull/60464#issuecomment-488576998) The first two commits are fixes that could be landed independently, especially the `compiletest` one, which removes the need for any of the normalization added in #60006 to land the test. The last commit enables the emission for all outputs, which was my main suggestion for #60006, mostly to show that it's minimal and not really a "scope creep" (as suggested in https://github.com/rust-lang/rust/pull/60006#discussion_r279964081). cc @alexcrichton @nnethercote
2019-05-07rustc_codegen_ssa: emit artifact notifications for the main link product too.Eduard-Mihai Burtescu-0/+3
2019-05-03rustc: Always handle exported symbols on the wasm targetAlex Crichton-6/+4
Currently when linking an artifact rustc will only conditionally call the `Linker::export_symbols` function, but this causes issues on some targets, like WebAssembly, where it means that executable outputs will not have the same symbols exported that cdylib outputs have. This commit sinks the conditional call to `export_symbols` inside the various implementations of the function that still need it, and otherwise the wasm linker is configured to always pass through symbol visibility lists.
2019-05-01Move metadata writing earlier.Nicholas Nethercote-29/+6
The commit moves metadata writing from `link_binary` to `encode_metadata` (and renames the latter as `encode_and_write_metadata`). This is at the very start of code generation.
2019-05-01Inline and remove `link_binary_output`.Nicholas Nethercote-74/+61
This change simplifies things for the subsequent commit.
2019-04-30In JSON output, emit a directive after metadata is generated.Nicholas Nethercote-2/+8
To implement pipelining, Cargo needs to know when metadata generation is finished. This commit adds code to do that. Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. The change involves splitting the existing `Emitter::emit` method in two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`. The JSON directives look like this: ``` {"directive":"metadata file written: liba.rmeta"} ``` The functionality is behind the `-Z emit-directives` option, and also requires `--error-format=json`.
2019-04-26Remove some unused return values.Nicholas Nethercote-25/+15
2019-04-24Don't generate unnecessary rmeta files.Nicholas Nethercote-7/+12
2019-04-20Tidybjorn3-1/+8
2019-04-20Move almost all of cg_llvm/back/link.rs to cg_ssabjorn3-5/+1096
2019-04-20Remove get_reloc_model and target_cpu dependency from most of link.rsbjorn3-1/+1
2019-04-20Move some function from cg_llvm/back/link.rs to cg_ssa/back/link.rsbjorn3-2/+379
2019-03-19rustc: Update linker flavor inference from filenameAlex Crichton-8/+11
This commit fixes what is believed to be a preexisting bug in the linker flavor inference and additionally adds a new features. Previously if the linker didn't end in `exe` the entire file name was compared to infer the linker's flavor. This commit fixes the code to instead unconditionally inspect `file_stem()` which is the relevant part we're looking at to figure out what the linker flavor is. Additionally this commit now also adds recognition of `clang` and clang wrappers that end in `-clang` (which look like gcc wrappers). This should allow clang-specific wrappers to get correctly inferred to the `Gcc` linker flavor rather than the default linker flavor configured for a target.
2019-02-09librustc_codegen_ssa => 2018Taiki Endo-1/+1
2019-01-27Create `nvptx64-nvidia-cuda` target specificationDenys Zariaiev-0/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-13Stabilize `linker-flavor` flag.David Wood-5/+1
This commit moves the linker-flavor flag from a debugging option to a codegen option, thus stabilizing it. There are no feature flags associated with this flag.
2018-11-29Only consider stem when extension is exe.David Wood-1/+5
This commit modifies linker flavor inference to only remove the extension to the linker when performing inference if that extension is a 'exe'.
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-0/+208