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

rust-lld is only available on tier 1 platforms #754

Open
phil-opp opened this issue Feb 18, 2020 · 5 comments
Open

rust-lld is only available on tier 1 platforms #754

phil-opp opened this issue Feb 18, 2020 · 5 comments

Comments

@phil-opp
Copy link
Owner

See rust-lang/rust#52362 (comment)

Reported in #403 (comment)

@zen3ger
Copy link

zen3ger commented May 31, 2020

Since some people might end up here if they try to follow the blog on FreeBSD (like myself), I'd like to add this here as note.

The pkg repo version of nightly rust does have rust-lld built so the guide can be followed with tiny modifications, though I couldn't get everything to build (yet). cargo-xbuild fails, but xargo seems to work. The xargo bootimage command needs some extra tweaking too, it might be that the nightly (1.44.0) is old, it seems to not have the embed-bitcode codegen option, but at least it's a start...

Steps:

  • remove rustup
$ rustup self uninstall
  • install the rustup-nightly package
# pkg install rust-nightly
  • set RUST_SRC_PATH to point to the nightly package location e.g. in .shrc
export RUST_SRC_PATH="/usr/local/lib/rustlib/src"
  • add rust-lld to PATH
PATH="/usr/local/lib/rustlib/x86_64-unknown-freebsd/bin:${PATH}"

@LorenzoEvans
Copy link

Just wanted to add that I'm running into this issue on a MacBook, Catalina (10.15.5), and currently searching for a workaround (if anyone knows one, I'd appreciate it), otherwise I'll be tinkering and seeing if I can drum one up myself.

@bjorn3
Copy link
Contributor

bjorn3 commented Jun 21, 2020

rust-lld should be available on macOS, as it is a tier 1 platform. The only problem with the macOS version should be that linking machO binaries with it may result in runtime crashes. blog_os uses ELF binaries, so there should be no problems.

@LorenzoEvans
Copy link

LorenzoEvans commented Jun 21, 2020

Update: got it fixed- I added a .toml to the .cargo/config file, and that file extension was causing the hiccup!

Hmm... that's interesting- It seems to have worked fine before, and the error first popped up when I tried to run cargo xtest in post 04. The odd thing is that I can still rebuild the project, and generate an executable, I just can't run the test command.

error: linker rust-lld not found
|
= note: No such file or directory (os error 2)

error: aborting due to previous error; 16 warnings emitted

error: could not compile kurogane_os.

Caused by:
process didn't exit successfully: rustc --crate-name kurogane_os --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 --test -C metadata=22837689760f7da2 -C extra-filename=-22837689760f7da2 --out-dir /Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/deps --target /Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/x86_64-kurogane_os.json -C incremental=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/incremental -L dependency=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/deps -L dependency=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/debug/deps --extern bootloader=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/deps/libbootloader-f798ee13ab623df9.rlib --extern lazy_static=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/deps/liblazy_static-7b90784f48196b84.rlib --extern spin=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/deps/libspin-5e133f942883f10a.rlib --extern volatile=/Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/x86_64-kurogane_os/debug/deps/libvolatile-bb79fc42086685a4.rlib --sysroot /Users/lambda_school_loaner_94/Desktop/Contents/Languages/Rust/kurogane_os/target/sysroot (exit code: 1)

@darkoverlordofdata
Copy link

I get this same error on GhostBSD (FreeBSD 12.2-STABLE FreeBSD 12.2-STABLE GENERIC amd64), but the rust-lld is installed on my computer.
All I had to do was add these lines to my .profile.

export RUST_SRC_PATH="/usr/local/lib/rustlib/src"
PATH="/usr/local/lib/rustlib/x86_64-unknown-freebsd/bin:${PATH}"

But now I get other errors. I have yet to find a rust demo that actually works. So frustrating.

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

5 participants