-
Notifications
You must be signed in to change notification settings - Fork 12
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
Document compatible target? #27
Comments
Below is unrelated to issue addressed above ( Slightly off-topic, but might have some relevance. I noticed
|
Yes, Eyra works by implementing the existing C ABIs. Currently it's only compatible with "-gnu" ABIs. There's no fundamental reason "-musl" ABIs couldn't be supported, it just hasn't been implemented yet. It's an interesting question whether that's worth implementing; Eyra doesn't use any of the glibc or musl libraries itself, so the choice of target doesn't matter that much to Eyra. And yes, thanks for pointing out that that's not documented in the README.md; I've now posted #28.
I needed to add
Eyra itself doesn't provide a panic handler; Eyra depends on libraries that depend on Eyra previously didn't support That said, this no-std mode doesn't currently support
Eyra doesn't have this limitation. It can statically link without depending on system NSS libraries. It resolves NSS queries by invoking the |
Thanks for the great response and PRs to address feedback! ❤️ No pressure to read what follows and reply, it is mostly additional information to benefit myself and any future readers.
Ah ok, so nightly either way. I had found the same fix last night but for the
Might have been a typo on your end, but It will build a functional binary without that arg present though 👍
|
) * Mention that Eyra currently requires a `*-gnu` target in README.md. See #27. * Update README.md Co-authored-by: Brennan Kinney <[email protected]> --------- Co-authored-by: Brennan Kinney <[email protected]>
Thanks for the detailed report! The questions here seem answered, so I'll close this now, though feel free to reopen or file new issues if there's anything to add here. |
UPDATE (7th Oct 2024):
no_std
examples) a revised unified reference example can be found at: docs:hello-world-small
example size update #50no_std
additions specific to eyra forpanic = "abort"
usage via theunwinding
crate (avoid theeh_personality
requirement)libc
+no_std
:Unlike the static
no_std
example below, the revised variant instead avoids thelibc
crate calls - which removes the need for glibc/musl targets to include:Alternatively with
cargo add libc --no-default-features
instead you do not need those two lines insrc/main.rs
.With
libc
crate inCargo.toml
, now-Z build-std
will be compatible to build with (redundant forno_std
?), but doing so requires additionalRUSTFLAGS
depending on glibc or musl target (just like the above linked revisedno_std
example):--target x86_64-unknown-linux-gnu
will need:-C link-arg=/usr/lib64/libc.a -C link-arg=/usr/lib/gcc/x86_64-redhat-linux/14/libgcc_eh.a
. These locations for*.a
static libs are specific to Fedora 41 from theglibc-static
package.-L /usr/lib64 -L link-arg=/usr/lib/gcc/x86_64-redhat-linux/14 -C link-arg=-lgcc_eh
(-C link-arg=-lc
is implicit fromlibc
crate?). The-L
hints don't seem necessary in this case,-C link-arg=-lgcc_eh
alone works.--target x86_64-unknown-linux-musl
will need-C link-arg=-lc
which pairs with the implicit-C link-self-contained=yes
for this target (without=yes
that-lc
may unintentionally dynamically link the host libc library, update: may vary by environment/linker?).NOTE: Related to these caveats for
libc
usage, if considering the optimizations detailed in thesunfishcode/origin
tiny example README, the-N
/--omagic
link arg introduces a segfault with-musl
target and the implicit-C link-self-contained=yes
, but not when set to=no
explicitly (or using-Z build-std
which has roughly the same effect).Original message
I am used to building with the
*-musl
target, but noticed thateyra
is not compatible (default hello world example generated fromcargo init
).--target
:x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
I know the README clarifies the support constraints to linux, but doesn't highlight the
-gnu
vs-musl
target compatibility? I didn't think it would matter witheyra
?Might be worthwhile to convey that incompatibility in the README too?
Reproduction
Some error messages from
-musl
target attempt:Potentially related to?:
libc
crate musl compatibility (may be resolved forlibc 0.3
release)-C link-arg=-nostartfiles
on musl targetThe text was updated successfully, but these errors were encountered: