finder 发表于 2014-7-8 16:56:04

ubuntu 编译失败

使用的系统:ubuntu-1204-desktop-amd64
电脑环境:虚拟机 vmware 7.5,2核,2G内存
分区情况: /20G ,/opt80G
编译失败前的动作如下:
设置 root 账号密码
安装vim, apt-get install vim
安装samba, apt-get install samba smbfs samba-common smbclient
安装SSH,apt-get install ssh
解压 ubuntu_env_install.tar.bz2,并执行解压后的 ubuntu_env_install.sh,
       成功安装了 pc 版的 gcc-4.4,并查看确定 /usr/lib/gcc 已经指向新装的 /usr/bin/gcc-4.4
解压 uboot_E9_1.3.4_for_ubuntu.tar.bz2,并进入uboot目录且make 成功。
解压 linux_E9_3.0.35_for_ubuntu.tar.bz2 ,然后 cp imx6_config .config 。
       说明书写的是 cp imx6_defconfig .config ,但我只找到了 imx6_config
然后执行 make uImage 出现错误如下:

root@finder-ubuntu-virtual:/opt/Embedsky/TQIMX6/E9/Ubuntu/linux_E9_3.0.35_for_Ubuntu# make uImage
HOSTLDscripts/kconfig/conf
/usr/bin/ld: scripts/kconfig/conf.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: scripts/kconfig/conf.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: scripts/kconfig/conf.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: scripts/kconfig/conf.o: Relocations in generic ELF (EM: 40)
scripts/kconfig/conf.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** Error 1
make: *** Error 2
make: *** No rule to make target

`include/config/auto.conf', needed by `include/config/kernel.release'.Stop.
root@finder-ubuntu-virtual:/opt/Embedsky/TQIMX6/E9/Ubuntu/linux_E9_3.0.35_for_Ubuntu#

以前有试过出现ELF (EM:40 )错误时,是因为把不同版本的 o 文件进行 link

另外就是虽然 ubuntu 的源码编译出错,但是照着说明书来做,android 的源码是可以正常编译成功的。

TQ-ZQL 发表于 2014-7-10 10:29:37

先make menuconfigARCH=arm一下什么都不做直接保存退出,再编译

finder 发表于 2014-7-11 11:35:45

TQ-ZQL 发表于 2014-7-10 10:29
先make menuconfigARCH=arm一下什么都不做直接保存退出,再编译

版主你好,我试过 make menuconfig ARCH=arm 进入设置界面,然后 EXIT.再 make uImage ,仍然是那个错误。

我也参考了其他贴的说明,在 Makefile 里面增加 ARCH := arm
把原来的
CROSS_COMPILE        ?= $(CONFIG_CROSS_COMPILE:"%"=%)
改为
CROSS_COMPILE        := /opt/work/mx6/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-

再去编译,仍然是同样的 ELF (EM:40) 的错误。
页: [1]
查看完整版本: ubuntu 编译失败