-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Glibc support for Firecracker #647
Conversation
They only differ by the ioctl() arguments expected so use #[cfg] to upport both. Signed-off-by: Anthony Liguori <[email protected]>
This allows more versions of rust to build Firecracker out of the box. Signed-off-by: Anthony Liguori <[email protected]>
It's presumptuous to overload the cargo target. musl, in particular, introduces a dependency on musl-gcc which is extremely hard to install depending on what your local configuration is. Instead allow users to specify the target in the more natural way. Signed-off-by: Anthony Liguori <[email protected]>
I think we need to wait a bit before changing the default target to
|
Will refactor this to avoid breaking jailer |
I think defaulting to glibc needs a more in-depth discussion.
It's actually the linking of Now, if built without Does building (this particular lib only) without |
Do we really need to depend on libbacktrace?
…On Mon, Nov 26, 2018, 12:18 PM Dan Horobeanu ***@***.*** wrote:
I think defaulting to glibc needs a more in-depth discussion.
cargo build would work out of the box with the musl target (without the
need to have musl libc installed on the host system), if it weren't for the
backtrace crate, which has an external C dependency - libbacktrace
<https://github.com/rust-lang-nursery/libbacktrace>. That's even if
libbacktrace doesn't depend on any particular libc flavor (it's compiled
with no-std).
It's actually the linking of libbacktrace that fails, and only if it's
compiled with GCC. It links just fine if compiled with clang. That's
because GCC defaults to -D_FORTIFY_SOURCE, relying on glibc specific
support for stack protection. musl uses a fully-inline approach
<https://wiki.musl-libc.org/open-issues.html#Substitute-for-%3Ccode%3E_FORTIFY_SOURCE%3C/code%3E>
to achieve the same result, so no specific support is needed in the object
code.
Now, if built without -D_FORTIFY_SOURCE, even against the glibc headers,
libbacktrace links just fine, and firecracker builds perfectly and passes
all the integration tests.
Does building (this particular lib only) without -D_FORTIFY_SOURCE
introduce any kind of risk?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#647 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGYoQ4_gN-NH9J4ZsOEosTjmb8b1GK5ks5uzEyHgaJpZM4YyGFy>
.
|
We currently use a stack trace lib to dump the trace into the log, in case of an unexpected panic. We couldn't find a rust-native alternative to libbacktrace. And, if it's C, chances are GCC will generate some of those stack protection calls. Barring a rust stack trace solution (or a similarly helpful troubleshooting mechanism), these are the options I can think of, in the order of my preference:
|
FYI, there is an ongoing effort to replace libbacktrace with a native Rust implementation in rustc |
+1 for using a rust-native alternative to libbacktrace |
Closing this due to no activity, please re-open if you still want to get it merge. |
This allows the standard rust toolchain to work out of the box. This makes Firecracker much more accessible for a typical user while still retaining the ability to build for musl.