- 论坛徽章:
- 0
|
本帖最后由 kallytin 于 2017-03-31 17:07 编辑
交叉编译:
编译平台:ubuntu(i386,32位)
目标平台:linux(arm,32位)
问题:
在“目标平台”是arm的情况下,glibc的编译语句该如何?
- 现在的编译语句如下:
- ../glibc-2.15/configure --prefix=/usr
- --host=$TARGET
- --enable-kernel=3.7.4
- --enable-add-ones
- --with-headers=$SYSROOT/usr/include
- libc_cv_forced_unwind=yes
- libc_cv_c_cleanup=yes
- libc_cv_ctors_header=yes
- make
- make install_root=$SYSROOT install
复制代码
注:
我也baidu了一下,但真没有找到有用的信息,希望曾经编译成功过的大师能分享一下他们的信息....
附:
编译过程:
第9步(构建完整交叉编译器)报错,如下:
- ...........
- ...........
- ../../../gcc-4.7.2/libgcc/../gcc/tsystem.h:88:19: fatal error: stdio.h: No such file or directory
- compilation terminated.
- make[2]: *** [_muldi3.o] Error 1
- make[2]: Leaving directory `/dest/build/gcc-build/arm-none-linux-gnueabi/libgcc'
- make[1]: *** [all-target-libgcc] Error 2
- make[1]: Leaving directory `/dest/build/gcc-build'
- make: *** [all] Error 2
- ...........
- ..........
- /bin/bash: line 3: cd: arm-none-linux-gnueabi/libstdc++-v3: No such file or directory
- make[1]: *** [install-target-libstdc++-v3] Error 1
- make[1]: Leaving directory `/dest/build/gcc-build'
- make: *** [install] Error 2
复制代码
问题定位:
- 1、在第8步,编译 glibc的时候,
- ........
- ........
- configure: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used
- checking build system type... i686-pc-linux-gnu
- checking host system type... arm-unknown-linux-gnueabi
- checking for arm-unknown-linux-gnueabi-gcc... arm-unknown-linux-gnueabi-gcc
- checking for suffix of object files... configure: error: in `/dest/build/glibc-build':
- configure: error: cannot compute suffix of object files: cannot compile
- See `config.log' for more details
- make: *** No targets specified and no makefile found. Stop.
- make: *** No rule to make target `install'. Stop.
- ........
- .......
- 最终导致 /dest/build/glibc-build/ 下没有相应的文件生成,继而最终使 stdio.h 也没有生成(正常
- 的应该是 /dest/sysroot/usr/include/stdio.h)
- 2、因为按照上面的各个步骤,在“目标平台”也是i386(现在是arm)时,是一切正常的,因此估计是 glibc
- 的编译选项出了问题。
复制代码
|
|