-
Notifications
You must be signed in to change notification settings - Fork 483
libbacktrace symbols rexporting? #189
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
I don't know enough about this space to offer useful thoughts, but this sounds vaguely related to #78 |
I am also running into this, building a rust cdylib invoked from Java, depending on what code I invoke I see:
looks like under the hood it's using backtrace + error-chain. |
@Rustacian I think your problem might be different. I am not sure where librust's |
@mfarrugi thanks for the response. I'll open up a separate issue tomorrow with a minimal reproducing example if that's alright. It may very well be an unrelated issue. |
Uh oh!
There was an error while loading. Please reload this page.
This one is going to be tricky.
The rust bug report is rust-lang/rust#58132, but it could easily be something in rules_rust, since we manipulate the linker.
Looks like something is causing libbacktrace symbols hiding out in
libstd
to ?maybe? reappear in static library artifacts. This could berules_rust
or something in rust proper. I am leaning towards something be incorrect w.r.t the linker being GCC.How to reproduce
This is GCC and sanitizer specific, wont trigger without sanitizer flags and wont happen on clang (for reasons outlined below)
The following builds a stub for the regex crate capi, which allows the crate to be used from C/C++.
... causes librure_impl.a to contain backtrace symbols (like so)
This seems to appear at the static library step, the rlibs lack these symbols. Messing with the link args in
rustc.bzl
to drop out sanitizer flags does not seem to prevent the definition of libbacktrace symbols appearing in the static lib.This does not cause an issue without doing a sanitizer link. GCC itself uses libbacktrace as part of ASAN to provide symbolisation, and it seems that those synbols are not hidden in asan. Clang does not use libbacktrace, but instead calls out to an external application (
llvm-symboliser
) to perform this function.A extremely unpleasant work around is to abuse
strip
to rip out the unwanted symbols with the followingBUILD
fileWhich I suspect is really really really fragile
Thoughts?
The text was updated successfully, but these errors were encountered: