-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
macOS build is failing: SLICE.is_empty() #41
Comments
This bisects to rust-lang/rust#87570 so possibly the same issue as #40. |
It seems somewhat likely to me that this regression is somehow related to the change mentioned in rust-lang/rust#87570, specifically:
In the llvm docs the Perhaps rustc should continue to use |
From the rustc side, we could do the same as clang and use Though from #40 it sounds like this issue also affects ELF targets? My understanding here was that Ideally we'd expose both possibilities, e.g. |
After a bit more investigation into this, I think this is related to the specific linker (disclaimer: I know very little about linkers, and am probably wrong about this). Specifically, it appears that Based on that commit message, it seems like modern GNU ld changed from the behaviour which old GNU ld and lld use, which is why strategies like this have worked for the last 6 years (https://sourceware.org/bugzilla/show_bug.cgi?id=19167). Alternatively, it appears one could build with the linker flags |
this fixes the build on recent nightlies --- it appears the linker hax we use for tests breaks on recent `rust-lld`s due to upstream changes. see dtolnay/linkme#41 for details on a similar issue. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
I thought about just pretending to be libc (see summary and implementation of llvm/llvm-project@6d2d3bd) but that 7 extra chars which exacerbates #35. We could introduce a hash to turn the original symbol name into 9 a-zA-Z0-9 chars. That's 62^9 state space so by birthday paradox a good hash would have room for 62^4.5 = 116 million symbols, which seems fine. |
But wouldn't linkme still have "undefined behaviour" on ELF based platforms since |
This adds the `S_ATTR_NO_DEAD_STRIP` section attribute, which forces "unused" code to remain in the binary. This is paired with `S_REGULAR` to provide a required section type. This fixes dtolnay#41.
`#[used(linker)]` attribute See dtolnay/linkme#41 (comment).
The text was updated successfully, but these errors were encountered: