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

Tracking Issue for extern_system_varargs #136946

Open
1 of 4 tasks
workingjubilee opened this issue Feb 12, 2025 · 8 comments
Open
1 of 4 tasks

Tracking Issue for extern_system_varargs #136946

workingjubilee opened this issue Feb 12, 2025 · 8 comments
Labels
A-ABI Area: Concerning the application binary interface (ABI) C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Feb 12, 2025

This is a tracking issue for enabling using an extern "system" function with varargs.
The feature gate for the issue is #![feature(extern_system_varargs)].

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions

Implementation history

@workingjubilee workingjubilee added A-ABI Area: Concerning the application binary interface (ABI) C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Feb 12, 2025
jhpratt added a commit to jhpratt/rust that referenced this issue Feb 13, 2025
…stem-varargs, r=compiler-errors

Split out the `extern_system_varargs` feature

After the stabilization PR was opened, `extern "system"` functions were added to `extended_varargs_abi_support`. This has a number of questions regarding it that were not discussed and were somewhat surprising. It deserves to be considered as its own feature, separate from `extended_varargs_abi_support`.

Tracking issue:
- rust-lang#136946
jhpratt added a commit to jhpratt/rust that referenced this issue Feb 13, 2025
…stem-varargs, r=compiler-errors

Split out the `extern_system_varargs` feature

After the stabilization PR was opened, `extern "system"` functions were added to `extended_varargs_abi_support`. This has a number of questions regarding it that were not discussed and were somewhat surprising. It deserves to be considered as its own feature, separate from `extended_varargs_abi_support`.

Tracking issue:
- rust-lang#136946
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2025
Rollup merge of rust-lang#136948 - workingjubilee:split-off-extern-system-varargs, r=compiler-errors

Split out the `extern_system_varargs` feature

After the stabilization PR was opened, `extern "system"` functions were added to `extended_varargs_abi_support`. This has a number of questions regarding it that were not discussed and were somewhat surprising. It deserves to be considered as its own feature, separate from `extended_varargs_abi_support`.

Tracking issue:
- rust-lang#136946
@RalfJung
Copy link
Member

RalfJung commented Feb 14, 2025

we have previously rejected implementing MSVC's oddities:

You keep saying this and I keep correcting you.^^
We have implemented their oddities on Windows targets: stdcall works on x86_64-pc-windows-msvc and even aarch64-pc-windows-msvc. There was some discussion about this here and here.

@workingjubilee
Copy link
Member Author

Yes yes, I copied some text around, so you get to copy some text around too.

If extern "stdcall" is downgraded to extern "C" anyways when variable arguments are involved on MSVC targets, why doesn't that apply to extern "stdcall" for all cases where the ABI is supported?

@workingjubilee
Copy link
Member Author

At least if we did that, it would be... well, absurd, I think, but equally absurd in all cases?

@RalfJung
Copy link
Member

RalfJung commented Feb 14, 2025

I don't understand the question / proposal. This does apply in all cases, no?

@ChrisDenton
Copy link
Member

stdcall works on x86_64-pc-windows-msvc and even aarch64-pc-windows-msvc.

That is not true for the raw-dylib feature, which is stricter.

@workingjubilee
Copy link
Member Author

I don't understand the question / proposal. This does apply in all cases, no?

Currently rustc_hir_analysis will reject an attempt to use a variable argument function with extern "stdcall", such as extern "stdcall" fn(i32, ...), without further consideration.

@RalfJung
Copy link
Member

Currently rustc_hir_analysis will reject an attempt to use a variable argument function with extern "stdcall", such as extern "stdcall" fn(i32, ...), without further consideration.

I guess the argument is that MSVC accepts varagrs for system but not for stdcall? Or is that not correct?

That is not true for the raw-dylib feature, which is stricter.

Oh, that is an odd inconsistency... I filed a separate issue for that: #137018.

@workingjubilee
Copy link
Member Author

workingjubilee commented Feb 14, 2025

I guess the argument is that MSVC accepts varagrs for system but not for stdcall? Or is that not correct?

extern "system" is a Rust invention, as far as I am aware.

@workingjubilee workingjubilee added T-lang Relevant to the language team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 14, 2025
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this issue Feb 17, 2025
…rgs, r=compiler-errors

Split out the `extern_system_varargs` feature

After the stabilization PR was opened, `extern "system"` functions were added to `extended_varargs_abi_support`. This has a number of questions regarding it that were not discussed and were somewhat surprising. It deserves to be considered as its own feature, separate from `extended_varargs_abi_support`.

Tracking issue:
- rust-lang/rust#136946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ABI Area: Concerning the application binary interface (ABI) C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants