Mercurial > hg > CbC > CbC_gcc
annotate CbC-INSTALL @ 50:4e0a8e84ee55
Added tag cbc-4.4.3 for changeset 2e19f845ea37
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 07 Feb 2010 17:56:48 +0900 |
parents | d645ac0f55d6 |
children | 65b2ea5f1266 |
rev | line source |
---|---|
29
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 * CbC on GCCのインストール方法 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 まずはMercurialリポジトリから取得 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 hg clone ssh://one@firefly.cr/hg/CbC/GCC cbc-gcc |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 ビルド用ディレクトリへ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 mkdir build-gcc; cd build-gcc |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 コンフィギュア |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 一般的には以下のconfigureでビルドできる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 ../cbc-gcc/configure CFLAGS="-g3 -O0" |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 --prefix=$PWD/INSTALL_DIR --disable-nls \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 --disable-bootstrap --enable-languages=c \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 --enable-checking=tree,rtl,assert,types |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 -g3: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 gdbでmacroの展開を可能にする |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 -O0: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 gdbでトレースしやすいように、最適化をカット |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 --prefix: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 インストールするベースディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 --enbale-checking: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 デバグ用の指定、browse_treeやdebug_rtx、assertもこれでonになる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 --disable-bootstrap: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 通常、GCCは3回ビルドされる。それを最初の1回だけに限定 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 --disable-nls: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 gettextのl10nをoffにしよう |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 --enable-language: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 使用する言語 c|c++|ada ... もちろんCbCはcだけ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 これもcbcを使えるようにしたい |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 ビルド |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 make && make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 * PowerPC Macでのインストール |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 最新のlibgmp, libmpfrをインストール |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 [gmp] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 ./configure --enable-cxx --build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 make && make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 [mpfr] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 ./configure --build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 make && make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 [CbC on GCC] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 ../cbc-gcc/configure CFLAGS="-g3 -O0" --with-gmp=/usr/local |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 --with-mpfr=/usr/local --prefix=$PWD/INSTALL_DIR \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 --disable-nls --disable-bootstrap --enable-languages=c \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 --enable-checking=tree,rtl,assert,types |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 make && make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 もちろんインストール場所によってprefixは変更しよう |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 * PS3でのビルド |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 SPU |
45
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
57 $ ../GCC/configure CFLAGS='-g -O0' --prefix=$PWD/INSTALL_DIR |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
58 --disable-nls --disable-shared --disable-threads |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
59 --enable-checking=tree,rtl,assert --with-system-zlib |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
60 --with-newlib --enable-languages=c |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
61 --enable-version-specific-runtime-libs --disable-libssp |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
62 --program-prefix=cbc-spu- --target=spu --disable-bootstrap |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
63 $ make && make install |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
64 $ cd INSTALL_DIR; ln -s /usr/spu; cd .. |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
65 で、動作確認のあと |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
66 $ sudo make prefix=/usr/local/cbc install |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
67 $ cd /usr/local/cbc; ln -s /usr/spu; cd - |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
68 |
29
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 PPU |
45
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
70 $ ../GCC/configure --prefix=$PWD/INSTALL_DIR |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
71 --host=ppc64-redhat-linux --build=ppc64-redhat-linux |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
72 --target=ppc64-redhat-linux --program-prefix=cbc- --disable-bootstrap |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
73 --enable-checking=tree,rtl,assert --disable-nls --enable-shared |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
74 --enable-thread=posix --enable-languages=c --with-system-zlib |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
75 --enable-__cxa_atexit --disable-libunwind-exceptions --disable-dssi |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
76 --enable-plugin --with-long-double-128 --with-gnu-as |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
77 --with-as=/usr/bin/as --with-gnu-ld --with-ld=/usr/bin/ld |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
78 --with-cpu=default32 |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
79 $ make && make install |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
80 動作確認 |
d645ac0f55d6
add instration howto for PS3 to CbC-INSTALL.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
81 $ make prefix=/usr/local/cbc install |
29
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 * 琉球大学総合情報センターのSolarisサーバでのビルド (sparc) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 なぜかデフォルトのgccが自分のライブラリすら見てくれないのでパスを指定 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/gcc:$HOME/opt/lib |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 export LIBRARY_PATH=/usr/local/lib:/usr/local/lib/gcc:$HOME/opt/lib |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 gmpのインストール |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 ./configure --prefix=$HOME/opt \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 --build=sparc-sun-solaris \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 --host=sparc-sun-solaris |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 make |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 make check |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 libmpfrのインストール |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 ./configure --prefix=$HOME/opt/ \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 --with-gmp=$HOME/opt |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 --build=sparc-sun-solaris \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 --host=sparc-sun-solaris |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 make |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 make check |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 # sparc-sun-solaris2.10の方がいいかもしれない |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 CbCをインストール |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 ../CbCGCC/configure --prefix=$PWD/INSTALL_DIR --disable-nls \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 --disable-bootstrap --enable-languages=c \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 --with-gmp=$HOME/opt --with-mpfr=$HOME/opt \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 --build=sparc-sun-solaris2.10 --target=sparc-sun-solaris2.10 \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 --host=sparc-sun-solaris2.10 --enable-shared \ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 make |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 make install |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 ビルドは可能。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 ただし、実行は不能 goto cs();すら動かない |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 config/sparc/sparc.cのoutput_sibcall()でエラーが出る |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 gdbがインストールされてないので詳細は未調査 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 もしかしてsibcallってあまり実装されてないんじゃ… |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 |
32 | 123 ___________________________________________________________ |
124 PS3用のクロスコンパイラの作成 | |
125 ----------------------------------------------------------- | |
126 | |
127 PS3でのGCCのビルドはメモリが少なすぎるためか、insn-*.cのコンパイルに膨 | |
128 大な時間がかかってしまう。 | |
129 なので別のマシンからPS3をターゲットとしたクロスコンパイラを作成する。 | |
130 ただしこれはCbConGCCの開発のためと考えた方が良い。実際にCbC言語を使っ | |
131 たプログラムをPS3で開発する際はちゃんとPS3上にノンクロスコンパイラを作 | |
132 成しよう。時間はかかるがビルドは可能。 | |
133 | |
134 * 必要なもの | |
135 o binutilsのソース | |
136 o gccのソース | |
137 o ターゲットマシンのlib*.{a,so}類 | |
138 o ターゲットマシンの.hファイル | |
139 ~/PS3CROSSにクロスコンパイラ環境を整えるとする | |
140 ~/PS3CROSS/cross-tools: クロスコンパイルに使うツールのインストール先 | |
141 ~/PS3CROSS/sources: ソース置き場、出来上がったら消してもいいよ | |
142 ~/PS3CROSS/target-env: ターゲット環境(libやinclude)が入ったディレクトリ | |
143 | |
144 * 準備 | |
145 $ CROSS=$HOME/PS3CROSS | |
146 $ cd $CROSS | |
147 $ mkdir sources cross-tools target-env | |
148 $ cd sources | |
149 $ wget ... binutilsとかgccのソースをダウンロード | |
150 | |
151 * binutilsのビルド | |
152 $ tar xvf binutils..tar.gz | |
153 $ mkdir PS3-binutils-build; cd !#1 | |
154 $ ../binutils-.../configure --prefix=$CROSS/cross-tools \ | |
155 --with-lib-path=$CROSS/target-env \ | |
156 --hosti686-pc-linux-gnu --build=i686-pc-linux-gnu \ | |
157 --target=ppc64-redhat-linux --enable-64-bit-bfd \ | |
158 --disable-nls --enable-shared --with-sysroot | |
159 $ make && make install | |
160 | |
161 * ターゲットマシンの環境をコピーする | |
162 $ cd $CROSS/target-env | |
163 $ mkdir include lib lib64 | |
164 $ ln -s . usr | |
165 ## 必要なライブラリはすべてコピー | |
166 $ cd lib | |
167 $ rsync -avl 'charles.cr:/lib/libc[.-_]*' ./ | |
168 $ rsync -avl 'charles.cr:/usr/lib/libc[.-_]*' ./ | |
169 $ rsync -avl 'charles.cr:/usr/lib/crt*' ./ | |
170 $ rsync -avl 'charles.cr:/lib/ld*' ./ | |
171 $ cd ../lib64 | |
172 $ ..... | |
173 ## ヘッダは軽いので全部コピー | |
174 $ cd ../include | |
175 $ rsync -avl 'charles.cr:/usr/include/*' ./ | |
176 | |
177 * GCCのビルド | |
178 $ cd $CROSS/sources | |
179 $ mkdir PS3-gcc-build; cd !#1 | |
180 $ ../.../configure --prefix=$CROSS/cross-tools | |
181 --host=i686-pc-linux-gnu --target=ppc64-redhat-linux | |
182 --with-sysroot=$CROSS/target-env --disable-nls | |
183 --disable-shared --disable-threads | |
184 --enable-languages=c --without-headers | |
185 --disable-bootstrap | |
186 $ make all-gcc | |
187 $ make ## エラーで終わるけど気にするな | |
188 $ make install-gcc | |
189 $ make install-target-libgcc | |
190 | |
191 * テスト | |
192 $ cat >test.c <<EOF | |
193 #include<stdio.h> | |
194 int | |
195 main(int argc, char **argv) | |
196 { | |
197 int a=0; | |
198 int i; | |
199 for (i=0; i<10; i++) { | |
200 a = i; | |
201 } | |
202 printf("hello world\n"); | |
203 printf("a = %d\n", a); | |
204 return a; | |
205 } | |
206 EOF | |
207 $ $CROSS/cross-tools/bin/gcc -m32 test.c -o test32 | |
208 $ $CROSS/cross-tools/bin/gcc -m64 test.c -o test64 | |
209 $ file test32 test64 | |
210 test32: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped | |
211 test64: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped | |
212 $ scp test{32,64} PS3Machine: | |
213 PS3Machine $ ./test32 | |
29
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 |
32 | 217 |
218 | |
219 | |
220 |