echo
echo copied to clipboard
error: failed to run `rustc` to learn about target-specific information
After running build.sh
:
rm -f export_syms machine x86 hello.ko hello.kld ./objects/*.o hello.o
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --sysroot /home/pcoppock1/.xargo -Z force-unstable-if-unmarked --target x86_64-kernel-freebsd --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
--- stderr
error: Error loading target specification: Field target-c-int-width in target specification is required
|
= help: Use `--print target-list` for a list of built-in targets
error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.6bewgFfrvrSo/Cargo.toml" "--target" "x86_64-kernel-freebsd" "-p" "core"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
Is there any other information that would be useful in debugging this error?
Also, the target "x86_64-kernel-freebsd" is not built in to the Rust compiler. How is this target supported?
The error message has one 'help' and one 'note' statement worth trying.
x86_64-kernel-freebsd is not in the list of build in targets, see: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/index.html#modules
The error message has one 'help' and one 'note' statement worth trying.
I tried the help statement. As you stated in your second comment:
x86_64-kernel-freebsd is not in the list of build in targets, see: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/index.html#modules
rustc --print target-list
did not list "x86_64-kernel-freebsd." After looking at the code more closely, I think "x86_64-kernel-freebsd" is a custom target.
I got the target spec. errors to disappear. Now I have a bunch of Rust errors. I've forked the repo.
This repo is quite old and a lot has changed in Rust since then so I'm not surprised if this method doesn't work at all anymore. Xargo functionality is now found in Cargo I think. Using rust nightly of the time this repo was created is your best chance unless you want to spend a lot of time changing the code to work with newer rust.
The allocator API also changed a lot but I can't recall if that was before or after I did this project.
I'm gonna shoot for updating all the code to use current FreeBSD release and Rust version (as an undergraduate course project). Do you remember how long it took to get this project working originally?
Hmm sorry I don't remember how long but it's definitely within the scope of one course, especially if you can build on this old repo. Good luck and have fun :)