Firefly开源社区

标题: 按照WIKI上的教程进行内核编译出错 [打印本页]

作者: cjr198300    时间: 2015-11-18 15:19
标题: 按照WIKI上的教程进行内核编译出错
1.下载了3.多G的SDK。
2.按照wiki上的操作:
tar xf /path/to/firefly-rk3288_android4.4_git_20141211.tar.gz
git reset --hard
git remote add bitbucket https://bitbucket.org/T-Firefly/firefly-rk3288.git
git pull bitbucket master:master
3.继续按照wiki上的操作:
make firefly-rk3288_defconfig
make -j8 firefly-rk3288.img
在编译img时出现下面的错误:
root@chenjieren-virtual-machine:/yocto/firefly-rk3288/kernel# make -j8 firefly-rk3288.img
../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc: 1: ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc: Syntax error: "(" unexpected
  HOSTCC  scripts/basic/fixdep
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTCC  scripts/dtc/checks.o
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/selinux/genheaders/genheaders
../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc: 1: ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc: Syntax error: "(" unexpected
make[2]: *** [scripts/mod/empty.o] Error 2
make[2]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/kallsyms
make[1]: `include/generated/mach-types.h' is up to date.
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/pnmtologo
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/util.o
  CC      kernel/bounds.s
../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc: 1: ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc: Syntax error: "(" unexpected
make[1]: *** [kernel/bounds.s] Error 2
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
  HOSTLD  scripts/dtc/dtc
make: *** [scripts] Error 2
请问这是咋回事?
作者: zhansb    时间: 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗
作者: cjr198300    时间: 2015-11-19 13:24
ubuntu是32bit导致的。
还有个新问题:
我将SDK中的arm-eabi-4.6添加到环境变量中,将它作为firefly的交叉编译工具。
root@chen-virtual-machine:~# arm-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-eabi-gcc
COLLECT_LTO_WRAPPER=/home/chenjieren/firefly-rk3288/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../libexec/gcc/arm-eabi/4.6.x-google/lto-wrapper
Target: arm-eabi
Configured with: /tmp/android-15472/src/build/../gcc/gcc-4.6/configure --prefix=/usr/local --target=arm-eabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/android-15472/obj/temp-install --with-mpfr=/tmp/android-15472/obj/temp-install --with-mpc=/tmp/android-15472/obj/temp-install --without-ppl --without-cloog --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --with-abi=aapcs --with-gcc-version=4.6 --with-binutils-version=2.21 --with-gmp-version=4.2.4 --with-mpfr-version=2.4.1 --with-gdb-version=7.3.x --with-arch=armv5te --with-sysroot=/tmp/android-15472/install/sysroot --with-prefix=/tmp/android-15472/install --with-gold-version=2.21 --enable-gold --disable-gold --disable-multilib --program-transform-name='s&^&arm-eabi-&'
Thread model: single
gcc version 4.6.x-google 20120106 (prerelease) (GCC)

我写了个简单的helloworld的例子,来编译它,但是出现了下面的报错:
root@chen-virtual-machine:~# arm-eabi-gcc test.c -o test
test.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.



作者: cjr198300    时间: 2015-11-19 13:37
我尝试了下arm-eabi-gcc 4.7,编译也是通不过。
root@chenjieren-virtual-machine:~# arm-eabi-gcc test.c -o test
In file included from test.c:1:0:
/home/chenjieren/firefly-rk3288/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/../lib/gcc/arm-eabi/4.7/include-fixed/stdio.h:50:23: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
这里询问下,能否直接用SDK中的编译器作为交叉编译器呢?
作者: yangfeiouc    时间: 2015-11-20 11:35
试试这个:
$export ARCH=arm
$export CROSS_COMPILE=arm-linux-gnueabihf-
作者: jjlin77    时间: 2015-12-5 10:57
zhansb 发表于 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗

请问版主,我编译4.4 PAD版的kernel 提示这个错误哦,怎么回事
make[2]: *** [arch/arm/boot/compressed/piggy.lzo] 错误 1
作者: jjlin77    时间: 2015-12-5 10:58
zhansb 发表于 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗

  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: “include/generated/mach-types.h”是最新的。
  CC      scripts/mod/devicetable-offsets.s
  CALL    scripts/checksyscalls.sh
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTLD  scripts/mod/modpost
make[1]: “arch/arm/boot/dts/firefly-rk3288.dtb”是最新的。
  CHK     include/generated/compile.h
  GEN     drivers/video/rockchip/screen/lcd.h
  Kernel: arch/arm/boot/Image is ready
  LZO     arch/arm/boot/compressed/piggy.lzo
/bin/sh: 1: lzop: not found
make[2]: *** [arch/arm/boot/compressed/piggy.lzo] 错误 1
make[2]: *** 正在等待未完成的任务....
  CC      arch/arm/boot/compressed/decompress.o
make[1]: *** [arch/arm/boot/compressed/vmlinux] 错误 2
make: *** [zImage] 错误 2
作者: jjlin77    时间: 2015-12-5 11:02
zhansb 发表于 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗

版主 我知道了,不用看了,是没有安装lzop,装了就好了。:lol
作者: zhansb    时间: 2015-12-5 11:51
jjlin77 发表于 2015-12-5 11:02
版主 我知道了,不用看了,是没有安装lzop,装了就好了。

:handshake




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1