在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
芯片精品文章合集(500篇!)    创芯人才网--重磅上线啦!
查看: 5554|回复: 4

求教:如何在cygwin上搭建PowerPC交叉编译环境?

[复制链接]
发表于 2008-5-30 10:20:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本来已经在Linux下有一个eldk的编译器了.但由于PC经常工作在XP下,所以就在XP下安装了一个虚拟Linux环境的CygWin,想在cygwin上搭建PowerPC交叉编译环境(主要针对MPC875).
哪位有这方面的成功经验的?
在网上看到一篇这方面的文章,照着做没成功.文章内容如下(红体字部分):
                                                       使用GNU编译器.  
GNU编译器是免费的编译器. 而且是交叉编译器. 支持mips arm, ppc, M680.
Cygwin是一种linux仿真器, 可以使GNU在windows2000下运行.  
有了这俩个, 应该, 不需要买什么编译器了.  
For more information about gcc,  go to
http://gcc.gnu.org/
For cygwin,  go to  
http://www.cygwin.com/
Download GNU software
ftp://ftp.gnu.org

我是用他来编译PPC的程序的.  
安装步骤如下.  不过我用的是GCC-3.0.3版.  
编译GCC我的机器是900Mhz PIII cpu 256M memory.
大约是3个小时.  
如果, 你不是特别一定要用的话, 那可别玩.  
(以下是从网上拷贝的).  
Building a gcc crosscompiler for powerpc on win32

get cygwin, and source for binutils-2.10 gcc-2.95.2-core, gcc-2.85.2, newlib-1.82

Install cygwin [add instructions here]

run cygwin. you"ll get a bash prompt (...oh my god it"s unix!)

make a folder to do all the work in and cd to it
(e.g. mkdir /cygdrive/d/gcc-win32, cd /cygdrive/d/gcc-win32 - this translates to d:/gcc-win32 in MS land)

unzip binutils and gcc-core and gcc and newlib into there  

make a build directory (build-win32, say)

mkdir build-win32/binutils
cd  build-win32/binutils
../../binutils-2.10/configure --prefix=/usr/target-powerpc --target=powerpc-unknown-eabi
make
make install

以上是生成powerpc的汇编编译器.  

export PATH=/usr/target-powerpc/bin:$PATH

cd ..
mkdir gcc-core
cd gcc-core

../../gcc-2.95.2-core/configure  --prefix=/usr/target-powerpc --target=powerpc-unknown-eabi --with-exeext=".exe" --with-newlib  

make
make install
只有编译core. 如果现在就编译全部GCC的会, 会出错, 我的个人经验.  


for some reason the build produces a gcc spec file with CR/LF"s rather than LF Line endings, so convert  the line endings on

/usr/target-powerpc/lib/gcc-lib/powerpc-unknown-eabi/2.95.2/spec

[ NOTE:
(if you dont have a suitable tool use the following shell script - create a file called  dos2unix with this in and stick it in your /usr/local/bin)

#!/bin/sh
cat $1 | sed "s/^M\{1,\}$//" | sed "$ s/^Z//" > $2

]


以上, 如果你mount disk的模式为bin mode的话, 不会出现.  

----- these following stages are only useful if you want a standard c library or c++/java/chill ----


compile newlib
cd ..
mkdir newlib

../../newlib-1.82/configure  --prefix=/usr/target-powerpc/ --target=powerpc-
unknown-eabi

make
make install


and finally build a full gcc

cd ..
mkdir gcc
cd gcc

../../gcc-2.95.2/configure  --prefix=/usr/target-powerpc --target=powerpc-unknown-eabi --with-exeext=".exe" --with-newlib  

make
make install


[ 本帖最后由 sinco449 于 2008-6-2 15:14 编辑 ]
发表于 2008-5-31 16:17:10 | 显示全部楼层
good.
 楼主| 发表于 2008-6-2 15:15:28 | 显示全部楼层
期盼高手来解答
发表于 2008-6-17 10:50:52 | 显示全部楼层
谢谢介绍,怪不得GNU用不了,系统不对
发表于 2008-6-18 21:37:59 | 显示全部楼层
谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-19 18:26 , Processed in 0.037662 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表