{"id":857,"date":"2010-10-09T11:11:08","date_gmt":"2010-10-09T10:11:08","guid":{"rendered":"http:\/\/sahits.ch\/blog\/?p=857"},"modified":"2010-10-09T11:11:08","modified_gmt":"2010-10-09T10:11:08","slug":"updating-compiler-suite","status":"publish","type":"post","link":"http:\/\/sahits.ch\/blog\/blog\/2010\/10\/09\/updating-compiler-suite\/","title":{"rendered":"Updating compiler suite"},"content":{"rendered":"<p>Since every attempt to produce a compiler for my NAS that can be used to compile the OpenJDK failed, I decided to create a toolchain on the NAS to compile this stuff. The reason for a separate toolchain is that libraries are needed that are used by the running system. Replacing them is a bad idea. Therefore I set up a native toolchain to compile other programs into the running system. Basically this is the same as the first couple of chapters form the <a href=\"http:\/\/www.linuxfromscratch.org\/lfs\/view\/stable\/index.html\">Linux from Scratch (Version 6.5)<\/a> approach, which I used as guidance. The following listing does <strong>not<\/strong> produce the desired results but it is never the less a good starting point.<!--more--><\/p>\n<h1>First pass<\/h1>\n<h2>Binutilities 2.19.1<\/h2>\n<p><code>LDFLAGS=\"-L\/opt\/usr\/lib\" ..\/binutils-2.19.1\/configure --target=$LFS_TGT --prefix=$LFS --disable-nls --disable-werror<\/code><br \/>\nThe LDFLAGS is necessary because the libz.so resides in \/opt\/usr\/lib and not in the standard search path \/usr\/lib. Without this library the size of the type off_t (File pointer) cannot be computed.<\/p>\n<h2>GCC 4.4.3<\/h2>\n<p>To be able to compile the JDK I need a bootstrap JDK compiler. This will be GCJ. But in the first pass the Java extension is not included. I included the packages GMP, MPFR and MPC in the compile process of GCC.<br \/>\n<code>..\/gcc-4.4.3\/configure --target=$LFS_TGT --prefix=$LFS --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads<br \/>\n--disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c<\/code><br \/>\nThe next step is to install the linux headers of the appropriate version. The version can be retrieved by <code>uname -a<\/code><\/p>\n<h2>GLibC 2.10.1<\/h2>\n<p><code>..\/glibc-2.10.1\/configure --prefix=$LFS --host=$LFS_TGT  --build=$(..\/glibc-2.10.1\/scripts\/config.guess) --disable-profile --enable-add-ons --enable-kernel=2.6.18 --with-headers=$LFS\/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes<\/code><br \/>\nAfter that the specs file of the compile has to be adjusted.<\/p>\n<h1>Second run<\/h1>\n<h2>Binutils<\/h2>\n<p><code>CC=\"$LFS_TGT-gcc -B$LFS\/lib\/\" \\<br \/>\n   AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \\<br \/>\n   ..\/binutils-2.19.1\/configure --prefix=$LFS \\<br \/>\n   --disable-nls --with-lib-path=$LFS\/lib<\/code><br \/>\nThe linker must be created with a special linking to the libary directories:<br \/>\n<code>make -C ld LIB_PATH=\/opt\/usr\/lib:\/opt\/lib:\/usr\/lib:\/lib<\/code><\/p>\n<h2>GCC<\/h2>\n<p>Even though the version used here differes from the LFS script (4.4.1) the same fixtures can be applied.<br \/>\n<code>CC=\"$LFS_TGT-gcc -B$LFS\/lib\/\" \\<br \/>\n    AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \\<br \/>\n    ..\/gcc-4.4.3\/configure --prefix=$LFS \\<br \/>\n    --with-local-prefix=$LFS --enable-clocale=gnu \\<br \/>\n    --enable-shared --enable-threads=posix \\<br \/>\n    --enable-__cxa_atexit --enable-languages=c,c++ \\<br \/>\n    --disable-libstdcxx-pch --disable-multilib \\<br \/>\n    --disable-bootstrap<\/code><br \/>\nThe configure may fail due to the CC variable (compiler not found). If so replace $LFS_TGT-gcc with the actual path to the corresponding compiler.<\/p>\n<h2>Tcl 8.5.7<\/h2>\n<p>This package is compiled into the original host system:<br \/>\n<code>.\/configure --prefix=\/opt\/usr\/local<\/code><\/p>\n<h2>Expect 5.43.0<\/h2>\n<p><code>.\/configure --prefix=\/opt\/usr\/local --with-tcl=\/opt\/usr\/local\/lib \\<br \/>\n  --with-tclinclude=\/opt\/usr\/local\/include --with-x=no<\/code><\/p>\n<h2>DejaGNU 1.4.4<\/h2>\n<p><code>.\/configure --prefix=\/opt\/usr\/local<\/code><br \/>\nThese last three packages were not installed into the toolchain. Therefore I compiled them a second time for the toolchain.<\/p>\n<h2> Ncurses 5.7<\/h2>\n<p><code>.\/configure --prefix=$LFS --with-shared \\<br \/>\n    --without-debug --without-ada --enable-overwrite<\/code><\/p>\n<h2>Bash 4.0<\/h2>\n<p><code>.\/configure --prefix=$LFS --without-bash-malloc<\/code><\/p>\n<h2>Bzip 1.0.5<\/h2>\n<p>This package has no configuration, the prefix parameter is passed to the make install command:<br \/>\n<code>make PREFIX=$LFS install<\/code><\/p>\n<h2>Corutils 7.4<\/h2>\n<p><code>.\/configure --prefix=$LFS --enable-install-program=hostname<\/code><br \/>\nThe tests are very excessive and do not run with user root.<\/p>\n<h2>Diffutils 2.8.1<\/h2>\n<p><code>.\/configure --prefix=$LFS<\/code><\/p>\n<h2>Findutils 5.19<\/h2>\n<p><code>.\/configure --prefix=$LFS<\/code><\/p>\n<h2>Gawk 3.1.7<\/h2>\n<p><code>.\/configure --prefix=$LFS<\/code><\/p>\n<h2>Gettext 0.17<\/h2>\n<p><code>.\/configure --prefix=$LFS --disable-shared<\/code><\/p>\n<h2>Gzip 1.3.12<\/h2>\n<p><code>.\/configure --prefix=$LFS<\/code><\/p>\n<h2>Patch 2.5.9<\/h2>\n<p><code>.\/configure --prefix=$LFS<\/code><\/p>\n<h1>Java<\/h1>\n<p>For the compilation of the JDK i followed the <a href=\"http:\/\/www.linuxfromscratch.org\/blfs\/view\/stable\/general\/jdk.html\">BLFS<\/a> and its acompanign <a href=\"http:\/\/wiki.linuxfromscratch.org\/blfs\/wiki\/jdk\">user site<\/a>.<br \/>\nAfter patching up the gcc sources:<br \/>\n<code>CFLAGS=\"-I\/opt\/include\" ..\/gcc-4.4.3\/configure --prefix=\/opt\/usr\/local\/gcc-4.4.3 --libexecdir=\/opt\/usr\/local\/lib --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++,java --disable-bootstrap --with-gmp-include=\/usr\/include --with-gmp-lib=\/usr\/lib<\/code><br \/>\nThe disable bootstrap because of an <a href=\"http:\/\/gcc.gnu.org\/bugzilla\/show_bug.cgi?id=37739\">error<\/a> in building bootstrap with powerpc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since every attempt to produce a compiler for my NAS that can be used to compile the OpenJDK failed, I decided to create a toolchain on the NAS to compile this stuff. The reason for a separate toolchain is that libraries are needed that are used by the running system. Replacing them is a bad &hellip; <a href=\"http:\/\/sahits.ch\/blog\/blog\/2010\/10\/09\/updating-compiler-suite\/\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eUpdating compiler suite\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,138,9],"tags":[148,27,141],"class_list":["post-857","post","type-post","status-publish","format-standard","hentry","category-computer","category-it","category-linux","tag-148","tag-compile","tag-nas"],"_links":{"self":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts\/857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/comments?post=857"}],"version-history":[{"count":22,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts\/857\/revisions"}],"predecessor-version":[{"id":936,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts\/857\/revisions\/936"}],"wp:attachment":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/media?parent=857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/categories?post=857"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/tags?post=857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}