全部博文(105)
分类: 嵌入式
2016-06-04 16:07:43
source setup-environment
2.gcc工具链
bitbake meta-toolchain
6.单独编译C文件
yangzhiwen@yzw-kingsee:~$ cd /home/work/Elmo/test/test/
yangzhiwen@yzw-kingsee:/home/work/Elmo/test/test$ ls
main.c test
yangzhiwen@yzw-kingsee:/home/work/Elmo/test/test$ rm test
yangzhiwen@yzw-kingsee:/home/work/Elmo/test/test$ cat main.c
#include "stdlib.h"
#include "stdio.h"
void main(void)
{
printf("Hello world\n");
}
$ source /opt/poky/1.8/environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi
$ echo $CC
arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/opt/poky/1.8/sysroots/cortexa7hf-vfp-neon-poky-linux-gnueabi
$ $CC main.c -o test
$ file test
test: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=ad28e302b106823c7cbcd038f9cb4940c14b5f57, not stripped
补充:
参考PDF : Stand-alone_Build-Uboot-Kernel.rar