Skip to content
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

error: failed to run rustc to learn about target-specific information #1

Open
coppock opened this issue Mar 14, 2020 · 8 comments
Open

Comments

@coppock
Copy link

coppock commented Mar 14, 2020

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?

@random532
Copy link

The error message has one 'help' and one 'note' statement worth trying.

@random532
Copy link

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

@coppock
Copy link
Author

coppock commented Mar 23, 2020

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.

@coppock
Copy link
Author

coppock commented Mar 31, 2020

I got the target spec. errors to disappear. Now I have a bunch of Rust errors. I've forked the repo.

@johalun
Copy link
Owner

johalun commented Mar 31, 2020

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.

@johalun
Copy link
Owner

johalun commented Mar 31, 2020

The allocator API also changed a lot but I can't recall if that was before or after I did this project.

@coppock
Copy link
Author

coppock commented Mar 31, 2020

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?

@johalun
Copy link
Owner

johalun commented Mar 31, 2020

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants