summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back
AgeCommit message (Collapse)AuthorLines
2022-10-24Support raw-dylib functions being used inside inlined functionsDaniel Paoliello-5/+37
2022-10-23Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`sJakub Beránek-4/+9
2022-10-23Allow LTO for dylibsbjorn3-11/+29
2022-10-23Add missing export for the oom strategy symbolbjorn3-1/+10
2022-10-22Auto merge of #103240 - BelovDV:issue-102290, r=petrochenkovbors-0/+4
Add architectures to fn create_object_file Fixes #102290 r? `@petrochenkov`
2022-10-22Auto merge of #103196 - Nilstrieb:no-meta-query, r=cjgillotbors-1/+1
Get rid of native_library projection queries They don't seem particularly useful as I don't expect native libraries to change frequently. Maybe they do provide significant value of keeping incremental compilation green though, I'm not sure.
2022-10-20Auto merge of #103092 - petrochenkov:weaklto, r=wesleywiserbors-1/+1
linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO In https://github.com/rust-lang/rust/pull/100404 this logic was originally disabled for MSVC due to issues with LTO, but the same issues appear on windows-gnu with LLD because that LLD uses the same underlying logic as MSVC LLD, just with re-syntaxed command line options. So this PR just disables it for LTO builds in general.
2022-10-19Get rid of native_library projection queriesnils-1/+1
They don't seem particularly useful as I don't expect native libraries to change frequently.
2022-10-19Add architectures to fn create_object_fileDaniil Belov-0/+4
2022-10-18Auto merge of #102418 - citrus-it:illumos-strip-debug, r=nagisabors-9/+40
The illumos linker does not support --strip-debug When building and testing rust 1.64.0 on illumos, we saw a large number of failing tests associated with: ``` = note: ld: fatal: unrecognized option '--strip-debug' ld: fatal: use the -z help option for usage information collect2: error: ld returned 1 exit status ``` The illumos linker does not support the `--strip-debug` option (although it does support `--strip-all`).
2022-10-15linker: Fix weak lang item linking with combination windows-gnu + LLD + LTOVadim Petrochenkov-1/+1
2022-10-15The illumos linker does not support --strip-debugAndy Fiddaman-9/+40
2022-10-12Rollup merge of #102623 - davidtwco:translation-eager, r=compiler-errorsDylan DPC-2/+5
translation: eager translation Part of #100717. See [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/295010720) for additional context. - **Store diagnostic arguments in a `HashMap`**: Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. - **Add `AddToDiagnostic::add_to_diagnostic_with`**: `AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. - **Add `DiagnosticMessage::Eager`**: Add variant of `DiagnosticMessage` for eagerly translated messages (messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation. - **Support `#[subdiagnostic(eager)]`**: Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`. - **Finish migrating `rustc_query_system`**: Using eager translation, migrate the remaining repeated cycle stack diagnostic. - **Split formatting initialization and use in diagnostic derives**: Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move. This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg` anyway. However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as: let diag = { /* create diagnostic */ }; diag.span_suggestion_with_style( span, fluent::crate::slug, format!("{}", __binding_0), Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.emit(); For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first. Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition. By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added. let diag = { /* create diagnostic */ }; let __code_0 = format!("{}", __binding_0); /* + other formatting */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.span_suggestion_with_style( span, fluent::crate::slug, __code_0, Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.emit(); - **Remove field ordering logic in diagnostic derive:** Following the approach taken in earlier commits to separate formatting initialization from use in the subdiagnostic derive, simplify the diagnostic derive by removing the field-ordering logic that previously solved this problem. r? ```@compiler-errors```
2022-10-10errors: use `HashMap` to store diagnostic argsDavid Wood-2/+5
Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-07ADD - implement IntoDiagnostic for thorin::Error wrapperJhonny Bill Mena-2/+1
2022-10-07Address PR commentsJhonny Bill Mena-11/+5
- UPDATE - revert migration of logs - UPDATE - use derive on LinkRlibError enum - [Gardening] UPDATE - alphabetically sort fluent_messages - UPDATE - use PathBuf and unify both AddNativeLibrary to use Display (which is what PathBuf uses when conforming to IntoDiagnosticArg) - UPDATE - fluent messages sort after rebase
2022-10-07ADD - initial port of link.rsJhonny Bill Mena-52/+37
2022-10-07UPDATE - resolve fixme and emit errors via HandlerJhonny Bill Mena-13/+6
2022-10-07UPDATE - migrate write.rs to new diagnostics infraJhonny Bill Mena-22/+19
2022-10-07UPDATE - migrate linker.rs to new diagnostics infraJhonny Bill Mena-18/+17
2022-10-07UPDATE - LibDefWriteFailure to accept type instead of formatted stringJhonny Bill Mena-6/+6
This follows team’s suggestions in this thread https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20diag.20translation/near/295305249
2022-10-07ADD - migrate lib.def write fatal errorJhonny Bill Mena-3/+4
This diagnostic has no UI test 🤔 Should we add some? If so, how?
2022-10-07Auto merge of #102767 - matthiaskrgr:rollup-vcbt81v, r=matthiaskrgrbors-2/+3
Rollup of 6 pull requests Successful merges: - #102577 (Warn about Visual Studio Code branding confusion) - #102720 (do not reverse the expected type and found type for ObligationCauseCo…) - #102744 (rustdoc: remove unused CSS `.content .item-list`) - #102747 (rustdoc: remove unused CSS `.docblock a:not(.srclink)`) - #102748 (Disable compressed debug sections on i586-gnu) - #102761 (let-else: test else block with non-never uninhabited type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-07Rollup merge of #102577 - kornelski:non-code-visual-studio, r=wesleywiserMatthias Krüger-2/+3
Warn about Visual Studio Code branding confusion VS Code is a popular companion for Rust, but Microsoft's branding is confusing, and users [may not understand](https://users.rust-lang.org/t/complie-error-when-i-run-rustc/82127) they also need the *other* VS.
2022-10-07Auto merge of #101988 - petrochenkov:flavor2, r=lqdbors-75/+82
rustc_target: Refactor internal linker flavors In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595 `lld_flavor` and `linker_is_gnu` fields are removed from internal target specs, but still parsed from JSON specs using compatibility layer introduced in https://github.com/rust-lang/rust/pull/100552. r? `@lqd`
2022-10-06Warn about Visual Studio Code branding confusionKornel-2/+3
2022-10-06Rollup merge of #102725 - nnethercote:rm-Z-time, r=davidtwcoMatthias Krüger-1/+1
Remove `-Ztime` Because it has a lot of overlap with `-Ztime-passes` but is generally less useful. Plus some related cleanups. Best reviewed one commit at a time. r? `@davidtwco`
2022-10-06rustc_target: Refactor internal linker flavorsVadim Petrochenkov-75/+82
In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595
2022-10-06Remove `-Ztime` option.Nicholas Nethercote-1/+1
The compiler currently has `-Ztime` and `-Ztime-passes`. I've used `-Ztime-passes` for years but only recently learned about `-Ztime`. What's the difference? Let's look at the `-Zhelp` output: ``` -Z time=val -- measure time of rustc processes (default: no) -Z time-passes=val -- measure time of each rustc pass (default: no) ``` The `-Ztime-passes` description is clear, but the `-Ztime` one is less so. Sounds like it measures the time for the entire process? No. The real difference is that `-Ztime-passes` prints out info about passes, and `-Ztime` does the same, but only for a subset of those passes. More specifically, there is a distinction in the profiling code between a "verbose generic activity" and an "extra verbose generic activity". `-Ztime-passes` prints both kinds, while `-Ztime` only prints the first one. (It took me a close reading of the source code to determine this difference.) In practice this distinction has low value. Perhaps in the past the "extra verbose" output was more voluminous, but now that we only print stats for a pass if it exceeds 5ms or alters the RSS, `-Ztime-passes` is less spammy. Also, a lot of the "extra verbose" cases are for individual lint passes, and you need to also use `-Zno-interleave-lints` to see those anyway. Therefore, this commit removes `-Ztime` and the associated machinery. One thing to note is that the existing "extra verbose" activities all have an extra string argument, so the commit adds the ability to accept an extra argument to the "verbose" activities.
2022-09-29Only export `__tls_*` on wasm32-unknown-unknown.Dan Gohman-6/+9
From talking with @abrown, we aren't planning to have hosts call these `__tls_*` functions; instead, TLS initialization will be handled transparently within libc. Consequently, these functions don't need to be exported. Leave them exported on wasm32-unknown-unknown though, as wasm-bindgen does call them.
2022-09-29Rollup merge of #102426 - sunfishcode:sunfishcode/no-wasm-init-memory, r=nagisaMichael Howell-6/+0
Don't export `__wasm_init_memory` on WebAssembly. Since #72889, the Rust wasm target doesn't use --passive-segments, so remove the `--export=__wasm_init_memory`. As documented in the [tool-conventions Linking convention], `__wasm_init_memory` is not intended to be exported. [tool-conventions Linking convention]: https://github.com/WebAssembly/tool-conventions/blob/7c064f304858f67ebf22964a84b7e9658e29557a/Linking.md#shared-memory-and-passive-segments
2022-09-28Don't export `__wasm_init_memory` on WebAssembly.Dan Gohman-6/+0
Since #72889, the Rust wasm target doesn't use --passive-segments, so remove the `--export=__wasm_init_memory`. As documented in the [tool-conventions Linking convention], `__wasm_init_memory` is not intended to be exported. [tool-conventions Linking convention]: https://github.com/WebAssembly/tool-conventions/blob/7c064f304858f67ebf22964a84b7e9658e29557a/Linking.md#shared-memory-and-passive-segments
2022-09-27Don't export `__heap_base` and `__data_end` on wasm32-wasi.Dan Gohman-4/+6
`__heap_base` and `__data_end` are exported for use by wasm-bindgen, which uses the wasm32-unknown-unknown target. On wasm32-wasi, as a step toward implementing the Canonical ABI, and as an aid to building speicalized WASI API polyfill wrappers, don't export `__heap_base` and `__data_end` on wasm32-wasi.
2022-09-25Rollup merge of #101997 - cuviper:drop-legacy-pm, r=nikicfee1-dead-2/+0
Remove support for legacy PM This removes support for optimizing with LLVM's legacy pass manager, as well as the unstable `-Znew-llvm-pass-manager` option. We have been defaulting to the new PM since LLVM 13 (except for s390x that waited for 14), and LLVM 15 removed support altogether. The only place we still use the legacy PM is for writing the output file, just like `llc` does. cc #74705 r? ``@nikic``
2022-09-22Rollup merge of #101598 - chriswailes:sanitizers, r=nagisa,eholkDylan DPC-5/+6
Update rustc's information on Android's sanitizers This patch updates sanitizer support definitions for Android inside the compiler. It also adjusts the logic to make sure no pre-built sanitizer runtime libraries are emitted as these are instead provided dynamically on Android targets.
2022-09-20Update rustc's information on Android's sanitizersChris Wailes-5/+6
This patch updates sanitizier support definitions for Android inside the compiler. It also adjusts the logic to make sure no pre-built sanitizer runtime libraries are emitted as these are instead provided dynamically on Android targets.
2022-09-20fix verbatim with upstream dependenciesbors-6/+12
https://github.com/rust-lang/rust/issues/99425#issuecomment-1207224161 r? `@petrochenkov`
2022-09-18Remove -Znew-llvm-pass-managerJosh Stone-2/+0
2022-09-13Auto merge of #100101 - BelovDV:issue-99429, r=petrochenkovbors-46/+128
change rlib format to distinguish native dependencies Another one method to solve problem mentioned in #99429. Changed .rlib format, it contains all bundled native libraries as archieves. At link time rlib is unpacked and native dependencies linked separately. New behavior hidden under separate_native_rlib_dependencies flag.
2022-09-12change rlib format to discern native dependenciesDaniil Belov-46/+128
2022-09-12Rollup merge of #100767 - kadiwa4:escape_ascii, r=jackh726Dylan DPC-17/+8
Remove manual <[u8]>::escape_ascii `@rustbot` label: +C-cleanup
2022-09-06Fix CI failures on windows and aarch64-linuxVadim Petrochenkov-0/+8
2022-09-06change stdlib circular dependencies handlingDaniil Belov-102/+8
2022-09-02Rollup merge of #100200 - petrochenkov:zgccld2, r=lqd,Mark-SimulacrumMatthias Krüger-14/+18
Change implementation of `-Z gcc-ld` and `lld-wrapper` again This PR partially reverts https://github.com/rust-lang/rust/pull/97375 and uses the strategy described in https://github.com/rust-lang/rust/issues/97402#issuecomment-1147404520 instead, thus fixes https://github.com/rust-lang/rust/issues/97755.
2022-09-01rustc_target: Refactor internal linker flavors slightlyVadim Petrochenkov-26/+22
Remove one unstable user-facing linker flavor (l4-bender)
2022-09-01rustc_target: Add a compatibility layer to separate internal and user-facing ↵Vadim Petrochenkov-1/+2
linker flavors
2022-09-01Auto merge of #100707 - dzvon:fix-typo, r=davidtwcobors-1/+1
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Rollup merge of #100753 - LuisCardosoOliveira:translation-migrate-session, ↵Ralf Jung-1/+1
r=davidtwco translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1 ## Description This is the first PR for the migration of the module `rustc_session`. You can follow my progress [here](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883). The PR migrates the files `cgu_reuse_tracker` and `parse.rs` to use `SessionDiagnostic `.
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-28Auto merge of #92845 - Amanieu:std_personality, r=Mark-Simulacrumbors-11/+7
Move EH personality functions to std These were previously in the panic_unwind crate with dummy stubs in the panic_abort crate. However it turns out that this is insufficient: we still need a proper personality function even with -C panic=abort to handle the following cases: 1) `extern "C-unwind"` still needs to catch foreign exceptions with -C panic=abort to turn them into aborts. This requires landing pads and a personality function. 2) ARM EHABI uses the personality function when creating backtraces. The dummy personality function in panic_abort was causing backtrace generation to get stuck in a loop since the personality function is responsible for advancing the unwind state to the next frame. Fixes #41004