りぬざうスケッチ
binutils のインストール
最終更新:
zauhack
-
view
クロスコンパイル環境構築 > binutils のインストール
GNU の ftp site (のミラー) から、最新の binutil を持ってくる。
現時点 (2010/03/26) での最新は 2.20 だが、うまくコンパイルできないので、2.19 を使った。
signature の verify も忘れずに... と言いたいところだが、鍵はどこにあるんだ? (PGP keyserver にはないぞ!?)。
現時点 (2010/03/26) での最新は 2.20 だが、うまくコンパイルできないので、2.19 を使った。
signature の verify も忘れずに... と言いたいところだが、鍵はどこにあるんだ? (PGP keyserver にはないぞ!?)。
で、インストール手順:
bzip2 -cd $(SRCDIR)/binutils-2.19.tar.bz2 | tar xvf - cd binutils-2.19
あとは configure & make だが、bash が入っていない環境だとうまくいかないので、その場合は後述のパッチをあてる (ちょ~ ad hoc)。
(bash の有無で処理を分けているようだけど、パースしちゃってる?)
もちろん bash が入っていればパッチ不要。
(bash の有無で処理を分けているようだけど、パースしちゃってる?)
もちろん bash が入っていればパッチ不要。
patch < $(SRCDIR)/binutils.diff
./configure --prefix=$(CROSSDIR) --enable-shared --target=arm-linux --enable-targets=xscale-linux-elf gmake gmake install
FreeBSD の場合、素の make では通らないので注意
(Solaris 10 の /usr/ccs/bin/make もダメみたい)。
(Solaris 10 の /usr/ccs/bin/make もダメみたい)。
後片付け
cd .. rm -rf binutils-2.19/
パッチの内容
これも手パッチの方が早いやね
--- ld/genscripts.sh,orig Mon Aug 13 04:00:07 2007
+++ ld/genscripts.sh Fri Sep 21 10:09:56 2007
@@ -391,19 +391,19 @@
esac
if test -n "${BASH+set}"; then
- source_em()
- {
- local current_script="$em_script"
- em_script=$1
- . $em_script
- em_script=$current_script
- }
- fragment()
- {
- local lineno=$[${BASH_LINENO[0]} + 1]
- echo >> e${EMULATION_NAME}.c "#line $lineno \"$em_script\""
- cat >> e${EMULATION_NAME}.c
- }
+# source_em()
+# {
+# local current_script="$em_script"
+# em_script=$1
+# . $em_script
+# em_script=$current_script
+# }
+# fragment()
+# {
+# local lineno=$[${BASH_LINENO[0]} + 1]
+# echo >> e${EMULATION_NAME}.c "#line $lineno \"$em_script\""
+# cat >> e${EMULATION_NAME}.c
+# }
else
source_em()
{
(参考) binutils-2.20 コンパイル時のエラー
gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./config -I./../include -I./.. -I./../bfd -I./../intl -DLOCALEDIR="\"/usr/local/zaurus/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT tc-arm.o -MD -MP -MF .deps/tc-arm.Tpo -c -o tc-arm.o `test -f 'config/tc-arm.c' || echo './'`config/tc-arm.c config/tc-arm.c: In function `make_mapping_symbol': config/tc-arm.c:2488: warning: empty body in an if-statement gmake[4]: *** [tc-arm.o] Error 1 gmake[4]: Leaving directory `/tmp/work/binutils-2.20/gas' gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory `/tmp/work/binutils-2.20/gas' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/tmp/work/binutils-2.20/gas' gmake[1]: *** [all-gas] Error 2 gmake[1]: Leaving directory `/tmp/work/binutils-2.20' gmake: *** [all] Error 2
添付ファイル