about summary refs log tree commit diff
path: root/compiler/rustc_session
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2023-05-06 09:09:30 +0900
committerGitHub <noreply@github.com>2023-05-06 09:09:30 +0900
commit923a5a2ca7c9d8d3f89d186e5d34918dc6522e25 (patch)
treee40751bbcb14895691b77cc4f17dc9ddffd28c35 /compiler/rustc_session
parentf9a6b71580cd53dd4491d9bb6400f7ee841d9c22 (diff)
parent1ece1ea48c0d9e4c8414abf872626f7a54747976 (diff)
downloadrust-923a5a2ca7c9d8d3f89d186e5d34918dc6522e25.tar.gz
rust-923a5a2ca7c9d8d3f89d186e5d34918dc6522e25.zip
Rollup merge of #109677 - dpaoliello:rawdylib, r=michaelwoerister,wesleywiser
Stabilize raw-dylib, link_ordinal, import_name_type and -Cdlltool

This stabilizes the `raw-dylib` feature (#58713) for all architectures (i.e., `x86` as it is already stable for all other architectures).

Changes:
* Permit the use of the `raw-dylib` link kind for x86, the `link_ordinal` attribute and the `import_name_type` key for the `link` attribute.
* Mark the `raw_dylib` feature as stable.
* Stabilized the `-Zdlltool` argument as `-Cdlltool`.
* Note the path to `dlltool` if invoking it failed (we don't need to do this if `dlltool` returns an error since it prints its path in the error message).
* Adds tests for `-Cdlltool`.
* Adds tests for being unable to find the dlltool executable, and dlltool failing.
* Fixes a bug where we were checking the exit code of dlltool to see if it failed, but dlltool always returns 0 (indicating success), so instead we need to check if anything was written to `stderr`.

NOTE: As previously noted (https://github.com/rust-lang/rust/pull/104218#issuecomment-1315895618) using dlltool within rustc is temporary, but this is not the first time that Rust has added a temporary tool use and argument: https://github.com/rust-lang/rust/pull/104218#issuecomment-1318720482

Big thanks to ``````@tbu-`````` for the first version of this PR (#104218)
Diffstat (limited to 'compiler/rustc_session')
-rw-r--r--compiler/rustc_session/src/options.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index d9e191c00c9..243da98c3c2 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -1235,6 +1235,8 @@ options! {
         line-tables-only, limited, or full; default: 0)"),
     default_linker_libraries: bool = (false, parse_bool, [UNTRACKED],
         "allow the linker to link its default libraries (default: no)"),
+    dlltool: Option<PathBuf> = (None, parse_opt_pathbuf, [UNTRACKED],
+        "import library generation tool (ignored except when targeting windows-gnu)"),
     embed_bitcode: bool = (true, parse_bool, [TRACKED],
         "emit bitcode in rlibs (default: yes)"),
     extra_filename: String = (String::new(), parse_string, [UNTRACKED],
@@ -1391,8 +1393,6 @@ options! {
         (default: no)"),
     diagnostic_width: Option<usize> = (None, parse_opt_number, [UNTRACKED],
         "set the current output width for diagnostic truncation"),
-    dlltool: Option<PathBuf> = (None, parse_opt_pathbuf, [UNTRACKED],
-        "import library generation tool (windows-gnu only)"),
     dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
         "emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) \
         (default: no)"),