-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Windows: Enable issue 70093 link tests #134918
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
@bors try |
Windows: Enable issue 70093 link tests `-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker. Marking as draft while I test if it actually *does* work, try-job: x86_64-msvc try-job: i686-msvc
☀️ Try build successful - checks-actions |
@bors try |
Windows: Enable issue 70093 link tests `-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker. Marking as draft while I test if it actually *does* work, try-job: i686-mingw try-job: x86_64-mingw-1
☀️ Try build successful - checks-actions |
All tests pass on windows-msvc and windows-gnu hosts, marking as ready for review. |
Can you do this with revisions like in https://github.com/rust-lang/rust/blob/2061630860906083681a32ed748e53bee4a03fb6/tests/ui/repr/repr-c-dead-variants.rs ? |
I can try but I'm uncertain if that will work due to cross-compiling. |
@bors try |
Windows: Enable issue 70093 link tests `-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker. try-job: x86_64-msvc try-job: i686-msvc try-job: i686-mingw try-job: x86_64-mingw-1
☀️ Try build successful - checks-actions |
6e562ec
to
7d5ff8b
Compare
That worked, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, one request for a test doc comment, but otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were the first time I'd heard of link-directives
and link-native-libraries
but I think I get the intent. Let me see what I can write.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for me, which is how I found out they had no MCPs nor tracking issues, and -Zlink-directives
I believe has zero documentation either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh, I think they have a lot of overlap with each other. And also with using the -l
compiler flag when used to override native libs (but that currently has a much more limited effect).
@rustbot author (doc comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, you can r=me after PR CI is green.
@bors r+ rollup |
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#134610 (Format `build.toml` consistently in platform support docs) - rust-lang#134918 (Windows: Enable issue 70093 link tests) - rust-lang#134953 (Fix doc for read&write unaligned in zst operation) - rust-lang#134956 (Account for C string literals and `format_args` in `HiddenUnicodeCodepoints` lint) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#134918 - ChrisDenton:issue-70093, r=jieyouxu Windows: Enable issue 70093 link tests Tracking issue for `-Z link-native-libraries`: rust-lang#134948 Tracking issue for `-Z link-directives`: rust-lang#134947 `-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.
Tracking issue for
-Z link-native-libraries
: #134948Tracking issue for
-Z link-directives
: #134947-Zlink-native-libraries=no
and-Zlink-directives=no
should work on Windows, at least for msvc. The fly in ointment is thatdefault-linker-libraries
doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implementdefault-linker-libraries
. Except it doesn't so we workaround that in the test by using-C link-arg
to talk to the linker.