2017-12-10 6 views
3

Debust 9.2システムでthe instructions in the documentationを使用してRustをインストールし、compile the hello world exampleを試しました。コンパイルが次のエラーで失敗しました:Debianでの錆9.2 Impureライブラリによるエラー

$ rustc main.rs --verbose 
error: linking with `cc` failed: exit code: 1 
    | 
    = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "main.main0.rust-cgu.o" "main.main1.rust-cgu.o" "-o" "main" "main.crate.allocator.rust-cgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-fe0b1b991511fcaa.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-3d7b10e850a67e89.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-28484309357fd6f1.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-751808ba756769d5.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-8cb97051d8238386.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-25cc9b024a02d330.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-d42e80cee81b06ce.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-78c21267a2dc15c1.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-0e1b544c94586415.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-0c5e3d6c117f8c44.rlib" "/home/frederick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-bd7cc5ada1e908e0.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" 
    = note: ld-wrapper: error: attempt to use impure library "/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so" 
      collect2: error: ld returned 1 exit status 

次は私がGoogleで次の検索を試みたが、有益な何かを見つけるように見えることはできません私のシステムで

Linux localhost 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux

uname -aを実行しているの出力です:

  • rustcとLD-ラッパー:エラー:不純なライブラリを使用しようとする試み
  • rustcとLD-ラッパー:エラー:attem
  • "/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so" rustcとエラー不純なライブラリを使用するPT:ccとの連携に失敗しました:終了コード:1
+0

カーネルがあり、ディストリビューションが提供するパッケージ/ライブラリがあります。私は 'lsb_release -a'を報告しました' Description:\t Debian GNU/Linux 9.3(stretch) '。インストールスクリプトのように、 "debian"ではなく "ubuntu"のようなハードコーディングされた文字列を探すのが簡単かもしれません。もしあなたが周りを突き進むなら、役に立つパッチを作るでしょう。 –

+0

最終的に、私はシステムrustcをunistalledし、GNU Guix経由でrustcをインストールしましたが、それはほとんどの人にとって複雑なプロセスです。私は[バグを報告しました](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884775)うまくいけばそれは修正されました – fredmanglis

答えて

0

のDebian 9.3でありますUbuntuよりもテストされているDebianよりはるかに重要ではないでしょうか。

Ubuntu Xenialでは、インストール/コンパイルの指示がうまくいきました。

あなたが参照のペアが関連している場所ではなく、十分に文書コーナーケースにぶつかっているように見える:

https://www.mail-archive.com/[email protected]/msg34510.html

... attempt to use impure library, error message

The wrapper's purpose is to inspect the @code{-L} and @code{-l} switches passed to the linker, add corresponding @code{-rpath} arguments, and invoke the actual linker with this new set of arguments. By default, the linker wrapper refuses to link to libraries outside the store to ensure ``purity''. This can be annoying when using the toolchain to link with local libraries. To allow references to libraries outside the store you need to define the environment variable @code{GUIX_LD_WRAPPER_ALLOW_IMPURITIES}.

とコードのこのビット:

https://lists.gnu.org/archive/html/help-guix/2016-12/msg00040.html

... for future reference, to hack on a haskell package these are the steps:

... export GUIX_LD_WRAPPER_ALLOW_IMPURITIES=y ...

GUIXが偶数あなたの状況に合ったものを選んで、それを定義することで、インストールプロセスを少しでも進めることができます。

関連する問題