我正在做我的硕士论文,我在配置交叉编译器时遇到问题。我读过很多文章,常见问题解答,教程等,但我仍然认为我错过了一些东西,可能非常愚蠢和基础,但没有这些,我不能清楚地看到一切,而且我也不会使所有工作...所以请随时解释我的一切。让我们来解决这个问题。安装mips交叉编译器的问题
我正在使用SoClib设计具有许多MIPS和许多RAM的NoC,并且我想在每个RAM中加载不同的应用程序,以使每个MIPS只从一个RAM读取。我设法用非常简单的应用程序来做到这一点(比如hello word with interrupts ...),所以现在我试图实现一个JPEG解码器,以更强烈的方式使用MIPS。问题是我使用的交叉编译器找不到基本的stdio函数,所以无法编译mips的应用程序。所以基本上我没有设法安装一个完整的交叉编译器。
1)Let's开始与SoClib安装交叉编译: 这里有导向从来就跟着来安装它:http://www.soclib.fr/trac/dev/wiki/CrossCompiler 现在从什么从来就读这不是一个完整的交叉编译器。我只安装了第一阶段的gcc,可以为mips生成elf代码,但不能使用任何C函数。用那个,我应该编译一个C库来创建一个新的交叉编译器。所以这是正常的,它不工作,虽然这并不回答这个问题:为什么“Hello world”工作,如果它使用printf并包括stdio.h?答案应该是我已经看到SoClib的头文件stdio.h中实现了很少的功能(printf在那里),所以我不能在该编译器中使用标准的C库。 2)因为这个,我决定安装一个完整的交叉编译器,并且我已经阅读了很多指南,我只会发布我在练习中使用的两个: http://www.cse.iitb.ac.in/grc/gcc-workshop-11/downloads/slides/gccw11-config-build.pdf(从第108页开始)交叉编译问题) 它使用EGLIBC。唯一的区别是我用作目标“米勒精灵”。如果我理解正确,这种方法需要3阶段交叉编译器,因为eglibc不能用第一阶段交叉编译器完全编译。现在的问题是,我无法用第一阶段交叉编译器安装eglibc(它在第122页失败)。我附上了日志。我认为问题开始于它说:“mipsel-elf-gcc:错误:无法识别的选项'-V'”和“mipsel-elf-gcc:致命错误:没有输入文件编译终止”。似乎我有一些编译器的问题,并完成一个不支持的平台......但它应该工作,因为我已经复制eglibc/ports目录像指南所说...
3)我试过另一个指南,使用newlib而不是eglibc: http://www(dot)cygwin(dot)com/ml/crossgcc/2005-08/msg00114/l-cross-ltr.pdf 本指南仅创建2阶段交叉编译器。我认为这是因为newlib可以用第一阶段编译器完全编译......我是对的吗?无论如何,我遇到同样的问题。我无法编译newlib,并且出现类似的错误(附加日志)。
所以这是我的问题,在这里我提出了一些疑问,我试图解决它。
4)问题可能是目标= mipsel-elf吗?我从gnu文档中知道,配置gnu的名字应该是:cpu-manufacturer-os(或者cpu-manufacturer-kernel-os),但我读过mipsel-elf被接受。小精灵应该是因为我不想在我的NoC平台上加载操作系统,这里有第二个疑问......
5)问题是操作系统的问题吗?这些指南使用Linux内核头文件...也许有一个mipsel-elf目标我不应该配置binutils -with-sysroot?但听起来很奇怪......应该改变什么?
6)又一个可能是愚蠢的问题。 stdio和一般的C函数,不需要一个操作系统?因为所有这些问题都让我对基础知识产生怀疑......所以我应该能够用mipsel-elf交叉编译器运行JPEG解码C应用程序吧?
每一个考虑,建议和帮助将不胜感激。如果你有一些关于这些论点的文件,请让我知道,我想学习,并在这个领域变得更加自信。 感谢
eglibc日志:
configure:2426: $? = 0
configure:2433: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -v >&5
Using built-in specs.
COLLECT_GCC=/home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc
COLLECT_LTO_WRAPPER=/home/bertone/programmazione/crosscompiler/mips/install/libexec/gcc/mipsel-elf/4.6.2/lto-wrapper
Target: mipsel-elf
Configured with: ../../../../../Scaricati/src/gcc-4.6.2/configure --target=mipsel-elf --prefix=/home/bertone/programmazione/crosscompiler/mips/install --without-headers --with-newlib --disable-shared --disable-threads --disable-libssp --disable-libgomp --disable-libmudflap --enable-languages=c --disable-werror
Thread model: single
gcc version 4.6.2 (GCC)
configure:2437: $? = 0
configure:2444: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -V >&5
mipsel-elf-gcc: error: unrecognized option '-V'
mipsel-elf-gcc: fatal error: no input files
compilation terminated.
configure:2448: $? = 1
configure:2452: checking for suffix of object files
configure:2478: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -c conftest.c >&5
configure:2482: $? = 0
configure:2507: result: o
configure:2511: checking whether we are using the GNU C compiler
configure:2540: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -c conftest.c >&5
configure:2547: $? = 0
configure:2564: result: yes
configure:2573: checking whether /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc accepts -g
configure:2603: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -c -g conftest.c >&5
configure:2610: $? = 0
configure:2711: result: yes
configure:2728: checking for /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc option to accept ISO C89
configure:2802: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -c -g -O2 conftest.c >&5
conftest.c:9:19: fatal error: stdio.h: No such file or directory
compilation terminated.
configure:2809: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2802: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -qlanglvl=extc89 -c -g -O2 conftest.c >&5
mipsel-elf-gcc: error: unrecognized
选项 '-qlanglvl = extc89选项' 配置:2809:$? = 1
NEWLIB登录
configure:4049: $? = 0
configure:4038: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -v >&5
Using built-in specs.
COLLECT_GCC=/home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc
COLLECT_LTO_WRAPPER=/home/bertone/programmazione/crosscompiler/mips/install/libexec/gcc/mipsel-elf/4.6.2/lto-wrapper
Target: mipsel-elf
Configured with: ../../../../../Scaricati/src/gcc-4.6.2/configure --target=mipsel-elf --prefix=/home/bertone/programmazione/crosscompiler/mips/install --without-headers --with-newlib --disable-shared --disable-threads --disable-libssp --disable-libgomp --disable-libmudflap --enable-languages=c --disable-werror
Thread model: single
gcc version 4.6.2 (GCC)
configure:4049: $? = 0
configure:4038: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -V >&5
mipsel-elf-gcc: error: unrecognized option '-V'
mipsel-elf-gcc: fatal error: no input files
compilation terminated.
configure:4049: $? = 1
configure:4038: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc -qversion >&5
mipsel-elf-gcc: error: unrecognized option '-qversion'
mipsel-elf-gcc: fatal error: no input files
compilation terminated.
configure:4049: $? = 1
configure:4069: checking for C compiler default output file name
configure:4091: /home/bertone/programmazione/crosscompiler/mips/install/bin/mipsel-elf-gcc conftest.c >&5
/home/bertone/programmazione/crosscompiler/mips/install/lib/gcc/mipsel-elf/4.6.2/../../../../mipsel-elf/bin/ld: cannot find crti.o: No such file or directory
/home/bertone/programmazione/crosscompiler/mips/install/lib/gcc/mipsel-elf/4.6.2/../../../../mipsel-elf/bin/ld: cannot find crtbegin.o: No such file or directory
/home/bertone/programmazione/crosscompiler/mips/install/lib/gcc/mipsel-elf/4.6.2/../../../../mipsel-elf/bin/ld: cannot find -lgcc
/home/bertone/programmazione/crosscompiler/mips/install/lib/gcc/mipsel-elf/4.6.2/../../../../mipsel-elf/bin/ld: cannot find -lgcc
/home/bertone/programmazione/crosscompiler/mips/install/lib/gcc/mipsel-elf/4.6.2/../../../../mipsel-elf/bin/ld: cannot find crtend.o: No such file or directory
/home/bertone/programmazione/crosscompiler/mips/install/lib/gcc/mipsel-elf/4.6.2/../../../../mipsel-elf/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status
configure:4095: $? = 1
configure:4132: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main()
| {
|
| ;
| return 0;
| }
configure:4138: error: in `/home/bertone/programmazione/crosscompiler/mips/build/newlib':
configure:4142: error: C compiler cannot create executables