前回からの続き
6.11.1. Installation of Zlib
1 2 3 4 5 6 7 |
# cd /sources/ # tar xfvj zlib-1.2.6.tar.bz2 # cd zlib-1.2.6 # ./configure --prefix=/usr # make # make check # make install |
1 2 3 4 5 6 |
# mv -v /usr/lib/libz.so.* /lib `/usr/lib/libz.so.1' -> `/lib/libz.so.1' `/usr/lib/libz.so.1.2.6' -> `/lib/libz.so.1.2.6' # ln -sfv ../../lib/libz.so.1.2.6 /usr/lib/libz.so `/usr/lib/libz.so' -> `../../lib/libz.so.1.2.6' # |
6.12. File-5.10
1 2 3 4 5 6 7 |
# cd /sources/ # tar xfvz file-5.10.tar.gz # cd file-5.10 # ./configure --prefix=/usr # make # make check # make install |
6.13. Binutils-2.22
1 2 3 4 |
# cd /sources/ # rm -rf binutils-2.22 binutils-build/ # tar xfvj binutils-2.22.tar.bz2 # cd binutils-2.22 |
PTYがちゃんと動いているか確認。このように表示されるはず。
1 2 |
# expect -c "spawn ls" spawn ls |
古いstandards.infoをインストールしないようにする。
1 2 3 4 |
# rm -fv etc/standards.info removed `etc/standards.info' # sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in # |
1 2 |
# sed -i "/exception_defines.h/d" ld/testsuite/ld-elf/new.cc # sed -i "s/-fvtable-gc //" ld/testsuite/ld-selective/selective.exp |
1 2 3 |
# mkdir -v ../binutils-build mkdir: created directory `../binutils-build' # cd ../binutils-build/ |
1 |
# ../binutils-2.22/configure --prefix=/usr --enable-shared |
1 |
# make tooldir=/usr |
binutilsのテストは大事
1 2 |
# make -k check # make tooldir=/usr install |
ライブラリヘッダをインストール
1 |
# cp -v ../binutils-2.22/include/libiberty.h /usr/include |
6.14. GMP-5.0.4
1 2 3 4 5 |
# cd /sources/ # tar xfvJ gmp-5.0.4.tar.xz # cd gmp-5.0.4 # ./configure --prefix=/usr --enable-cxx --enable-mpbsd # make |
GMPのテストは重要
1 |
# make check 2>&1 | tee gmp-check-log |
1 |
# awk '/tests passed/{total+=$2} ; END{print total}' gmp-check-log |
1 |
# make install |
ドキュメントをインストール
1 2 3 4 5 6 7 8 9 |
# mkdir -v /usr/share/doc/gmp-5.0.4 mkdir: created directory `/usr/share/doc/gmp-5.0.4' # cp -v doc/{isa_abi_headache,configuration} doc/*.html \ > /usr/share/doc/gmp-5.0.4 `doc/isa_abi_headache' -> `/usr/share/doc/gmp-5.0.4/isa_abi_headache' `doc/configuration' -> `/usr/share/doc/gmp-5.0.4/configuration' `doc/projects.html' -> `/usr/share/doc/gmp-5.0.4/projects.html' `doc/tasks.html' -> `/usr/share/doc/gmp-5.0.4/tasks.html' # |
6.15. MPFR-3.1.0
1 2 3 4 5 6 |
# cd /sources/ # tar xfvj mpfr-3.1.0.tar.bz2 # cd mpfr-3.1.0 # patch -Np1 -i ../mpfr-3.1.0-fixes-1.patch # ./configure --prefix=/usr --enable-thread-safe --docdir=/usr/share/doc/mpfr-3.1.0 # make |
またもやテストは重要
1 |
# make check |
1 |
# make install |
6.16. MPC-0.9
1 2 3 4 5 6 7 |
# cd /sources/ # tar xfvz mpc-0.9.tar.gz # cd mpc-0.9 # ./configure --prefix=/usr # make # make check # make install |
6.17. GCC-4.6.2
1 2 3 4 |
# cd /sources/ # rm -rf gcc-4.6.2 gcc-build/ # tar xfvj gcc-4.6.2.tar.bz2 # cd gcc-4.6.2 |
binutilsで作ったlibiberty.aを利用するようにする。
1 |
# sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in |
1 2 3 4 |
# case `uname -m` in > i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' \ > gcc/Makefile.in ;; > esac |
1 |
# sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in |
1 2 3 |
# mkdir -v ../gcc-build mkdir: created directory `../gcc-build' # cd ../gcc-build |
configureする。インストールしたzlibを使うようにする。
1 2 3 4 5 |
# ../gcc-4.6.2/configure --prefix=/usr \ > --libexecdir=/usr/lib --enable-shared \ > --enable-threads=posix --enable-__cxa_atexit \ > --enable-clocale=gnu --enable-languages=c,c++ \ > --disable-multilib --disable-bootstrap --with-system-zlib |
1 |
# make |
テストはすごく重要。
スタックサイズを増やしておく
1 |
# ulimit -s 16384 |
すごく長いのでVM内でやったほうがいい。
1 |
# make -k check |
エラーでた。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
../gcc-4.6.2/contrib/test_summary cat <<'EOF' | LAST_UPDATED: Obtained from SVN: tags/gcc_4_6_2_release revision 180516 Native configuration is i686-pc-linux-gnu === g++ tests === Running target unix XPASS: g++.dg/uninit-pred-3_b.C (test for excess errors) === g++ Summary === # of expected passes 27426 # of unexpected successes 1 # of expected failures 167 # of unsupported tests 136 /sources/gcc-build/gcc/testsuite/g++/../../g++ version 4.6.2 (GCC) === gcc tests === Running target unix === gcc Summary === # of expected passes 77650 # of expected failures 212 # of unsupported tests 684 /sources/gcc-build/gcc/xgcc version 4.6.2 (GCC) === libgomp tests === Running target unix === libgomp Summary === # of expected passes 1071 === libmudflap tests === Running target unix FAIL: libmudflap.c/fail40-frag.c output pattern test FAIL: libmudflap.c/pass49-frag.c execution test FAIL: libmudflap.c/pass49-frag.c output pattern test FAIL: libmudflap.c/pass49-frag.c execution test FAIL: libmudflap.c/pass49-frag.c output pattern test FAIL: libmudflap.c/pass51-frag.c execution test FAIL: libmudflap.c/pass51-frag.c execution test FAIL: libmudflap.c/fail40-frag.c (-O2) output pattern test FAIL: libmudflap.c/pass49-frag.c (-O2) execution test FAIL: libmudflap.c/pass49-frag.c (-O2) output pattern test FAIL: libmudflap.c/pass49-frag.c (-O2) execution test FAIL: libmudflap.c/pass49-frag.c (-O2) output pattern test FAIL: libmudflap.c/pass51-frag.c (-O2) execution test FAIL: libmudflap.c/pass51-frag.c (-O2) execution test FAIL: libmudflap.c/fail40-frag.c (-O3) output pattern test FAIL: libmudflap.c/pass49-frag.c (-O3) execution test FAIL: libmudflap.c/pass49-frag.c (-O3) output pattern test FAIL: libmudflap.c/pass49-frag.c (-O3) execution test FAIL: libmudflap.c/pass49-frag.c (-O3) output pattern test FAIL: libmudflap.c/pass51-frag.c (-O3) execution test FAIL: libmudflap.c/pass51-frag.c (-O3) execution test FAIL: libmudflap.cth/pass39-frag.c (-O2) (rerun 19) execution test FAIL: libmudflap.cth/pass39-frag.c (-O2) (rerun 19) output pattern test === libmudflap Summary === # of expected passes 1404 # of unexpected failures 23 === libstdc++ tests === Running target unix === libstdc++ Summary === # of expected passes 8293 # of expected failures 84 # of unsupported tests 115 Compiler version: 4.6.2 (GCC) Platform: i686-pc-linux-gnu configure flags: --prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --disable-bootstrap --with-system-zlib EOF Mail -s "Results for 4.6.2 (GCC) testsuite on i686-pc-linux-gnu" gcc-testresults@gcc.gnu.org && mv /sources/gcc-build/./gcc/testsuite/g++/g++.sum /sources/gcc-build/./gcc/testsuite/g++/g++.sum.sent && mv /sources/gcc-build/./gcc/testsuite/gcc/gcc.sum /sources/gcc-build/./gcc/testsuite/gcc/gcc.sum.sent && mv /sources/gcc-build/./i686-pc-linux-gnu/libgomp/testsuite/libgomp.sum /sources/gcc-build/./i686-pc-linux-gnu/libgomp/testsuite/libgomp.sum.sent && mv /sources/gcc-build/./i686-pc-linux-gnu/libmudflap/testsuite/libmudflap.sum /sources/gcc-build/./i686-pc-linux-gnu/libmudflap/testsuite/libmudflap.sum.sent && mv /sources/gcc-build/./i686-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum /sources/gcc-build/./i686-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum.sent && mv /sources/gcc-build/./gcc/testsuite/g++/g++.log /sources/gcc-build/./gcc/testsuite/g++/g++.log.sent && mv /sources/gcc-build/./gcc/testsuite/gcc/gcc.log /sources/gcc-build/./gcc/testsuite/gcc/gcc.log.sent && mv /sources/gcc-build/./i686-pc-linux-gnu/libgomp/testsuite/libgomp.log /sources/gcc-build/./i686-pc-linux-gnu/libgomp/testsuite/libgomp.log.sent && mv /sources/gcc-build/./i686-pc-linux-gnu/libmudflap/testsuite/libmudflap.log /sources/gcc-build/./i686-pc-linux-gnu/libmudflap/testsuite/libmudflap.log.sent && mv /sources/gcc-build/./i686-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.log /sources/gcc-build/./i686-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.log.sent && true |
libmudflapはエラーが出るらしいがGCCのバグらしいのでスルー。
1 |
# make install |
1 2 3 |
# ln -sv ../usr/bin/cpp /lib `/lib/cpp' -> `../usr/bin/cpp' # |
1 |
# ln -sv gcc /usr/bin/cc |
1 2 3 4 5 6 7 8 9 |
# echo 'main(){}' > dummy.c # cc dummy.c -v -Wl,--verbose &> dummy.log # readelf -l a.out | grep ': /lib' [Requesting program interpreter: /lib/ld-linux.so.2] # grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../crt1.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../crti.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../crtn.o succeeded # |
この結果がマニュアルと順番が違う。けどもうスルー
1 2 3 4 5 6 7 |
# grep -B4 '^ /usr/include' dummy.log #include <...> search starts here: /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include /usr/local/include /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include-fixed /usr/include # |
1 2 3 4 5 6 |
# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") SEARCH_DIR("/usr/local/lib") SEARCH_DIR("/lib") SEARCH_DIR("/usr/lib"); # |
1 2 3 |
# grep "/lib.*/libc.so.6 " dummy.log attempt to open /lib/libc.so.6 succeeded # |
1 2 3 |
# grep found dummy.log found ld-linux.so.2 at /lib/ld-linux.so.2 # |
1 2 3 4 5 |
# rm -v dummy.c a.out dummy.log removed `dummy.c' removed `a.out' removed `dummy.log' # |