QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1609|回复: 0

菜鸟请教问题,有关于编译uClinux的问题,大侠请教请教

[复制链接]
发表于 2005-6-23 19:31:55 | 显示全部楼层 |阅读模式
1.我用的是:uClinux-dist-20040408.tar.gz与arm-elf-tools-20030314.sh
以下是我的编译uClinux 过程:

3. 执行脚本即可完成交叉编译器的安装
        ./arm-elf-tools-20030314.sh

4. 测试一下,输入 arm-elf-gcc 看看是否能够自动补齐?
[admin@localhost admin]$ arm-elf-gcc -v
Reading specs from /usr/local/lib/gcc-lib/arm-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)

[admin@localhost admin]$ which arm-elf-gcc
/usr/local/bin/arm-elf-gcc   

表明 arm-elf-gcc 已经安装在 /usr/local/bin/ 目录下了。


Step 1 :   交叉编译 uClinux 内核
1. 下载 uClinux-dist-20040408.tar.gz 到当前工作目录下
      
2. 解压 uClinux-dist-20040408.tar.gz 文件到 uClinux-dist 目录
        tar xvzf uClinux-dist-20040408.tar.gz
   此时当前工作目录下增加了一个名为 uClinux-dist 的目录。

3. 进入 uClinux-dist 目录
        cd uClinux-dist

4. 修改 vmlinux-armv.lds.in 文件,
        vi linux-2.4.x/arch/armnommu/vmlinux-armv.lds.in
   在
        *(got)         /* Global Offset table */
        之后添加如下语句:
        romfs_data = .;
        romfs.o
        romfs_data_end = .;
   即修改为:
     65                 *(.got)                 /* Global offset table          */
     66
     67                 /* add by lumit - http://www.lumit.org */
     68                 romfs_data = .;
     69                 romfs.o
     70                 romfs_data_end = .;

5. 修改 vendors/Samsung/4510B/Makefile 文件,
        vi vendors/Samsung/4510B/Makefile
   在 image 目标的第三行,增加一条语句:
        arm-elf-ld -r -o $(ROOTDIR)/$(LINUXDIR)/romfs.o -b binary $(ROMFSIMG)
   如下为增加之后:
     63 image:
     64         [ -d $(IMAGEDIR) ] || mkdir -p $(IMAGEDIR)
     65         genromfs -v -V "ROMdisk" -f $(ROMFSIMG) -d $(ROMFSDIR)
     66         arm-elf-ld -r -o $(ROOTDIR)/$(LINUXDIR)/romfs.o -b binary $(ROMFSIMG)
     67         $(CROSS_COMPILE)objcopy -O binary --remove-section=.romvec \
     68                         --remove-section=.text --remove-section=.ramvec \
     69                         --remove-section=.init \
     70                         --remove-section=.bss --remove-section=.eram \
     71                         $(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.data

6. make menuconfig
   在 Vendor/Product Selection  --->    中选择
--- Select the Vendor you wish to target  
(Samsung) Vendor
--- Select the Product you wish to target
(4510B) Samsung Products
                           
   在 Kernel/Library/Defaults Selection  --->   中选择
(linux-2.4.x) Kernel Version                              
(uClibc) Libc Version  

其他选项都不变,按照缺省设置,选择退出,保存配置。

7. make dep

8. make lib_only

9. make user_only
[说明] 编译login,boa程序时可能出现 undefined reference to 'crypt_old'的错误,
boa.elf2flt: In function `auth_check_userpass':
/tmp/liming/uClinux-dist/user/boa/src/auth.c:281: undefined reference to `crypt_old'
可以修改
config/.config
注释掉第25行的 CONFIG_USER_OLD_PASSWORDS
如下:
     24 CONFIG_USER_LOGIN_LOGIN=y
     25 # CONFIG_USER_OLD_PASSWORDS=y
     26 # CONFIG_USER_ONLY_ROOT is not set
然后再
cd user/boa/src/
rm *.o
重新编译 make user_only 一下这个目录里面的 obj 文件就可以了。

10. make romfs

11. make
.............

最终会出现以下问题,小弟实在搞不定拉,请教大虾指点

entry-armv.S: Assembler messages:
entry-armv.S:1283: Error: Internal_relocation (type 187) not fixed up (OFFSET_IMM)
entry-armv.S:1285: Error: Internal_relocation (type 185) not fixed up (IMMEDIATE)
entry-armv.S:1336: Error: Internal_relocation (type 187) not fixed up (OFFSET_IMM)
entry-armv.S:1337: Error: Internal_relocation (type 187) not fixed up (OFFSET_IMM)
entry-armv.S:1608: Error: Can not represent SWI relocation in this object file format (0)
make[2]: *** [entry-armv.o] Error 1
make[2]: Leaving directory `/usr/lizhaohui_App/linux_demo/uClinux-dist/linux-2.4.x/arch/armnommu/kernel'
make[1]: *** [_dir_arch/armnommu/kernel] Error 2
make[1]: Leaving directory `/usr/lizhaohui_App/linux_demo/uClinux-dist/linux-2.4.x'
make: *** [linux] Error 1
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-30 07:41 , Processed in 0.059230 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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