rust-osdev / bootimage

Tool to create bootable disk images from a Rust OS kernel.
Apache License 2.0
767 stars 67 forks source link

Unable to find llvm-tools when building bootloader #49

Closed timClicks closed 4 years ago

timClicks commented 4 years ago

(Sorry if this issue is filed in the wrong place)

I'm trying to compile a bootloader for my fledgling OS (FledgeOS), but I'm having trouble getting bootimage to work correctly.

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.04
DISTRIB_CODENAME=disco
DISTRIB_DESCRIPTION="Ubuntu 19.04"

$ rustup component list
cargo-x86_64-unknown-linux-gnu (installed)
clippy-x86_64-unknown-linux-gnu (installed)
llvm-tools-preview-x86_64-unknown-linux-gnu (installed)
...

$ cargo +nightly bootimage --target fledge.json
...
Building bootloader
       Fresh nodrop v0.1.13
       Fresh llvm-tools v0.1.1
       Fresh bit_field v0.9.0
       Fresh ux v0.1.3
       Fresh cast v0.2.2
       Fresh zero v0.1.2
       Fresh fixedvec v0.2.4
       Fresh usize_conversions v0.2.0
       Fresh array-init v0.0.4
       Fresh xmas-elf v0.6.2
       Fresh bitflags v1.1.0
   Compiling bootloader v0.7.1 (/home/tsm/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.7.1)
   Compiling x86_64 v0.7.4
     Running `rustc --edition=2018 --crate-name x86_64 /home/tsm/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.7.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C debuginfo=2 -C metadata=9b908b8ed60a7fa2 -C extra-filename=-9b908b8ed60a7fa2 --out-dir /home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps --target /home/tsm/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.7.1/x86_64-bootloader.json -L dependency=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps -L dependency=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/release/deps --extern array_init=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps/libarray_init-cecd769fe74af588.rmeta --extern bit_field=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps/libbit_field-8bf6ec320a2ebdf6.rmeta --extern bitflags=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps/libbitflags-2ba702ed93258e5a.rmeta --extern cast=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps/libcast-b8f4afefb3392b63.rmeta --extern ux=/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/x86_64-bootloader/release/deps/libux-9799f55390ca77e3.rmeta --cap-lints allow --sysroot /home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/bootloader-sysroot`
     Running `/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/release/build/bootloader-e08cd69e1cced972/build-script-build`
error: failed to run custom build command for `bootloader v0.7.1 (/home/tsm/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.7.1)`

Caused by:
  process didn't exit successfully: `/home/tsm/Learn/FledgeOS/fledgeos-0/target/bootimage/bootloader/release/build/bootloader-e08cd69e1cced972/build-script-build` (exit code: 1)
--- stderr
Error: llvm-tools not found
Maybe the rustup component `llvm-tools-preview` is missing?
  Install it through: `rustup component add llvm-tools-preview`

warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Bootloader build failed
timClicks commented 4 years ago

Moving issue to the llvm-tools repo

phil-opp commented 4 years ago

In case anyone stumbles upon this. The new issue is at https://github.com/phil-opp/llvm-tools/issues/1. The problem was that the llvm-tools-preview component is compiler specific, so installing it for stable does not automatically install it for nightly too.