Skip to content

error: linking with rust-lld failed: exit status: 1 when running cargo bootimage #100

Closed
@NightProg

Description

@NightProg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions