Skip to content
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

Fix for https://github.com/rust-lang/libc/issues/2860 #2861

Merged
merged 1 commit into from Aug 8, 2022
Merged

Fix for https://github.com/rust-lang/libc/issues/2860 #2861

merged 1 commit into from Aug 8, 2022

Conversation

Tastaturtaste
Copy link
Contributor

@Tastaturtaste Tastaturtaste commented Aug 3, 2022

This PR is intended to fix #2860.
As indicated in the issue, this fix requires linking against "legacy_stdio_definitions.lib", which is only provided with Visual Studio >=15. I don't know how this could be checked conditionally at compile time though.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon.

Please see the contribution instructions for more information.

@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2022

It seems that we are linking against symbols that have been changed in the latest CRT? Could we change libc to link against the new symbols instead? The UCRT must expose some version of printf, right?

@rustbot ping windows

@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2022

Error: The feature ping is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2022

cc @ChrisDenton

@ChrisDenton
Copy link
Contributor

Yeah. these aren't exported by the ucrt and haven't been for a long time. IIRC printf &co are implemented in the C headers as wrappers around internal functions. So I guess the options are:

  1. Leave it up to users to workaround this issue (aka the status quo).
  2. Ignore the warnings and try to recreate the C headers in Rust using the internal symbols. This could break at any time.
  3. Reimplement prinf in libc
  4. Try to link legacy_stdio_definitions.lib which is a library that provide these (and other) symbols

@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2022

2 & 3 are straight out: we don't want this kind of maintenance burden on libc.

I think the best thing to do is to just link against legacy_stdio_definitions.

@bors r+

@bors
Copy link
Contributor

bors commented Aug 4, 2022

📌 Commit 2ec8995 has been approved by Amanieu

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 4, 2022

⌛ Testing commit 2ec8995 with merge 10bb48d...

bors added a commit that referenced this pull request Aug 4, 2022
Fix for #2860

This PR is intended to fix the issue #2860.
As indicated in the issue, this fix requires linking against "legacy_stdio_definitions.lib", [which is only provided with Visual Studio >=15](https://docs.microsoft.com/en-us/cpp/porting/overview-of-potential-upgrade-issues-visual-cpp?view=msvc-170#libraries). I don't know how this could be checked conditionally at compile time though.
@bors
Copy link
Contributor

bors commented Aug 4, 2022

💔 Test failed - checks-actions

@Tastaturtaste
Copy link
Contributor Author

Thanks for the review!
It seems the task runner for Docker Linux Tier2 (sparc64-unknown-linux-gnu) failed with some kind of timeout:

terminating on signal 15 from pid 2252 (timeout)

@JohnTitor
Copy link
Member

@bors retry

bors added a commit that referenced this pull request Aug 4, 2022
Fix for #2860

This PR is intended to fix the issue #2860.
As indicated in the issue, this fix requires linking against "legacy_stdio_definitions.lib", [which is only provided with Visual Studio >=15](https://docs.microsoft.com/en-us/cpp/porting/overview-of-potential-upgrade-issues-visual-cpp?view=msvc-170#libraries). I don't know how this could be checked conditionally at compile time though.
@bors
Copy link
Contributor

bors commented Aug 4, 2022

⌛ Testing commit 2ec8995 with merge 12f0b20...

@bors
Copy link
Contributor

bors commented Aug 4, 2022

💥 Test timed out

@JohnTitor
Copy link
Member

@bors retry

@bors
Copy link
Contributor

bors commented Aug 8, 2022

⌛ Testing commit 2ec8995 with merge af34f07...

@bors
Copy link
Contributor

bors commented Aug 8, 2022

☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Approved by: Amanieu
Pushing af34f07 to master...

@bors bors merged commit af34f07 into rust-lang:master Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error LNK2019: unresolved external symbol printf
7 participants