-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking Issue for __rust_no_alloc_shim_is_unstable #123015
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
Comments
cc @bjorn3 -- wanted to file something official for this internal unstable detail (don't think anything existed already). |
#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 |
[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
[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
[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
[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 <strike>macOS and</strike> 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
[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 <strike>macOS and</strike> 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-zzz-job: x86_64-apple-1 try-zzz-job: x86_64-apple-2
After #127173, definitions of this symbol must be migrated to include the |
It should be to avoid breakage in the future, but currently there is an exception to not mangle this symbol for now. |
The allocator shim hack we have been using no longer works with upstream Rust. Replace it with a less-unsupported method: provide a rust-lang/rust#123015, which still requires us to provide a few symbol definitions. Bug: 408221149, 407024458 Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5 Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6427855 Reviewed-by: Alan Zhao <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Reviewed-by: Łukasz Anforowicz <[email protected]> Commit-Queue: Collin Baker <[email protected]> Auto-Submit: Collin Baker <[email protected]> Cr-Commit-Position: refs/heads/main@{#1442472}
…ion" This reverts commit cfa3bee. Reason for revert: LUCI Bisection has identified this change as the culprit of a build failure. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/compile-analysis/b/8718569842029294465 Sample failed build: https://ci.chromium.org/b/8718569842029294465 If this is a false positive, please report it at http://b.corp.google.com/createIssue?component=1199205&description=Analysis%3A+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F6427855&format=PLAIN&priority=P3&title=Wrongly+blamed+https%3A%2F%2Fci.chromium.org%2Fui%2Fp%2Fchromium%2Fbisection%2Fcompile-analysis%2Fb%2F8718569842029294465&type=BUG Original change's description: > Use #[global_allocator] to provide Rust allocator implementation > > The allocator shim hack we have been using no longer works with > upstream Rust. Replace it with a less-unsupported method: provide a > rust-lang/rust#123015, which still requires > us to provide a few symbol definitions. > > Bug: 408221149, 407024458 > Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5 > > Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel > Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6427855 > Reviewed-by: Alan Zhao <[email protected]> > Reviewed-by: Lei Zhang <[email protected]> > Reviewed-by: Łukasz Anforowicz <[email protected]> > Commit-Queue: Collin Baker <[email protected]> > Auto-Submit: Collin Baker <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1442472} > Bug: 408221149, 407024458 No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iea9e23aa18919381618a761629ff0f9e42e0441b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6432708 Commit-Queue: [email protected] <[email protected]> Owners-Override: [email protected] <[email protected]> Bot-Commit: [email protected] <[email protected]> Cr-Commit-Position: refs/heads/main@{#1442490}
…ion" This is a reland of commit cfa3bee Original was reverted due to a cronet gn2bp failure. The script filtered out GN rules in //build/rust/std, but this caused an exception when //build/rust/std:allocator was referenced later. Moving the rules to //build/rust/allocator sidesteps the issue. Original change's description: > Use #[global_allocator] to provide Rust allocator implementation > > The allocator shim hack we have been using no longer works with > upstream Rust. Replace it with a less-unsupported method: provide a > rust-lang/rust#123015, which still requires > us to provide a few symbol definitions. > > Bug: 408221149, 407024458 > Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5 > > Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel > Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6427855 > Reviewed-by: Alan Zhao <[email protected]> > Reviewed-by: Lei Zhang <[email protected]> > Reviewed-by: Łukasz Anforowicz <[email protected]> > Commit-Queue: Collin Baker <[email protected]> > Auto-Submit: Collin Baker <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1442472} Bug: 408221149, 407024458 Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel Change-Id: I36fef217297bfe64ae81519be24b8c653f6fdfa1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6432410 Reviewed-by: Mohannad Farrag <[email protected]> Reviewed-by: Łukasz Anforowicz <[email protected]> Auto-Submit: Collin Baker <[email protected]> Commit-Queue: Łukasz Anforowicz <[email protected]> Cr-Commit-Position: refs/heads/main@{#1442922}
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
The text was updated successfully, but these errors were encountered: