QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4412|回复: 2

请高手帮我分析一下uboot编译中的问题,附错误信息

[复制链接]
发表于 2008-5-21 14:40:17 | 显示全部楼层 |阅读模式
/usr/local/arm/bin/arm-linux-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float -mshort-load-bytes -D__KERNEL__ -DTEXT_BASE=0x21f00000  -I/home/arm/linux/u-boot-1.1.6/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/bin/../lib/gcc-lib/arm-linux/3.2/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv4 -mapcs-32 -Wall -Wstrict-prototypes -c -o cmd_bootm.o cmd_bootm.c
cmd_bootm.c:470:1: directives may not be used inside a macro argument
cmd_bootm.c:469:9: unterminated argument list invoking macro "U_BOOT_CMD"
cmd_bootm.c:477: parse error before ')' token
make[1]: *** [cmd_bootm.o] Error 1
make[1]: Leaving directory `/home/arm/linux/u-boot-1.1.6/common'
make: *** [common/libcommon.a] Error 2


cmd_bootm.c中的代码:

U_BOOT_CMD(
        bootm,  CFG_MAXARGS,    1,      do_bootm,
        "bootm   - boot application image from memory\n",
        "[addr [arg ...]]\n    - boot application image stored in memory\n"
        "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
        "\t'arg' can be the address of an initrd image\n"                                 (469)
#ifdef CONFIG_OF_FLAT_TREE                                                                (470)
        "\tWhen booting a Linux kernel which requires a flat device-tree\n"
        "\ta third argument is required which is the address of the of the\n"
        "\tdevice-tree blob. To boot that kernel without an initrd image,\n"
        "\tuse a '-' for the second argument. If you do not pass a third\n"
        "\ta bd_info struct will be passed instead\n"
#endif
);                                                                                                          (477)



U_BOOT_CMD命令的定义:                                                                                
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage, help}
                                                                                
#else   /* no long help info */
 楼主| 发表于 2008-5-21 14:51:07 | 显示全部楼层
忘了说了,我用的是arm cross linux 3.2 编译器  uboot是1.1.6版本
回复

使用道具 举报

发表于 2008-8-28 16:49:10 | 显示全部楼层
宏调用中有编译开关就出错,我和你一样的问题,不知道怎么解决。
其实把编译开关移到宏调用外面就好了,但是每次都这样很麻烦,不知道有什么好的办法。
比如:
///////原来的代码/////////////
/*U_BOOT_CMD(
        autoscr, 2, 0,        do_autoscript,
        "autoscr - run script from memory\n",
        "[addr] - run script starting at addr"
        " - A valid autoscr header must be present\n"
#if defined(CONFIG_FIT)
        "For FIT format uImage addr must include subimage\n"
        "unit name in the form of addr:<subimg_uname>\n"
#endif
);*/
////////////移到外面来就可以了/////////////
#if defined(CONFIG_FIT)
U_BOOT_CMD(
        autoscr, 2, 0,        do_autoscript,
        "autoscr - run script from memory\n",
        "[addr] - run script starting at addr"
        " - A valid autoscr header must be present\n"
);
#else
U_BOOT_CMD(
        autoscr, 2, 0,        do_autoscript,
        "autoscr - run script from memory\n",
        "[addr] - run script starting at addr"
        " - A valid autoscr header must be present\n"
        "For FIT format uImage addr must include subimage\n"
        "unit name in the form of addr:<subimg_uname>\n"
);
#endif
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-3-28 23:25 , Processed in 0.052471 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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