clang/llvm を使用して、ARM でサンプルの hello world プログラムをクロスコンパイルしようとしています。
リンクでいくつかの問題に直面しています。
clang -target arm-none-linux-gnueabi hello.c
「 no such file or directory "stdio.h " 」というエラーが表示されます
エラーを回避するために、次のコマンドを指定しました。
clang -target arm-none-linux-gnueabi -sysroot=/path/toolchain/ hello.c -I/path/toolchain/sysroot/usr/include/
その後、エラーをうまく乗り越えましたが、リンクエラーが発生しました。エラー: " no such file or directory crt1.o " " no such file or directory crti.o " ライブラリ パスをエクスポートし、コマンド ラインでパスも指定しましたが、何も機能しません。私は次のコマンドを与えました。
clang -target arm-none-linux-gnueabi -sysroot=/path/toolchain/ hello.c -I/path/toolchain/sysroot/usr/include/ -L/path/toolchain/sysroot/usr/lib
それでも同じエラー " no such file or directory crt1.o " " no such file or directory crti.o "
どんな助けも楽しみにしています。私はclang-3.0を使用していましたが、後でビルド済みのバイナリをダウンロードしてclang-3.3にアップグレードしました。前もって感謝します。:)