Skip to content

Error running musl rustup on Ubuntu #3254

Description

@fenhl

Problem

$ rustc +stable-x86_64-unknown-linux-musl --version
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so)
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_GetRegionStart: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_GetTextRelBase: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_RaiseException: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_SetIP: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_Resume: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_DeleteException: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_Resume_or_Rethrow: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_GetIPInfo: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_GetDataRelBase: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_SetGR: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-a19ffab541701154.so: _Unwind_GetLanguageSpecificData: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_Resume: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetTextRelBase: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetDataRelBase: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetRegionStart: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_FindEnclosingFunction: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_DeleteException: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_SetGR: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_SetIP: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetCFA: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetLanguageSpecificData: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_RaiseException: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetIP: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_GetIPInfo: symbol not found
Error relocating /home/fenhl/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/libstd-86aefecbddda356d.so: _Unwind_Backtrace: symbol not found

Steps

Install the x86_64-unknown-linux-musl toolchain on Ubuntu 23.04.

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup 1.25.2 (17db695f1 2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.67.1 (d5a82bbd2 2023-02-07)`

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/fenhl/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
stable-x86_64-unknown-linux-musl

installed targets for active toolchain
--------------------------------------

x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.67.1 (d5a82bbd2 2023-02-07)

Activity

  1. rbtcollins commented on Mar 7, 2023

    @rbtcollins
    Contributor

    This bug would be more relevant on the rust bugtracker; rustup is a package manager, not the generator of the distributions

  2. pnkfelix commented on Mar 8, 2023

    @pnkfelix

    moved bug over to rust-lang/rust#108907 ; this can be closed IMO.

  3. workingjubilee commented on Mar 12, 2023

    @workingjubilee
    Member

    The issue here is that a gnu host is unlikely to be correctly configured for the musl toolchain (and this one was not), which is designed to run on e.g. an actual musl distro, and using the musl toolchain is usually unnecessary for compiling for the musl targets, since you can install the musl targets with the gnu toolchain.

    As rustc can't do anything when it is executed and fails to link, rustup could try to warn a user about using a mismatched toolchain and inform them that the Rust toolchain performs cross-compilation. They may be expecting it to work like e.g. how gcc is built, where you need a toolchain per target.

  4. reopened this on Mar 12, 2023
  5. workingjubilee commented on Mar 12, 2023

    @workingjubilee
    Member

    I think we should issue this warning only on an attempt to install a mismatched toolchain. Trying to check every time rustup starts could introduce unacceptable overhead and will likely just be a nuisance.

  6. workingjubilee commented on Jul 11, 2023

    @workingjubilee
    Member

    Ah, this has been taken care of:

    error: DEPRECATED: future versions of rustup will require --force-non-host to install a non-host toolchain as the default.
    warning: toolchain 'stable-x86_64-unknown-linux-musl' may not be able to run on this system.
    warning: If you meant to build software to target that platform, perhaps try rustup target add x86_64-unknown-linux-musl instead?

  7. Yury-Fridlyand commented on May 2, 2025

    @Yury-Fridlyand

    I got the same error after installing rust (via rustup) on an alpine docker container.
    Intallation succeeded, but when I tried to invoke rustc:

    / # rustc -vV
    Error loading shared library libgcc_s.so.1: No such file or directory (needed by /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/librustc_driver-6d4ff9c831ad4cb5.so)
    

    I expect installer to report an error and/or request additional package to install.

  8. rami3l commented on May 7, 2025

    @rami3l
    Member

    Following #3254 (comment), the original issue has been closed by #4028.

    @Yury-Fridlyand Would you mind making a separate issue so we can have a closer look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions