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: linking with rust-lld failed: exit status: 1 when running cargo bootimage #100

Closed
NightProg opened this issue Mar 23, 2025 · 2 comments

Comments

@NightProg
Copy link

Hello Everyone,
I am on ubuntu :

cargo 1.87.0-nightly (307cbfda3 2025-03-20)
release: 1.87.0-nightly
commit-hash: 307cbfda3119f06600e43cd38283f4a746fe1f8b
commit-date: 2025-03-20
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.4.1)
ssl: OpenSSL 3.4.1 11 Feb 2025
os: Ubuntu 24.4.0 (noble) [64-bit]

and when running cargo bootimage i got this error:

error: linking with `rust-lld` failed: exit status: 1
  |
  = note:  "rust-lld" "-flavor" "gnu" "--script=linker.ld" "--gc-sections" "/tmp/rustchuCxIe/symbols.o" "<4 object files omitted>" "--as-needed" "-Bstatic" "/home/<username>/Documents/blog_os/target/bootimage/bootloader/x86_64-bootloader/release/deps/{libxmas_elf-5d65d2bf96cae931.rlib,libzero-7687372b2590b98d.rlib,libx86_64-51db3ea7fbab3b39.rlib,libvolatile-a65ebc85f9994f32.rlib,libbitflags-d0b0465c0016cac0.rlib,libbit_field-d84f3e3f48fe7d8b.rlib,libusize_conversions-83f8cb4f56f96380.rlib,libfixedvec-c637a26df226bd98.rlib,libbootloader-22099723311d027c.rlib,librlibc-9db6015d2d748be6.rlib,librustc_std_workspace_core-0f32d5b194ffc9d8.rlib,libcore-df0460c8357f8b8d.rlib,libcompiler_builtins-0049d8cc3182492c.rlib}.rlib" "-L" "/tmp/rustchuCxIe/raw-dylibs" "-Bdynamic" "--eh-frame-hdr" "-z" "noexecstack" "-L" "/home/<username>/Documents/blog_os/target/bootimage/bootloader/x86_64-bootloader/release/build/bootloader-45705ba959b703b7/out" "-o" "/home/<username>/Documents/blog_os/target/bootimage/bootloader/x86_64-bootloader/release/deps/bootloader-25df0860a36a3c81" "--gc-sections" "-O1"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: rust-lld: error: undefined symbol: __rustc::rust_begin_unwind
          >>> referenced by panicking.rs:75 (src/panicking.rs:75)
          >>>               core-df0460c8357f8b8d.core.2a1541bdced1dd1e-cgu.02.rcgu.o:(core::panicking::panic_fmt::h3fe10757e2944874) in archive /home/<username>/Documents/blog_os/target/bootimage/bootloader/x86_64-bootloader/release/deps/libcore-df0460c8357f8b8d.rlib

i just cloned the repo https://github.com/phil-opp/blog_os branch post-03
Thanks you
Have a good day

@NightProg
Copy link
Author

Nvm it has already a issue on the bootloader repo

@phil-opp
Copy link
Member

Should be fixed by rust-osdev/bootloader#500.

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

2 participants