Chinaunix

标题: [嵌入式]求助:u-boot移植问题 [打印本页]

作者: dglwx    时间: 2006-12-19 23:26
标题: [嵌入式]求助:u-boot移植问题
在编译u-boot-1.1.6时出现下面的错误,是移植到samsung的s3c2410上去!
应该是makefile的问题,但不知道怎么改!高手能不能帮哈忙哦,今天搞了一天。谢个先!
[root@dglwx u-boot-1.1.6]# make
for dir in tools examples post post/cpu ; do make -C $dir _depend ; done
make[1]: Entering directory `/root/embed/u-boot-1.1.6/tools'
ln -s ../common/environment.c environment.c
ln -s ../lib_generic/crc32.c crc32.c
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/tools'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/tools'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/tools'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/post'
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/post'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/post'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/post'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/post/cpu'
make[1]: *** 没有规则可以创建“.depend”需要的目标“asm.S”。 停止。
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/post/cpu'
make: *** [depend] 错误 2
作者: dglwx    时间: 2006-12-20 21:38
怎么还没人回答啊?没人做过u-boot的移植吗?

   "难道是我没把问题说清楚?"<道哥>


我实在是对GNU make 不熟,哪位牛人就帮我看看吧.要不这几天又睡不着了!
作者: yidou    时间: 2006-12-21 09:43
make[1]: Entering directory `/root/embed/u-boot-1.1.6/post/cpu'
make[1]: *** 没有规则可以创建“.depend”需要的目标“asm.S”。 停止。
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/post/cpu'
make: *** [depend] 错误 2


可能post这部分代码还不支持你的cpu & board
如果你不需要POST功能,在include/configs/xxxxx.h 中,把CONFIG_POST注销掉,再试试看
xxxxx.h是目标board对应的配置文件
作者: dglwx    时间: 2006-12-21 14:19
POST不是上电自检吗?能去掉么?
还有那前面的:
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/tools'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/tools'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/tools'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Leaving directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Entering directory `/root/embed/u-boot-1.1.6/examples'
make[1]: Nothing to be done for `_depend'.

那不这也要去掉?
作者: Pacer    时间: 2006-12-21 15:26
这个问题可以直接试试去换一个交叉编译器,我遇到过这,好像是u-boot的bug和交叉编译器的问题都有
细节我不知道,我只知道换了一个版本的就可以了,这是我学的时候的手记你可以看一下:

Wed Nov 22 12:27:37 CST 2006

I was compiled u-boot-1.1.2 for "smdk2410" completely,and the flow showing below.

Flow:
http://www.handhelds.org/downloa ... x-gcc-3.3.2.tar.bz2
We can download arm-linux-gcc-3.3.2.tar.bz2 from the URL above.
Following,do the command such as:

          tar -jxvf ./arm-linux-gcc-3.3.2.tar.bz2

Then you can see a new directory at current path,and then:

          cd usr/local/arm

Transfer it to(into) /usr/local/arm(sub-directory arm was created by yourself)

          mv ./3.3.2 /usr/local/arm/

Now,we should change the content of  /etc/profile.

          vi /etc/profile

Add a new line as "PATH=$PATH:/usr/local/arm/3.3.2/bin" at last or wherever you would like.Restart or Relogin,maybe export the variable will be better.

In the following several steps,we are begin to compile the u-boot-1.1.2.

Turn into the directory /arm/u-boot-1.1.2 and typed:

          make smdk2410_config

(smdk2410 is a familiar board and a good example for developers in our country.)
(I guessed that you should known how to change the value of CROSS_COMPILE ... .)

          make
    or
          make 2>&1 | tee /arm/logs/make_smdk.log

At last,four binaries such as u-boot,u-boot.bin,u-boot.map and u-boot.srec were created successfully,if without any exceptions.

[ 本帖最后由 Pacer 于 2006-12-21 15:30 编辑 ]
作者: dglwx    时间: 2006-12-21 19:24
我的交叉编译器用过arm-linux-gcc 2.4.1和arm-linux-gcc 2.95.3,也试过用arm-linux-elf,都提示同样的错误,我怀疑是不是Makefile文件的问题?
    我看网上的资料都是用arm-linux-gcc 2. 和U-boot 1.1.4,按照他们说的做,但是不行.都是提示上面的那个错误.
作者: dglwx    时间: 2006-12-21 19:30
真不知道编译一个U-boot要试多少交叉编译工具.
我试过:u-boot1.1.4  u-boot 1.1.5 u-boot 1.1.6
交叉编译工具试过::arm-linux-gcc 2.4.1  arm-linux-gcc 2.95.3   arm-linux-elf

也许路还要继续走下去... ...
作者: Pacer    时间: 2006-12-22 09:32
我当时也玩了两天,直接用Google搜索罢,中文的解答很少
作者: richardcong    时间: 2006-12-22 10:06
标题: 回复 1楼 dglwx 的帖子
编译U-BOOT的时候,还要把你u-boot的所有代码放到/usr/local目录下,我用的是2.95.3,应该可以的!
作者: richardcong    时间: 2006-12-22 10:08
标题: 回复 1楼 dglwx 的帖子
另外,补充一点我用的是u-boot-1.1.3
作者: yidou    时间: 2006-12-22 10:20
很好解决的问题,被你弄这么复杂
作者: Pacer    时间: 2006-12-22 16:29
我重新编了一下,没有任何问题,另外有一个软/硬浮点的问题要注意.下面是它的解决办法:

  1. 11-27-2006 17:58 AT91SAMXXXX U-Boot编译成功,解问题为软浮点与硬浮点问题.所用交叉链为硬浮点,AT91所用U-Boot为软浮点,解决方法为注释掉/cpu/<cpu_name>/config.mk中的 -msoft-float选项.
  2. AT91SAMXXXX为arm926ejs系列也同样注释掉其目录中config.mk的CFLAGS选项.
复制代码

[ 本帖最后由 Pacer 于 2006-12-22 16:32 编辑 ]
作者: dglwx    时间: 2006-12-22 23:09
为什么我的还是出现那个问题呢? 提示错误完全一样.
不过我还是想知道楼上所说的:软浮点和硬浮点分别指什么?能不能解释一下.3ks!
作者: dglwx    时间: 2006-12-22 23:32
原帖由 yidou 于 2006-12-22 10:20 发表
很好解决的问题,被你弄这么复杂


不知道我们怎么把问题搞复杂了,还需要yidou兄解释解释.
我的开发板是s3c2410.Linux内核用的是1.2.18.2,u-boot的版本应该不能很低.如果(万一)u-boot这个问题在短期内不能解决,我想换个bootloader,不知道大家有没有好的建议,还有没有别的选择?
作者: Pacer    时间: 2006-12-25 15:13
原帖由 dglwx 于 2006-12-22 23:09 发表
为什么我的还是出现那个问题呢? 提示错误完全一样.
不过我还是想知道楼上所说的:软浮点和硬浮点分别指什么?能不能解释一下.3ks!


也一样不懂软硬浮点,但是这个能查到(在Baidu可以直接输入软浮点然后第二个主题就可以看,Google比较吃力)。
作者: dglwx    时间: 2006-12-29 20:32
看了一下,不是那个问题,我下了个ELDK ,在那下面都能编译,我估计还是交叉编译工具的问题!
作者: Pacer    时间: 2007-01-04 09:53
编过去了吗?
作者: dglwx    时间: 2007-01-04 23:25
做了几次,绝望了,不过我换着使用eldk,有一次能够编译,并且生成了uboot.bin文件,但是在开始的时候,还是提示以前的错误,居然他能够继续编译.到现在不解!
作者: Pacer    时间: 2007-01-05 10:06
你试下 arm-linux-gcc -v罢,我上次把这个忘了.arm-linux-gcc我也出现过此类问题.你可以参照一下,hope this helps.


Mon Dec 25 10:35:05 CST 2006

Solution of one error(one type of errors)

Description of the error:

The error such as "installation problem, cannot exec `cc1': No such file or
directory..." occured while you(I) was compiling something.

Solution:

This error's reason is an incorrectly path for the cross toolchain you
installed.So,the user(you) can perform the command "arm-elf-gcc -v" to make
a view of the compiler's version ,configuration-path and other info.

The messages outputed after I performed the command are showing below:

[root@BFD5BFD5 at91sam9260ek]# arm-elf-gcc -v
Reading specs from /srv/shared/gnuarm/gnuarm-3.4.3/lib/gcc/arm-elf/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --target=arm-elf
--prefix=/srv/shared/gnuarm/gnuarm-3.4.3 --enable-interwork --enable-multilib
--with-newlib --with-headers=../newlib-1.12.0/newlib/libc/include
--enable-languages=c,c++,java --disable-libgcj
Thread model: single
gcc version 3.4.3

You can find the first line over this message.So,the ancient path which
configured by www.gnuarm.com is /srv/shared/gnuarm,but not in the default
position as /usr/local/arm.

So,do those serveral steps showing below:

     > mkdir /srv/shared/gnuarm
     > mv (the directory you uncompressed the cross toolchain)/gnuarm-3.4.3 \
        /srv/shared/gnuarm
     And note,the last step is modify /etc/profile.Change environment variable
     PATH.En.... this one:
          PATH=$PATH:/srv/shared/gnuarm/gnuarm-3.4.3/bin
     save and quit.Then restart your Linux.All will be OK.

[ 本帖最后由 Pacer 于 2007-1-5 10:08 编辑 ]
作者: dglwx    时间: 2007-01-05 11:58
这个我也测试了的,一切正常!
今天一大清早我又编译了一遍,使用ELDK,还是出现那个问题!
作者: dglwx    时间: 2007-01-05 11:59
[root@localhost u-boot-1.1.4]# arm-linux-gcc -v
Using built-in specs.
Target: arm-linux
Configured with: /opt/eldk/build/arm-2006-01-16/work/usr/src/denx/BUILD/crosstool-0.35/build/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/gcc-4.0.0/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/var/tmp/eldk.2XRo76/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux --with-headers=/var/tmp/eldk.2XRo76/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux/include --with-local-prefix=/var/tmp/eldk.2XRo76/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.0.0 (DENX ELDK 4.0 4.0.0)
[root@localhost u-boot-1.1.4]#
作者: Pacer    时间: 2007-01-05 13:38
prefix=/var/tmp/eldk.2XRo76/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux
作者: dglwx    时间: 2007-01-05 21:15
原帖由 Pacer 于 2007-1-5 13:38 发表
prefix=/var/tmp/eldk.2XRo76/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux


那只是一个临时文件。 是我的eldk安装有问题还是我没配置好环境变量或是我在make时要带参数?
作者: dglwx    时间: 2007-01-06 11:41
出现那个错误是不是因为make的版本过高? 在CSDN上看到有个帖友发的帖子,说他以前编译出错是因为make版本的原因.我看我们老师在Red hat linux 9下编译特别顺利.按照老师的步骤,我在FC4和FC6下编译都会出错.
作者: Pacer    时间: 2007-01-08 09:51
你试着把你解压的东西拷到prefix=路径
的下面和prefix那个相同的路径试试
作者: kaka`    时间: 2007-01-09 16:50
u-boot 1.1.6用arm-linux-gcc 3.2 和3.0都可以通过啊,很容易啊.我做的sbc2410x的板子.
u-boot 1.1.6已经直接支持这个板子了!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2