[Pkg-rust-maintainers] Bug#884775: /usr/bin/rustc: Error Compiling Code: "attempt to use impure library"

Stefan Pietsch s.pietsch at e2security.de
Sun Mar 4 11:59:47 UTC 2018


On Tue, 19 Dec 2017 17:19:31 +0300 Frederick Muriithi
<fredmanglis at gmail.com> wrote:
> Package: rustc
> Version: 1.14.0+dfsg1-3
> Severity: important
> File: /usr/bin/rustc
> 
> Dear Maintainer,
> 
> 
> I wanted to learn rust, following the tutorial/book at
> https://doc.rust-lang.org/book/second-edition/
> 
> I first of all, installed rust using the rustup tool as directed in the book at
> https://doc.rust-lang.org/book/second-edition/ch01-01-installation.html
> 
> On compiling, the code failed with the error :
> 
> error: linking with `cc` failed: exit code: 1

[...]

> After giving it a while, I thought it might be the interaction between
> the rustc installed via rustup
> and the system libraries that was causing the errors, so I unistalled
> that via rustup, and installed
> the rustc that is present in the Debian repository, rustc
> (1.14.0+dfsg1-3) and tried to compile the
> hello world program again.
> I got a similar error with this rustc too:
> 
> error: linking with `cc` failed: exit code: 1
>   |
>   = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L"
> "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "main.0.o" "-o" "main"
> "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L"


I cannot reproduce this with rustc 1.14.0+dfsg1-3 in Debian stretch.

$ cat main.rs
fn main() {
    println!("Hello, world!");
}

$ rustc main.rs

$ ./main
Hello, world!


Regards,
Stefan



More information about the Pkg-rust-maintainers mailing list