-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustllvm: Use .init_array rather than .ctors #71234
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @cuviper (rust_highfive has picked a reviewer for you, use r? to override) |
We've been talking about compatibility on #71233 -- let's get a real CI build that I can actually test on an old @bors try You also mentioned the possibility of a |
⌛ Trying commit 1d84563f375a5977ffa8eb640aa80a84959b4bf1 with merge b87bd037d8b09eee9115142adb1d61112cb4865c... |
⌛ Trying commit 1d84563f375a5977ffa8eb640aa80a84959b4bf1 with merge ab42f00561856008c3af29d224b26c802e4563d2... |
Sorry about that -- I didn't see bors responding, and now I got it twice... oh well. |
@bors try |
⌛ Trying commit 1d84563f375a5977ffa8eb640aa80a84959b4bf1 with merge 04ec1be6a7a65dd0304d2b35993ae7daf7abbc13... |
I added in |
I've made the requested changes. |
☔ The latest upstream changes (presumably #71374) made this pull request unmergeable. Please resolve the merge conflicts. |
When you rebase over #71374 please make sure you preserve the new alphabetical order. Also, it looks like you haven't updated the tests, please see the new comment at the top of |
I've rebased the patch and added the test entry nnethercote asked for. |
LLVM TargetMachines default to using the (now-legacy) .ctors representation of init functions. Mixing .ctors and .init_array representations can cause issues when linking with lld. This happens in practice for: * Our profiling runtime which is currently implicitly built with .init_array since it is built by clang, which sets this field. * External C/C++ code that may be linked into the same process. To support legacy systems which may use .ctors, targets may now specify that they use .ctors via the use_ctors attribute which defaults to false. For debugging and manual control, -Z use-ctors-section=yes/no will allow manual override. Fixes: rust-lang#71233
The patch looks OK, but I'd like a second opinion on making this change -- maybe @joshtriplett? |
This seems reasonable to me; we should certainly use |
@bors r+ |
📌 Commit 0e7d5be has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#69406 (upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir) - rust-lang#71185 (Move tests from `test/run-fail` to UI) - rust-lang#71234 (rustllvm: Use .init_array rather than .ctors) - rust-lang#71508 (Simplify the `tcx.alloc_map` API) - rust-lang#71555 (Remove ast::{Ident, Name} reexports.) Failed merges: r? @ghost
LLVM TargetMachines default to using the (now-legacy) .ctors
representation of init functions. Mixing .ctors and .init_array
representations can cause issues when linking with lld.
This happens in practice for:
.init_array since it is built by clang, which sets this field.
Fixes: #71233