主题 : 3.4.1 编译 最新下载的U-BOOT 1.1.6  出现如下错误 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
楼主  发表于: 2009-04-29 10:58

 3.4.1 编译 最新下载的U-BOOT 1.1.6  出现如下错误

arm-linux-ld: ERROR: /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/libgcc.a(_udivdi3.oS) uses hardware FP, whereas u-boot uses software FP
arm-linux-ld: failed to merge target specific data of file /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/libgcc.a(_udivdi3.oS)
arm-linux-ld: ERROR: /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/libgcc.a(_clz.oS) uses hardware FP, whereas u-boot uses software FP
arm-linux-ld: failed to merge target specific data of file /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/libgcc.a(_clz.oS)
make: *** [u-boot] 错误 1

昨天也使用国4.3.2编译,错误是同样的,不知道该怎么解决
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-04-29 12:22

 Re:3.4.1 编译 最新下载的U-BOOT 1.1.6 出现如下错误

"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
2楼  发表于: 2009-04-29 18:09

 Re:3.4.1 编译 最新下载的U-BOOT 1.1.6 出现如下错误

我安装了上面的编译链,修改了环境变量

不过使用 arm-linux-gcc -v 命令,总是显示文件不存在

后来没办法,重新使用4.3.2 ,结果竟然编译成功了

哎,真是没地说理去,虽然编辑成功了,可是到现在也不知道当时究竟哪个地方出了问题


另外还有一个非常重要的问题请问版主:比如我想吧,编译环境从3.4.1修改成4.3.2
先修改/etc/bash.bashrc   中的PATH
然后就必须退出系统,重新誊录才可以修改编译环境,这样非常的麻烦。请问用什么方法可以不退出系统,就可以修改编译环境??
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-04-29 20:26

 回 2楼(zhangxiaowei) 的帖子

我个人是不赞成修改PATH变量的,如果你一定要这么做,可以在当前的命令行窗口内手动输入命令:
export PATH=/path/to/your/toolchain:$PATH
然后在同一窗口内开始编译

对于交叉编译u-boot, 建议你用u-boot Makefile里的ARCH和CROSS_COMPILE变量,比如
make ARCH=arm CROSS_COMPILE=/usr/local/arm/3.4.1/bin/arm-linux-gcc smdk2410_config
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
4楼  发表于: 2009-04-30 09:34

 Re:3.4.1 编译 最新下载的U-BOOT 1.1.6 出现如下错误

版主推荐几本书吧,苦于自己知识不足,可是找不到合适的资料书

大多数书的架构都差不多,而且讲得比较浅或者比较粗略


谢谢
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
5楼  发表于: 2009-04-30 09:53

 Re:3.4.1 编译 最新下载的U-BOOT 1.1.6 出现如下错误

不知版主有没有看过 韦东山 编的《嵌入式Linux应用开发完全手册》
当中第15章讲到u-boot 1.1.6的移植  其中修改后的/cpu/arm920t/s3c24x0/speed.c 如下所示
/*
* (C) Copyright 2001-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* (C) Copyright 2002
* David Mueller, ELSOFT AG, d.mueller@elsoft.ch
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/

/* This code should work for both the S3C2400 and the S3C2410
* as they seem to have the same PLL and clock machinery inside.
* The different address mapping is handled by the s3c24xx.h files below.
*/

#include <common.h>
#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB)

#if defined(CONFIG_S3C2400)
#include <s3c2400.h>
#elif defined(CONFIG_S3C2410)
#include <s3c2410.h>
#endif

DECLARE_GLOBAL_DATA_PTR;

#define MPLL 0
#define UPLL 1

/* ------------------------------------------------------------------------- */
/* NOTE: This describes the proper use of this file.
*
* CONFIG_SYS_CLK_FREQ should be defined as the input frequency of the PLL.
*
* get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of
* the specified bus in HZ.
*/
/* ------------------------------------------------------------------------- */

static ulong get_PLLCLK(int pllreg)
{
    S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
    ulong r, m, p, s;

    if (pllreg == MPLL)
    r = clk_power->MPLLCON;
    else if (pllreg == UPLL)
    r = clk_power->UPLLCON;
    else
    hang();

    m = ((r & 0xFF000) >> 12) + 8;
    p = ((r & 0x003F0) >> 4) + 2;
    s = r & 0x3;

    /* support both of S3C2410 and S3C2440, by www.arm9.net */
    if (gd->bd->bi_arch_number == MACH_TYPE_SMDK2410)
        return((CONFIG_SYS_CLK_FREQ * m) / (p << s));
    else
        return((CONFIG_SYS_CLK_FREQ * m * 2) / (p << s));   /* S3C2440 */
}

/* return FCLK frequency */
ulong get_FCLK(void)
{
    return(get_PLLCLK(MPLL));
}

/* for s3c2440 */
#define S3C2440_CLKDIVN_PDIVN        (1<<0)
#define S3C2440_CLKDIVN_HDIVN_MASK   (3<<1)
#define S3C2440_CLKDIVN_HDIVN_1      (0<<1)
#define S3C2440_CLKDIVN_HDIVN_2      (1<<1)
#define S3C2440_CLKDIVN_HDIVN_4_8    (2<<1)
#define S3C2440_CLKDIVN_HDIVN_3_6    (3<<1)
#define S3C2440_CLKDIVN_UCLK         (1<<3)

#define S3C2440_CAMDIVN_CAMCLK_MASK  (0xf<<0)
#define S3C2440_CAMDIVN_CAMCLK_SEL   (1<<4)
#define S3C2440_CAMDIVN_HCLK3_HALF   (1<<8)
#define S3C2440_CAMDIVN_HCLK4_HALF   (1<<9)
#define S3C2440_CAMDIVN_DVSEN        (1<<12)

/* return HCLK frequency */
ulong get_HCLK(void)
{
    S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
    unsigned long clkdiv;
    unsigned long camdiv;
    int hdiv = 1;

    /* support both of S3C2410 and S3C2440, by www.arm9.net */
    if (gd->bd->bi_arch_number == MACH_TYPE_SMDK2410)
        return((clk_power->CLKDIVN & 0x2) ? get_FCLK()/2 : get_FCLK());
    else
    {
        clkdiv = clk_power->CLKDIVN;
        camdiv = clk_power->CAMDIVN;

        /* work out clock scalings */

        switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
        case S3C2440_CLKDIVN_HDIVN_1:
            hdiv = 1;
            break;

        case S3C2440_CLKDIVN_HDIVN_2:
            hdiv = 2;
            break;

        case S3C2440_CLKDIVN_HDIVN_4_8:
            hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 8 : 4;
            break;

        case S3C2440_CLKDIVN_HDIVN_3_6:
            hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3;
            break;
        }

        return get_FCLK() / hdiv;
    }
}

/* return PCLK frequency */
ulong get_PCLK(void)
{
    S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
    unsigned long clkdiv;
    unsigned long camdiv;
    int hdiv = 1;

    /* support both of S3C2410 and S3C2440, by www.arm9.net */
    if (gd->bd->bi_arch_number == MACH_TYPE_SMDK2410)
        return((clk_power->CLKDIVN & 0x1) ? get_HCLK()/2 : get_HCLK());
    else
    {  
        clkdiv = clk_power->CLKDIVN;
        camdiv = clk_power->CAMDIVN;

        /* work out clock scalings */

        switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
        case S3C2440_CLKDIVN_HDIVN_1:
            hdiv = 1;
            break;

        case S3C2440_CLKDIVN_HDIVN_2:
            hdiv = 2;
            break;

        case S3C2440_CLKDIVN_HDIVN_4_8:
            hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 8 : 4;
            break;

        case S3C2440_CLKDIVN_HDIVN_3_6:
            hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3;
            break;
        }

        return get_FCLK() / hdiv / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1);
    }        
}

/* return UCLK frequency */
ulong get_UCLK(void)
{
    return(get_PLLCLK(UPLL));
}

#endif /* defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB) */

更改后编译出现错误
peed.c:1: warning: target CPU does not support interworking
speed.c: In function 'get_HCLK':
speed.c:114: error: 'S3C24X0_CLOCK_POWER' has no member named 'CAMDIVN'
speed.c: In function 'get_PCLK':
speed.c:154: error: 'S3C24X0_CLOCK_POWER' has no member named 'CAMDIVN'
make[1]: *** [speed.o] 错误 1
make[1]:正在离开目录 `/opt/FriendlyARM/QQ2440/u-boot-1.1.6/cpu/arm920t/s3c24x0'
make: *** [cpu/arm920t/s3c24x0/libs3c24x0.a] 错误 2

我看了你们做好移植以后的u-boot的代码,好像这个没有什么不同
可是就是编译不过

是不是我用的编译器有问题4.3.2   可是昨天用这个编译器编译你们移植好的u-boot没有问题!


求救