You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> cargo test --locked --release elf
[...]
test elf::tests::zig_host_app ... FAILED
failures:
---- elf::tests::zig_host_app stdout ----
thread 'elf::tests::zig_host_app' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', crates/linker/src/elf.rs:1680:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The text was updated successfully, but these errors were encountered:
That's a problem with the dynamic loader:
https://discourse.nixos.org/t/no-such-file-of-directory-when-trying-to-execute-binary-file/6150
When linking `libapp.so` with `host.zig`, zig puts in the binary the
standard path for the dynamic loader on linux:
`/lib64/ld-linux-x86-64.so.2`
However in NixOS, that file is somewhere else in the nix store (see:
https://nixos.wiki/wiki/Packaging/Binaries#The_Dynamic_Loader). Removing
the `-target` switch makes zig uses the host target for linking and puts
the right path to the dynamic loader in the resulting binary. As we want
to execute that binary file in this test, it makes sense to use the
default target anyway.
Note that this is relevant for the creation of the binary only. For the
creation of the object file, it doesn't really matter. But I removed the
`-target` switch as well there for consistency.
Fixroc-lang#4180
The text was updated successfully, but these errors were encountered: