Giter Club home page Giter Club logo

ch32v003j4m6-led's People

Contributors

task-jp avatar

Watchers

 avatar

ch32v003j4m6-led's Issues

Can't find crate "core"

古いMacを使ってch32v003でLチカするプログラムを作成しようとしました。
わたしの環境:
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H15

こちらの記事を参考にしてLLVM及びrustcのビルドを行いました。ビルド自体にはエラーは特になかったのですが、ツールチェーンのリンクの際に$ rustup toolchain link custom-rv32ec $PWD/build/host/を実行した結果、エラーが返ってきました。以下のようなものです。

error: not a directory: '/Users/Me/Documents/Rust/rust/build/host/lib

ch32v00x-halのガイドを参考にしてrustup toolchain link custom-rv32ec $PWD/build/host/stage1(stage1というディレクトリを足しています)とやってみたところ、問題なく実行できました。
記事の途中にある「プロジェクトの作成と設定」の終わりまでのRustプロジェクトを作成して$ cargo +custom-rv32ec buildを実行しました。
すると、1320個のエラーが出ました。曰く「coreクレートが見つかりません」ということでした。ビルドしたカスタムツールチェーンにcoreライブラリが含まれていないということのようですが、なぜこうなるか詳しくはわかりません。以下、エラーの一例です

error[E0463]: can't find crate for `core`
 --> /Users/Me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/memchr-2.7.1/src/memchr.rs:1:5
  |
1 | use core::iter::Rev;
  |     ^^^^ can't find crate

そのほか、SomeErrといった基本的な型が存在しないというエラーも見られました。

以上が私が今直面している主な問題です。
ほかに試してみたことを書きます、クローンした「カスタム」rustcのディレクトリに戻って./x.py build -i --target riscv32ec-unknown-none-elf --stage 1 library/stdを実行してターゲット用のcoreライブラリを再ビルドようとしたところ、以下のようなエラーが返ってきました

error[E0432]: unresolved import `core::sync::atomic::AtomicUsize`
 --> library/stdarch/crates/std_detect/src/detect/cache.rs:8:5
  |
8 | use core::sync::atomic::AtomicUsize;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `AtomicUsize` in `sync::atomic`

For more information about this error, try `rustc --explain E0432`.

coreのAtomic型を使おうとしているようなのですが、Atomic命令を含まないはずのRV32ECの中でAtomic型を使おうとしていることがわかります。なぜこうなるのか私はわかりません。ちなみに、「カスタム」LLVM及び「カスタム」rustcのビルドの出力には(途中の出力は量が多すぎて確認していませんが)最後に"Build completed successfully in X:XX:XX"というような出力を確認しています。

質問したいこと

  • まずざっくばらんに質問ですが、こういった現象に心当たりがあれば知見を共有していただけると幸いです。
  • 特にツールチェーンのリンクのところに差異があるようなのですが、お使いの環境でrust/build/host/libというディレクトリが存在するか確認していただいてもいいでしょうか?
  • coreライブラリが存在しないというようなエラーが出たことがあるかどうか、それに対してどういう措置をとったかなど、あれば教えていただければ幸いです。
  • ひょっとするとOSによって挙動が違うのかと思ったのですがもし可能であれば、ビルド環境(Ubuntu?Windows?Mac?など)も教えていただけると幸いです。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.