Chinaunix首页 | 论坛 | 博客
  • 博客访问: 84838
  • 博文数量: 28
  • 博客积分: 1430
  • 博客等级: 上尉
  • 技术积分: 240
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-30 23:34
文章分类

全部博文(28)

文章存档

2011年(2)

2006年(26)

我的朋友

分类: C/C++

2006-10-13 09:08:51

- -

                                      

 

For compiling my x86_64 driver in the 32 bit system, I build my cross compile environment.
Now I will write about it for not forget it tomorrow. I hope someone can get help
from it.
First download the kernel 2.6.9-1.667 for Fedora core 3 .
Second unzip it and install the rpm  package use follow command line.
#rpm -i kernel-source-2.6.9-1.667
#cd /usr/src/redhat/SPECES
#rpmbuild -bp --target=i686 kernel-SPECES
#cd /usr/src/redhat/kernel-2.6.9-1.667
#cp configs/x.config .config (here you will cp all the config file each time and repeat the next two step)
#make oldconfig;make (You needn't wait for completing make, you can broken it after about half minutes)
#find .|grep Kconfig|xargs tar czf /tmp/kernelsmp.tgz include arch/x86_64 scripts drivers/scsi .config
#find .|grep Makefile|xargs tar czf /tmp/Makefile.tgz
then copy the kernel.tgz and Makefile.tgz to the 32 bit system.
#mkdir x86_64
#mv Makefile.tgz kernel.tgz x86_64
#tar xvzf Makefile.tgz;tar xvfz kernel.tgz
to get the files in scripts for 32bit system, I type below command.
#make SUBDIR=x86_64/scripts ARCH=x86_64
The head files have been distilled.
Next download the 3.4.3 gcc source from the gcc ftp site, you can get help from the
.
#bunzip2 gccsource.bzip2
#tar xx.tar
get the gcc source
#cd gcc-3.4.3
#./configure --target=amd64-linux
#make
In my compile process there are some wrong happened I really don't know how to solve it.But luckilly I have got the xgcc cc1 etc. files .
so I copy the file to the /usr/bin and add prefix x86_64-linux-
Then in the compiling driver process I will add below make option.
MAKEOPT="CROSS_COMPILE=x86_64-linux- ARCH=x86_64"

For all now I can compile my driver on 32bit system for x86_64.
Again wish you can get help from my article, thank you for you coming here by accident.

阅读(1375) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~