cjr198300 发表于 2015-11-18 15:19:29

按照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
HOSTCCscripts/basic/fixdep
CHK   include/generated/uapi/linux/version.h
CHK   include/generated/utsrelease.h
HOSTCCscripts/dtc/checks.o
CC      scripts/mod/empty.o
HOSTCCscripts/mod/mk_elfconfig
HOSTCCscripts/dtc/data.o
HOSTCCscripts/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: *** Error 2
make: *** Waiting for unfinished jobs....
HOSTCCscripts/selinux/mdp/mdp
HOSTCCscripts/kallsyms
make: `include/generated/mach-types.h' is up to date.
HOSTCCscripts/dtc/dtc-lexer.lex.o
HOSTCCscripts/pnmtologo
make: *** Error 2
make: *** Waiting for unfinished jobs....
HOSTCCscripts/dtc/dtc-parser.tab.o
HOSTCCscripts/dtc/dtc.o
HOSTCCscripts/dtc/flattree.o
HOSTCCscripts/dtc/fstree.o
HOSTCCscripts/dtc/livetree.o
HOSTCCscripts/dtc/srcpos.o
HOSTCCscripts/dtc/treesource.o
HOSTCCscripts/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: *** Error 2
make: *** Error 2
make: *** Waiting for unfinished jobs....
HOSTLDscripts/dtc/dtc
make: *** Error 2
请问这是咋回事?

zhansb 发表于 2015-11-18 19:43:47

ubuntu用32bit还是64bit
环境装好了吗

cjr198300 发表于 2015-11-19 13:24:51

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:33

我尝试了下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:46

试试这个:
$export ARCH=arm
$export CROSS_COMPILE=arm-linux-gnueabihf-

jjlin77 发表于 2015-12-5 10:57:34

zhansb 发表于 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗

请问版主,我编译4.4 PAD版的kernel 提示这个错误哦,怎么回事
make: *** 错误 1

jjlin77 发表于 2015-12-5 10:58:18

zhansb 发表于 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗

CHK   include/generated/uapi/linux/version.h
CHK   include/generated/utsrelease.h
make: “include/generated/mach-types.h”是最新的。
CC      scripts/mod/devicetable-offsets.s
CALL    scripts/checksyscalls.sh
GEN   scripts/mod/devicetable-offsets.h
HOSTCCscripts/mod/file2alias.o
HOSTLDscripts/mod/modpost
make: “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: *** 错误 1
make: *** 正在等待未完成的任务....
CC      arch/arm/boot/compressed/decompress.o
make: *** 错误 2
make: *** 错误 2

jjlin77 发表于 2015-12-5 11:02:48

zhansb 发表于 2015-11-18 19:43
ubuntu用32bit还是64bit
环境装好了吗

版主 我知道了,不用看了,是没有安装lzop,装了就好了。:lol

zhansb 发表于 2015-12-5 11:51:42

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

:handshake
页: [1]
查看完整版本: 按照WIKI上的教程进行内核编译出错