Skip to content

libbacktrace symbols are exposed from libstd #34984

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

Closed
alexcrichton opened this issue Jul 23, 2016 · 6 comments
Closed

libbacktrace symbols are exposed from libstd #34984

alexcrichton opened this issue Jul 23, 2016 · 6 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@alexcrichton
Copy link
Member

We should compile libbacktrace I... think with -fvisibility=hidden, but I don't think that we are. This causes the symbols to be exported when they shouldn't be:

$ echo '#[no_mangle] pub extern fn foo() { panic!() }' > foo.rs
$ echo 'extern void foo(); int main() { foo(); return 0; }' > foo.c
$ rustc foo.rs --crate-type staticlib -C lto
$ gcc foo.c libfoo.a
$ nm -g ./a.out | grep backtrace_
0000000000512a7b T backtrace_alloc
000000000051131b T backtrace_close
0000000000511365 T backtrace_create_state
00000000005181c4 T backtrace_dwarf_add
0000000000512c5c T backtrace_free
00000000005128dd T backtrace_get_view
0000000000512772 T backtrace_initialize
0000000000511277 T backtrace_open
0000000000511192 T backtrace_pcinfo
0000000000518320 T backtrace_qsort
00000000005129d7 T backtrace_release_view
0000000000511202 T backtrace_syminfo
0000000000512eb7 T backtrace_vector_finish
0000000000512d12 T backtrace_vector_grow
0000000000512f01 T backtrace_vector_release

cc https://bugzilla.mozilla.org/show_bug.cgi?id=1288173
cc @froydnj

@alexcrichton alexcrichton added the A-linkage Area: linking into static, shared libraries and binaries label Jul 23, 2016
@alexcrichton
Copy link
Member Author

This should be a relatively easy bug to tackle if anyone's interested, but I'm not convinced of the solution so I'm not gonna tag E-easy just yet. If you've got a Linux machine though it'd be great to play around on!

@alexcrichton
Copy link
Member Author

For reference we compile libbacktrace in two places currently:

Both will need to be modified with the same solution once we figure it out.

@alexcrichton alexcrichton added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Jul 23, 2016
@nxnfufunezn
Copy link
Contributor

I would like to give it a shot..

@alexcrichton
Copy link
Member Author

Sure thing, thanks @nxnfufunezn! If you need any help feel free to ping me here or on IRC

@munyari
Copy link
Contributor

munyari commented Aug 22, 2016

If @nxnfufunezn isn't working on this, I'd like to take it on

@nxnfufunezn
Copy link
Contributor

@munyari sure..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

3 participants