[皆さん、ありがとうございます!.、申し訳ありませんが、不一致のカーネルが表示されませんでした。何らかの理由で、これが私の ubuntu サーバー 64 ビットだと思っていました]
ct-ng を使用してカスタム gcc ツール チェーンをコンパイルしました。コンパイルは成功しましたが、単純な hello world を作成したところ、このエラーが表示されました。
誰か、ここで何が間違っているのか、なぜこのエラーが発生するのか教えてください。
エラー:
src/main$ ./main
bash: ./main: cannot execute binary file
OSについて
uname -a
Linux lnx-server 3.2.0-25-generic-pae #40-Ubuntu SMP Wed May 23 22:11:24 UTC 2012 i686 i686 i386 GNU/Linux
ファイルに関する追加情報
src/main$ file main
main: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
ファイル許可
-rwxrwxr-x 1 balravin balravin 8276 Jul 27 17:45 main
コンパイルに使用するコマンド
src/main$ x86_64-mvl-linux-gnu-gcc -o main main2.c
GCC 構成
> src/main$ x86_64-mvl-linux-gnu-gcc --v Using built-in specs. Target: > x86_64-mvl-linux-gnu Configured with: > /home/balravin/tools/platform/x86/src/gnu/gcc/4.2.4/.build/src/gcc-4.2.4/configure > --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=x86_64-mvl-linux-gnu --prefix=/home/balravin/tools/platform/x86/obj/gnu/gcc/4.2.4/x86_64-mvl-linux-gnu > --with-sysroot=/home/balravin/tools/platform/x86/obj/gnu/gcc/4.2.4/x86_64-mvl-linux-gnu/x86_64-mvl-linux-gnu/sysroot > --enable-languages=c,c++ --disable-sjlj-exceptions --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --enable-threads=posix --enable-target-optspace --with-long-double-128 --disable-nls --disable-multilib --with-local-prefix=/home/balravin/tools/platform/x86/obj/gnu/gcc/4.2.4/x86_64-mvl-linux-gnu/x86_64-mvl-linux-gnu/sysroot > --enable-c99 --enable-long-long Thread model: posix gcc version 4.2.4
最後にmain2.c
#include <stdio.h>
int main() {
printf("\nHello Work\n");
return 0;
}