Skip to content

rustc and cargo binaries crash on startup on ARM with glibc, because libpthread is loaded too late #35843

Closed
rust-lang-deprecated/rust-buildbot
#123
@edef1c

Description

@edef1c
[edef@alarm ~]$ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly 
rustup: gpg available. signatures will be verified
rustup: downloading manifest for 'nightly'
rustup: downloading toolchain for 'nightly'
######################################################################## 100.0%
gpg: assuming signed data in '/home/edef/.rustup/dl/53065fae72c98b6e8b0d/rust-nightly-armv7-unknown-linux-gnueabihf.tar.gz'
gpg: Signature made Fri Aug 19 14:19:07 2016 UTC using RSA key ID 5CB4A9347B3B09DC
gpg: Good signature from "Rust Language (Tag and Release Signing Key) <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 108F 6620 5EAE B0AA A8DD  5E1C 85AB 96E6 FA1B E5FE
     Subkey fingerprint: C134 66B7 E169 A085 1886  3216 5CB4 A934 7B3B 09DC
rustup: installing toolchain for 'nightly'
rustup: extracting installer
install: uninstalling component 'rustc'
install: uninstalling component 'rust-std-armv7-unknown-linux-gnueabihf'
install: uninstalling component 'rust-docs'
install: uninstalling component 'cargo'
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'rust-std-armv7-unknown-linux-gnueabihf'
install: installing component 'rust-docs'
install: installing component 'cargo'

    Rust is ready to roll.

[edef@alarm ~]$ rustc
Segmentation fault (core dumped)
[edef@alarm ~]$ cargo
Segmentation fault (core dumped)

related: https://sourceware.org/bugzilla/show_bug.cgi?id=16628

workaround:

[edef@alarm ~]$ sudo patchelf --add-needed libpthread.so.0 $(which rustc)
warning: working around a Linux kernel bug by creating a hole of 61440 bytes in ‘/usr/local/bin/rustc’
[edef@alarm ~]$ rustc
Usage: rustc [OPTIONS] INPUT

Options:
    -h --help           Display this message
    --cfg SPEC          Configure the compilation environment
    -L [KIND=]PATH      Add a directory to the library search path. The
                        optional KIND can be one of dependency, crate, native,
                        framework or all (the default).
    -l [KIND=]NAME      Link the generated crate(s) to the specified native
                        library NAME. The optional KIND can be one of static,
                        dylib, or framework. If omitted, dylib is assumed.
    --crate-type [bin|lib|rlib|dylib|cdylib|staticlib]
                        Comma separated list of types of crates for the
                        compiler to emit
    --crate-name NAME   Specify the name of the crate being built
    --emit [asm|llvm-bc|llvm-ir|obj|link|dep-info]
                        Comma separated list of types of output for the
                        compiler to emit
    --print [crate-name|file-names|sysroot|cfg|target-list|target-cpus|target-features|relocation-models|code-models]
                        Comma separated list of compiler information to print
                        on stdout
    -g                  Equivalent to -C debuginfo=2
    -O                  Equivalent to -C opt-level=2
    -o FILENAME         Write output to <filename>
    --out-dir DIR       Write output to compiler-chosen filename in <dir>
    --explain OPT       Provide a detailed explanation of an error message
    --test              Build a test harness
    --target TARGET     Target triple for which the code is compiled
    -W --warn OPT       Set lint warnings
    -A --allow OPT      Set lint allowed
    -D --deny OPT       Set lint denied
    -F --forbid OPT     Set lint forbidden
    --cap-lints LEVEL   Set the most restrictive lint level. More restrictive
                        lints are capped at this level
    -C --codegen OPT[=VALUE]
                        Set a codegen option
    -V --version        Print version info and exit
    -v --verbose        Use verbose output

Additional help:
    -C help             Print codegen options
    -W help             Print 'lint' options and default settings
    -Z help             Print internal options for debugging rustc
    --help -v           Print the full set of options rustc accepts

[edef@alarm ~]$ sudo patchelf --add-needed /lib/ld-linux-armhf.so.3 $(which cargo)
[edef@alarm ~]$ cargo
Rust's package manager

Usage:
    cargo <command> [<args>...]
    cargo [options]

Options:
    -h, --help          Display this message
    -V, --version       Print version info and exit
    --list              List installed commands
    --explain CODE      Run `rustc --explain CODE`
    -v, --verbose ...   Use verbose output
    -q, --quiet         No output printed to stdout
    --color WHEN        Coloring: auto, always, never
    --frozen            Require Cargo.lock and cache are up to date
    --locked            Require Cargo.lock is up to date

Some common cargo commands are (see all commands with --list):
    build       Compile the current project
    clean       Remove the target directory
    doc         Build this project's and its dependencies' documentation
    new         Create a new cargo project
    init        Create a new cargo project in an existing directory
    run         Build and execute src/main.rs
    test        Run the tests
    bench       Run the benchmarks
    update      Update dependencies listed in Cargo.lock
    search      Search registry for crates
    publish     Package and upload this project to the registry
    install     Install a Rust binary

See 'cargo help <command>' for more information on a specific command.
[edef@alarm ~]$  

I'm not sure why rustc works at all on x86.

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