天嵌 ARM开发社区

 找回密码
 注册
查看: 4551|回复: 2

ubuntu 编译失败

[复制链接]
finder 发表于 2014-7-8 16:56:04 | 显示全部楼层 |阅读模式
使用的系统:ubuntu-1204-desktop-amd64
电脑环境:虚拟机 vmware 7.5,2核,2G内存
分区情况: /  20G ,  /opt  80G
编译失败前的动作如下:
设置 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
HOSTLD  scripts/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[2]: *** [scripts/kconfig/conf] Error 1
make[1]: *** [silentoldconfig] 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 menuconfig  ARCH=arm一下什么都不做直接保存退出,再编译
 楼主| finder 发表于 2014-7-11 11:35:45 | 显示全部楼层
TQ-ZQL 发表于 2014-7-10 10:29
先make menuconfig  ARCH=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) 的错误。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-7 03:25 , Processed in 1.031250 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表