LoginSignup
0
0

More than 5 years have passed since last update.

Power PC Cross Compile Settings for CentOS 6.9 on Virtual Box / CentOSでPower PC用のアセンブラ環境の作り方

Last updated at Posted at 2017-10-29

57 yum install epel-release
58 yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
59 yum install yum-utils
60 yum-config-manager --enable remi-php70
61 yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el`rpm -q --whatprovides /etc/redhat-release --qf '%{version}\n'`.rf.x86_64.rpm
62 sudo yum update
63 wget http://ftp.gnu.org/gnu/binutils/binutils-2.29.1.tar.bz2
64 yum groupinstall "Development Tools"
65 yum groupinstall "Base"
66 yum install wget gcc gcc-c++ pcre-devel zlib-devel make openssl-devel libxml2 libxml2-devel libxslt-devel libxslt libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools-devel flex jemalloc
67 yum install wget gcc gcc-c++ pcre-devel zlib-devel make openssl-devel libxml2 libxml2-devel libxslt-devel libxslt libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools-devel flex jemalloc

68 yum install --enablerepo=epel gperftools
69 wget http://http://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.gz
70 wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.gz

sudo mkdir -p /opt/cross
100 sudo chmod 777 /opt/cross
101 export PATH="/opt/cross/bin:$PATH"

106 tar xvf binutils-2.29.1.tar.bz2

Download gcc-4.9.4 from
http://ftp.gnu.org/gnu/gcc/?C=M;O=D and tar
107 tar xvf gcc-4.9.4.tar.gz 


cd gcc-4.9.4
151 wget http://ftpmirror.gnu.org/gmp/gmp-6.0.0a.tar.xz
152 wget http://ftpmirror.gnu.org/mpfr/mpfr-3.1.2.tar.xz
153 wget http://ftpmirror.gnu.org/mpc/mpc-1.0.2.tar.gz

154 for f in .tar; do tar xf $f; done
155 ls

156 ln -s mpfr-3.1.2 mpfr
157 ls -s gmp-6.0.0 gmp
158 ln -s gmp-6.0.0 gmp
159 ln -s mpc-1.0.2 mpc

or

yum gmp-devel mpfr-devel mpc-devel

*if you get a following error once you hit below.

root#../../gcc-4.9.4/configure --prefix=/opt/cross --target=powerpc-elf


configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify


$ mkdir powerpc-elf
$ cd powerpc-elf

$ mkdir binutils
$ cd binutils
$ ../../binutils-2.29.1/configure --prefix=/opt/cross --target=powerpc-elf

$ make -j2

$ sudo make install

$ cd ..

$ mkdir gcc
$ cd gcc
$ ../../gcc-4.9.4/configure --prefix=/opt/cross --target=powerpc-elf
$ make -j2 all-gcc
$ sudo make install-gcc

[root@localhost gcc]# powerpc-elf-gcc -nostdlib -g -O sample.c

ignore below WARN.

/opt/cross/lib/gcc/powerpc-elf/4.9.4/../../../../powerpc-elf/bin/ld: WARN: cant find Entry Symbol_start. Use default 01800080.

[root@localhost gcc]# powerpc-elf-objdump -S a.out

then you can get a result.

Well Don't forget update your .bash_profile files.

Because You will have to type Export Path again if you reboot machine without update.

101 export PATH="/opt/cross/bin:$PATH"

Anyway, Please let us know if something wrong XD.

We will update this article as soon as we can !

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0