-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fix cross-compilation for static,vendored #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W00t, this is great! Feeling a tad uneasy about the unconditional setting of --host
, but I think it's the right thing to do and if we got some target wrong we can add it as supported in CI later.
I don't see a reason why we'd need the demangler, but it's possible libbpf
may need/use it for uprobe attachment or similar? @anakryiko does libbpf
use/rely on demangling functionality somewhere?
Yes. I think that's the right way to go. For riscv64, rust uses
For reference, here's a workflow run with elfutils 0.190 without |
Got it. But it was being enabled with the current snapshot in |
7d26b5d
to
3e88ce2
Compare
It seems that for elfutils 0.189. the demangler support requires libstdc++ already. |
A quick configure.ac
497:AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl
499:AM_CONDITIONAL(DEMANGLE, test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes")
500:AS_IF([test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes"],
502: [AC_MSG_ERROR([[__cxa_demangle not found in libstdc++, use --disable-demangler to disable demangler support.]])]),
ChangeLog
16: __cxa_demangle cannot be found.
827: * configure.ac: Check for __cxa_demangle in libstdc++.
src/stack.c
238: char *dsymname = __cxa_demangle (symname, demangle_buffer,
src/nm.c
811: char *dmsymstr = __cxa_demangle (symstr, demangle_buffer,
964: char *dmsymstr = __cxa_demangle (symstr, demangle_buffer,
1096: char *dmsymstr = __cxa_demangle (symstr, demangle_buffer,
1375: char *dmsymstr = __cxa_demangle (symstr, demangle_buffer,
src/addr2line.c
293: char *dsymname = __cxa_demangle (name, demangle_buffer,
lib/system.h
204:extern char *__cxa_demangle (const char *mangled_name, char *output_buffer,
lib/ChangeLog
318: * system.h: Declare __cxa_demangle. |
Previously, build.rs builds all elfutils including other libraries that we actually don't need and that will require C++ toolchains for elfutils>=0.190 This commit passes --disable-demangler when configuring elfutils to remove C++ dependency and changes build.rs to only build libelf when building elfutils. It shortens the build time significantly. (From 22 seconds to 13 seconds for a clean build on my machine)
3e88ce2
to
3d9ba99
Compare
No, libbpf doesn't do any demangling. |
Hi @danielocfb, it would be nice if you could release a new version of libbpf-sys to make the fix available on crates.io. |
Yes, we should do that. Will probably take a few days if that's alright. I want to get #98 in first. |
We just released https://crates.io/crates/libbpf-sys/1.4.5+v1.4.5 |
This PR fixes cross-compilation for static,vendored.