Closed ajadavis closed 1 year ago
I'm seeing the same issue. Here's the full error output:
` = note: rust-lld: error: undefined symbol: _rest_of_bootloader_start_addr
referenced by bootloader.715ae32a-cgu.1 ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot-first-stage+0x60) referenced by bootloader.715ae32a-cgu.1 ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot-first-stage+0x7B)
rust-lld: error: undefined symbol: _rest_of_bootloader_end_addr
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot-first-stage+0x81)
rust-lld: error: undefined symbol: _kernel_buffer
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x59)
rust-lld: error: undefined symbol: _memory_map
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0xCA)
>>> referenced by main.rs:108 (src/main.rs:108)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
rust-lld: error: undefined symbol: __page_table_start
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1A1)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x20C)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x219)
>>> referenced 2 more times
rust-lld: error: undefined symbol: __page_table_end
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1A6)
>>> referenced by main.rs:111 (src/main.rs:111)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
>>> referenced by main.rs:105 (src/main.rs:105)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
rust-lld: error: undefined symbol: _p3
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1B4)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1C9)
rust-lld: error: undefined symbol: _p4
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1BC)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x24C)
>>> referenced by main.rs:114 (src/main.rs:114)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
>>> referenced 1 more times
rust-lld: error: undefined symbol: _p2
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1C1)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1D6)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1FB)
rust-lld: error: undefined symbol: _p1
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x1CE)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x231)
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x371)
rust-lld: error: undefined symbol: __bootloader_end
>>> referenced by bootloader.715ae32a-cgu.1
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(.boot+0x221)
>>> referenced by main.rs:113 (src/main.rs:113)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
>>> referenced by main.rs:105 (src/main.rs:105)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
rust-lld: error: undefined symbol: __bootloader_start
>>> referenced by main.rs:112 (src/main.rs:112)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
>>> referenced by main.rs:105 (src/main.rs:105)
>>> ~/flint/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-d2c531ea42821f4b.bootloader.715ae32a-cgu.1.rcgu.o:(stage_4)
error: could not compile "bootloader" due to previous error Error: Bootloader build failed. Stderr: `
rust-osdev/bootloader#271 https://github.com/rust-lang/rust/pull/102836
Should already be fixed, the boot loader build is green again too, try again after upgrading to the latest nightly
Incredible. Working for me after upgrading to latest nightly- many thanks!
following along edition 2, and currently finishing "minimal-rust-kernel"
getting this error when running "cargo bootimage":
"error: linking with
rust-lld
failed: exit status: 1:when i run "rustc --version" i get output:
"rustc 1.66.0-nightly (db0597f56 2022-10-11)"
so i think the nightly build setting is ok.
contents of ./.cargo/config.toml:
contents of "x86_64-blog_os.json":
i've got "bootloader = "0.9.8"" as a dependency in Cargo.toml (running v 10 gave issues before, but following along the blog's version now seems ok.
im on macOS Monterey v12.5 chip is an M1 max
doing some more research into rust-lld, but couldn't find anything in first pass. next step is to learn more about rust-lld from ground up. thx in advance if anyone knows the issue!