内核编译初期问题,大家指教

unbutun 2009-08-16 05:46:05


UPD include/linux/compile.h
CC init/version.o
CC init/do_mounts.o
CC init/do_mounts_rd.o
CC init/do_mounts_initrd.o
CC init/do_mounts_md.o
LD init/mounts.o
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
ld: init/do_mounts.o: Relocations in generic ELF (EM: 40)
init/do_mounts.o: could not read symbols: File in wrong format
make[1]: *** [init/mounts.o] Error 1
make: *** [init] Error 2







以上是错误提示。
之前已经设置了
export CC=arm-linux-gcc
export AR=arm-linux-ar
export AS=arm-linux-as
export LD=arm-linux-ld
export NM=arm-linux-nm
export RANLIB=arm-linux-ranlib
export STRIP=arm-linux-strip
export SIZE=arm-linux-size
这些环境变量,并取消了kernel menuconfig上的elf

目标板为2440,编译器应该是没问题,请问高人问题在哪里?
...全文
1738 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
jianjiaximufeng 2011-03-09
  • 打赏
  • 举报
回复
我也碰到了你一样的问题,编译器版本该怎默选呢?
unbutun 2009-08-23
  • 打赏
  • 举报
回复
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySA
C0"
MACH_TYPE = 782
NOW, Booting Linux......
Uncompressing Linux.............................................................
...................................................... done, booting the kernel.


Error: unrecognized/unsupported machine ID (r1 = 0x0000030e).

Available machine support:

ID (hex) NAME
000000c1 SMDK2410
0000015b IPAQ-H1940
0000039f Acer-N35
00000290 Acer-N30
0000014b Simtec-BAST
000002a8 Nex Vision - Otom 1.1
00000400 AML_M5900
000001db Thorcom-VR1000
00000454 QT2410
000003fe SMDK2413
000003f1 SMDK2412
00000377 S3C2413
00000474 VSTMS
000002de Simtec-Anubis
0000034a Simtec-OSIRIS
00000250 IPAQ-RX3715
0000016a SMDK2440
000002a9 NexVision - Nexcoder 2440
0000043c SMDK2443


现在做到这一步了,提示板子和板子驱动有不匹配的地方,想问arch\arm\mach-***对应板子驱动,这个地方都要实现什么,都配什么才能把kernel boot起来?
unbutun 2009-08-23
  • 打赏
  • 举报
回复
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySA
C0"
MACH_TYPE = 782
NOW, Booting Linux......
Uncompressing Linux.............................................................
...................................................... done, booting the kernel.


Error: unrecognized/unsupported machine ID (r1 = 0x0000030e).

Available machine support:

ID (hex) NAME
000000c1 SMDK2410
0000015b IPAQ-H1940
0000039f Acer-N35
00000290 Acer-N30
0000014b Simtec-BAST
000002a8 Nex Vision - Otom 1.1
00000400 AML_M5900
000001db Thorcom-VR1000
00000454 QT2410
000003fe SMDK2413
000003f1 SMDK2412
00000377 S3C2413
00000474 VSTMS
000002de Simtec-Anubis
0000034a Simtec-OSIRIS
00000250 IPAQ-RX3715
0000016a SMDK2440
000002a9 NexVision - Nexcoder 2440
0000043c SMDK2443


现在做到这一步了,提示板子和板子驱动有不匹配的地方,想问arch\arm\mach-***对应板子驱动,这个地方都要实现什么,都配什么才能把kernel boot起来?
eijikayn 2009-08-22
  • 打赏
  • 举报
回复
感觉像是库的问题,建议换个编译库试试
gcc_gun 2009-08-22
  • 打赏
  • 举报
回复
你这是一开始编译就出现这样的错误还是编译了一会才出现的啊?
我觉得也是gcc的版本问题,换个低点的版本试试。
unbutun 2009-08-22
  • 打赏
  • 举报
回复
这个问题已经解决,就是编译器版本问题,高了低了都有问题,呵呵
unbutun 2009-08-21
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 unbutun 的回复:]
上面的问题已经解决


大家谁知道下面这个怎么解决?


init/built-in.o: In function `do_one_initcall':
/home/buery/workspace/linux-2.6.29/init/main.c:694: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `run_init_process':
/home/buery/workspace/linux-2.6.29/init/main.c:781: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `init_post':
/home/buery/workspace/linux-2.6.29/init/main.c:790: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `name_to_dev_t':
/home/buery/workspace/linux-2.6.29/init/do_mounts.c:77: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `rest_init':
/home/buery/workspace/linux-2.6.29/init/main.c:452: undefined reference to `__gnu_mcount_nc'
init/built-in.o:/home/buery/workspace/linux-2.6.29/init/calibrate.c:123: more undefined references to `__gnu_mcount_nc' follow


google了一下说是要打个patch,可patch去哪找,怎么确定那个patch就是我想找的?

还有patch的想法是对的吗?大家帮忙了
[/Quote]


继续up,这个问题还没解决,换了codesourcery 的4.3.2的gcc 不行,大家帮帮忙
pottichu 2009-08-18
  • 打赏
  • 举报
回复
你的 kernel 是什么版本 ? gcc 是什么版本 ?
hhyh612 2009-08-18
  • 打赏
  • 举报
回复
貌似是交叉编译器版本的问题
flinymengw4u 2009-08-18
  • 打赏
  • 举报
回复
是不是缺少头文件,查查calibrate.c需要什么头文件
pottichu 2009-08-17
  • 打赏
  • 举报
回复
你只需要修改 kernel 根目录下的 Makefile

ARCH ?= arm
CROSS_COMPILE=arm-linux-

就可以了,不要
export CC=arm-linux-gcc

因为编译内核时,有些东西是要用 gcc 去编译的,你把 CC 改成 arm gcc ,自然会出错。

unbutun 2009-08-17
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 pottichu 的回复:]
你只需要修改 kernel 根目录下的 Makefile

ARCH            ?= arm
CROSS_COMPILE=arm-linux-

就可以了,不要
export CC=arm-linux-gcc

因为编译内核时,有些东西是要用 gcc 去编译的,你把 CC 改成 arm gcc ,自然会出错。


[/Quote]


你这个并不能解决第二个问题,第二个才是现在要解决的问题。
unbutun 2009-08-16
  • 打赏
  • 举报
回复
对,我也搜到了这种说法,可是怎么解决呢。


解决问题才是真的。
ShowMan 2009-08-16
  • 打赏
  • 举报
回复
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38703
unbutun 2009-08-16
  • 打赏
  • 举报
回复
上面的问题已经解决


大家谁知道下面这个怎么解决?


init/built-in.o: In function `do_one_initcall':
/home/buery/workspace/linux-2.6.29/init/main.c:694: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `run_init_process':
/home/buery/workspace/linux-2.6.29/init/main.c:781: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `init_post':
/home/buery/workspace/linux-2.6.29/init/main.c:790: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `name_to_dev_t':
/home/buery/workspace/linux-2.6.29/init/do_mounts.c:77: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `rest_init':
/home/buery/workspace/linux-2.6.29/init/main.c:452: undefined reference to `__gnu_mcount_nc'
init/built-in.o:/home/buery/workspace/linux-2.6.29/init/calibrate.c:123: more undefined references to `__gnu_mcount_nc' follow


google了一下说是要打个patch,可patch去哪找,怎么确定那个patch就是我想找的?

还有patch的想法是对的吗?大家帮忙了

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧