编译U-boot 出现 undefined reference to `dm9000_initialize' 的问题

    下载的  tekkamanninja-U-boot-2009.11_tekkaman 源代码编译时出现 undefined reference to `dm9000_initialize' 等一系列错误,

     经过多次编译常识终于找到原因  是交叉编译器的引起的问题

 

1 出现问题情况

github下载源代码后直接编译,由于 Makefile 中 定义的交叉编译器为

160行    CROSS_COMPILE = arm-9tdmi-linux-gnu-

而一般使用的是 arm-linux-  交叉编译器,当提示错误时我修改了  CROSS_COMPILE = arm-linux-

然后在继续make clean , make

出现  undefined reference to `dm9000_initialize' 等一系列错误

lib_arm/libarm.a(board.o): In function `init_func_i2c': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/lib_arm/board.c:203: undefined reference to `i2c_init' lib_arm/libarm.a(board.o): In function `start_armboot': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/lib_arm/board.c:345: undefined reference to `nand_init' lib_arm/libarm.a(board.o):(.data+0xc): undefined reference to `env_init' lib_arm/libarm.a(board.o):(.data+0x14): undefined reference to `serial_init' lib_arm/libarm.a(interrupts.o): In function `interrupt_init': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/lib_arm/interrupts.c:52: undefined reference to `arch_interrupt_init' common/libcommon.a(cmd_bootm.o): In function `do_bootd': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_bootm.c:1021: undefined reference to `parse_string_outer' common/libcommon.a(cmd_bootm.o): In function `do_bootm_qnxelf': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_bootm.c:1422: undefined reference to `do_bootelf' common/libcommon.a(cmd_bootm.o): In function `do_bootm_vxworks': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_bootm.c:1398: undefined reference to `do_bootvx' common/libcommon.a(cmd_bootm.o): In function `do_bootm': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_bootm.c:621: undefined reference to `usb_stop' common/libcommon.a(cmd_load.o): In function `do_load_serial_bin': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_load.c:473: undefined reference to `serial_setbrg' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_load.c:523: undefined reference to `serial_setbrg' common/libcommon.a(cmd_nand.o): In function `nand_print_info': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:214: undefined reference to `nand_info' common/libcommon.a(cmd_nand.o): In function `arg_off_size': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:164: undefined reference to `nand_curr_device' common/libcommon.a(cmd_nand.o): In function `nand_load_image': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:558: undefined reference to `nand_read_skip_bad' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:590: undefined reference to `nand_read_skip_bad' common/libcommon.a(cmd_nand.o): In function `do_nandboot': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:707: undefined reference to `nand_info' common/libcommon.a(cmd_nand.o): In function `do_nand': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:348: undefined reference to `nand_erase_opts' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:387: undefined reference to `nand_read_skip_bad' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:390: undefined reference to `nand_write_skip_bad' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:404: undefined reference to `nand_write_skip_bad' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:505: undefined reference to `nand_info' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nand.c:505: undefined reference to `nand_curr_device' common/libcommon.a(cmd_nvedit.o): In function `do_saveenv': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nvedit.c:597: undefined reference to `saveenv' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nvedit.c:598: undefined reference to `env_name_spec' common/libcommon.a(cmd_nvedit.o): In function `_do_setenv': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/cmd_nvedit.c:289: undefined reference to `serial_setbrg' common/libcommon.a(console.o): In function `getc': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:309: undefined reference to `serial_getc' common/libcommon.a(console.o): In function `tstc': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:325: undefined reference to `serial_tstc' common/libcommon.a(console.o): In function `putc': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:345: undefined reference to `serial_putc' common/libcommon.a(console.o): In function `puts': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:366: undefined reference to `serial_puts' common/libcommon.a(console.o): In function `console_init_r': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:646: undefined reference to `serial_getc' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:646: undefined reference to `serial_tstc' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:646: undefined reference to `serial_putc' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:646: undefined reference to `serial_puts' common/libcommon.a(console.o): In function `serial_printf': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/console.c:222: undefined reference to `serial_puts' common/libcommon.a(env_common.o): In function `env_get_char_init': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/env_common.c:154: undefined reference to `env_get_char_spec' common/libcommon.a(env_common.o): In function `env_crc_update': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/env_common.c:145: undefined reference to `env_ptr' common/libcommon.a(env_common.o): In function `set_default_env': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/env_common.c:223: undefined reference to `env_ptr' common/libcommon.a(env_common.o): In function `env_relocate': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/env_common.c:263: undefined reference to `env_relocate_spec' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/env_common.c:270: undefined reference to `env_ptr' common/libcommon.a(exports.o): In function `jumptable_init': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/exports.c:49: undefined reference to `i2c_write' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/exports.c:49: undefined reference to `i2c_read' common/libcommon.a(main.o): In function `do_run': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/main.c:1441: undefined reference to `parse_string_outer' common/libcommon.a(main.o): In function `main_loop': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/main.c:342: undefined reference to `u_boot_hush_start' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/main.c:408: undefined reference to `parse_string_outer' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/main.c:443: undefined reference to `parse_file_outer' common/libcommon.a(stdio.o): In function `stdio_init': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/stdio.c:223: undefined reference to `i2c_init' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/stdio.c:229: undefined reference to `drv_video_init' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/stdio.c:252: undefined reference to `serial_putc' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/stdio.c:252: undefined reference to `serial_puts' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/stdio.c:252: undefined reference to `serial_getc' /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/common/stdio.c:252: undefined reference to `serial_tstc' board/tekkamanninja/mini2440/libmini2440.a(mini2440.o): In function `board_eth_init': /tmp/tekkamanninja-U-boot-2009.11_tekkaman-16deca6/board/tekkamanninja/mini2440/mini2440.c:292: undefined reference to `dm9000_initialize' make: *** [u-boot] Error 1

 

在网上找了很多,也没有发现原因

于是决定从新解压源代码,然后直接就修改Makefile 中关于交叉编译器的定义

然后 make 2440_onfig , make

居然没有错误了

重复尝试了几次都可以顺利通过编译

感觉很奇怪

 

2 我对问题的理解

   除了修改Makefile的顺序不同,其他的操作都一样,于是猜想可能是交叉编译器arm-9tdmi-linux-gnu- 与 arm-linux- 的问题

  之后进行了多次常识,发现只要先修改Makefle中的  CROSS_COMPILE 然后在编译就不会出错

  如果下载后没有修改Makefile,而是等待make出现错误后再去查看 CROSS_COMPILE 的定义,发现不是arm-linux,在进行修改。

  之后无论是 make clean && make ,还是 从新配置了再make 都会出现类似的错误。

 

3 总结

    由于我是菜鸟,刚刚学习uboot,对于交叉编译器等很多都不了解。

    不清除问题的具体原因,但是至少知道了如果避免这个错误的出现。希望以后升入学习能够解释。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(function,String,cmd,makefile,reference,编译器)