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 __rust_no_alloc_shim_is_unstable #123015

Open
1 of 3 tasks
Mark-Simulacrum opened this issue Mar 24, 2024 · 2 comments
Open
1 of 3 tasks

Tracking Issue for __rust_no_alloc_shim_is_unstable #123015

Mark-Simulacrum opened this issue Mar 24, 2024 · 2 comments
Labels
A-allocators Area: Custom and system allocators A-linkage Area: linking into static, shared libraries and binaries C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@Mark-Simulacrum
Copy link
Member

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.

Steps

Unresolved Questions

Implementation history

@Mark-Simulacrum Mark-Simulacrum added A-linkage Area: linking into static, shared libraries and binaries A-allocators Area: Custom and system allocators T-lang Relevant to the language team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Mar 24, 2024
@Mark-Simulacrum
Copy link
Member Author

cc @bjorn3 -- wanted to file something official for this internal unstable detail (don't think anything existed already).

@bjorn3
Copy link
Member

bjorn3 commented Mar 25, 2024

#102318 is not really useful as the alloc error handler is still part of the allocator shim. #112331 would entirely remove the allocation error handler. After that the allocator shim only contains the __rust_alloc_error_handler_should_panic static when #[global_allocator] is used. Maybe a weak static in liballoc with the default value when -Zoom is not passed would work for that?

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 20, 2024
[WIP] Use weak linkage instead of compiler generated shims

rust-lang#86844 (unstably) made it possible to avoid the allocator shim when using `#[global_allocator]`. This PR makes it possible to also avoid the allocator shim when using the default allocator in libstd by making use of weak linkage. Eventual stabilization of avoiding the allocator shim may be blocked on it working with the default allocator too.

This is still keeping the `__rust_no_alloc_shim_is_unstable` symbol for now until rust-lang#123015 gets stabilized.

TODO: Update comments everywhere, test on macOS and Windows and write a better PR description why we want this. Also prevent codegen of weak symbols when there is a non-weak definition of the same symbol in the same codegen unit.

try-job: x86_64-msvc
try-job: x86_64-apple-1
try-job: x86_64-apple-2
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 20, 2024
[WIP] Use weak linkage instead of compiler generated shims

rust-lang#86844 (unstably) made it possible to avoid the allocator shim when using `#[global_allocator]`. This PR makes it possible to also avoid the allocator shim when using the default allocator in libstd by making use of weak linkage. Eventual stabilization of avoiding the allocator shim may be blocked on it working with the default allocator too.

This is still keeping the `__rust_no_alloc_shim_is_unstable` symbol for now until rust-lang#123015 gets stabilized.

TODO: Update comments everywhere, test on macOS and Windows and write a better PR description why we want this. Also prevent codegen of weak symbols when there is a non-weak definition of the same symbol in the same codegen unit.

try-job: x86_64-msvc
try-job: x86_64-apple-1
try-job: x86_64-apple-2
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 20, 2024
[WIP] Use weak linkage instead of compiler generated shims

rust-lang#86844 (unstably) made it possible to avoid the allocator shim when using `#[global_allocator]`. This PR makes it possible to also avoid the allocator shim when using the default allocator in libstd by making use of weak linkage. Eventual stabilization of avoiding the allocator shim may be blocked on it working with the default allocator too.

This is still keeping the `__rust_no_alloc_shim_is_unstable` symbol for now until rust-lang#123015 gets stabilized.

TODO: Update comments everywhere, test on macOS and Windows and write a better PR description why we want this. Also prevent codegen of weak symbols when there is a non-weak definition of the same symbol in the same codegen unit.

try-zzz-job: x86_64-msvc
try-job: x86_64-apple-1
try-job: x86_64-apple-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-allocators Area: Custom and system allocators A-linkage Area: linking into static, shared libraries and binaries C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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

2 participants