Total Pageviews

Tuesday, October 15, 2013


Building GCC from source


A request was made to upgrade GCC to the latest version. Since the current version 4.8.1 was not in the repo. I decided to build it from scratch. Speaking of scratch, I used the instructions from LFS, which I had prevoiusly used to build GCC and four times. I downloaded and built several packages that were required for the testing of GCC once it was built:
tcl8.6.1-src.tar.gz
expect5.45.tar.gz
dejagnu-1.5.1.tar.gz
 
Building required version of TCL:
cd unix &&
./configure --prefix=/usr           \
            --without-tzdata        \
            --mandir=/usr/share/man \
            $([ $(uname -m) = x86_64 ] && echo --enable-64bit) &&
make &&

sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
    -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \
    -i tclConfig.sh
Installing TCL:
make install &&
make install-private-headers &&
ln -v -sf tclsh8.6 /usr/bin/tclsh &&
chmod -v 755 /usr/lib/libtcl8.6.so
Building Expect:
./configure --prefix=/usr       \
            --with-tcl=/usr/lib \
            --enable-shared     \
            --with-tclinclude=/usr/include &&
make
Installing Expect:
make install &&
ln -svf expect5.45/libexpect5.45.so /usr/lib
Building Dejagnu:
./configure --prefix=/usr &&
makeinfo --html --no-split -o doc/dejagnu.html doc/dejagnu.texi &&
makeinfo --plaintext       -o doc/dejagnu.txt  doc/dejagnu.texi
Installing Dejagnu:
make install &&
install -v -dm755   /usr/share/doc/dejagnu-1.5.1 &&
install -v -m644    doc/dejagnu.{html,txt} \
                    /usr/share/doc/dejagnu-1.5.1
Again, the three previous packages are for testing of the GCC installation, but with a package this large, it is wise to test it. Now on to the GCC build itself:
tar xvf gcc-4.8.1.tar.bz2
cd gcc-4.8.1
GCC wants to be built in a separate directory:
sed -i 's/\(install.*:\) install-.*recursive/\1/' libffi/Makefile.in         &&
sed -i 's/\(install-data-am:\).*/\1/'             libffi/include/Makefile.in &&
sed -i 's/install_to_$(INSTALL_DEST) //'          libiberty/Makefile.in      &&
sed -i 's@\./fixinc\.sh@-c true@'                 gcc/Makefile.in            &&

case `uname -m` in
      i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
esac &&

mkdir ../gcc-build &&
cd    ../gcc-build &&

../gcc-4.8.1/configure          \
    --prefix=/usr               \
    --libdir=/usr/lib           \
    --libexecdir=/usr/lib       \
    --enable-shared             \
    --enable-threads=posix      \
    --enable-__cxa_atexit       \
    --disable-multilib          \
    --disable-bootstrap         \
    --disable-install-libiberty \
    --with-system-zlib          \
    --enable-clocale=gnu        \
    --enable-lto                \
    --enable-languages=c,c++,fortran,go,java,objc,obj-c++ &&
make

Now to test the make. Warning, this check may take several hours:
ulimit -s 32768 &&
make -k check   &&

../gcc-4.8.1/contrib/test_summary
Now become root and install the build:
make install &&

ln -v -sf ../usr/bin/cpp /lib &&
ln -v -sf gcc /usr/bin/cc     &&

chown -v -R root:root \
    /usr/lib/gcc/*linux-gnu/4.8.1/include{,-fixed} \
    /usr/lib/gcc/*linux-gnu/4.8.1/ada{lib,include}

Saturday, December 1, 2012

Milestone KDE is working

I will try and go back and document what I did to get KDE working, but the biggest thing was to get MesaLib installed. I had the xfce environment working for a few weeks now, but I want KDE. I compiled everything that was necessary for it, except the kde-desktop. That continued to get an error because of a missing library. That was supposed to be built in MesaLib. When I originally built MesaLib I could not get it built per the book, so I ended up just typing configure and make. That left out the library KDE needed. So I went back and rebuilt MesaLib starting with everything, and eliminating lines to configure until I found something that worked. I am still not certain what caused the KDE-Desktop to fail, I need to go back and figure out the exact culprit. But for now I have something that works, Rebuilding Mesa made me have to go back and rebuild some other thing that were built on the original Mesa, like kdelibs, but for now I will take what I have.

Wednesday, November 21, 2012

Building a Bunch of Packages



The are a series of things one must build that take the same route for each build. Example:
You untar the package:
tar xvf package
You change the directory to where it was untarred:
cd packagedir
./configure $XORG_CONFIG
make
make install

In the case of the fonts that need to be built, there are thirty three font packages that have to be built. Luckily we have computers and shell scripts.
I have modified the script in the documentation slightly to fit my needs. First I created a file, called ‘file’, that contains the name of the tar file of the font I want to build. Next I create a directory that contains all of the tar files of those same fonts. Now here is the modified script:
for package in $(grep –v ‘#’ /usr/local/src/blfs/fonts/files)
#Above gets just the name of the compressed tar file
#Example encodings-1.0.4.tar.bz2
do
packagedir=${package%.tar.bz2}
# Above line strips off “.tar.bz2”
tar xvf $package
pushd $packagedir
# Above changes to packagedir, but saves where you came from
./configure $XORG_CONFIG
make
make install
popd
#Above line returns where you came from
Done

And thre you have it. That script will build the thirty-three font packages. This same principle will be used to build Xorg Protocol Headers, as well as, Xorg Applications.

Wednesday, November 14, 2012

Lesson Learned, Don't stop in the middle of something

I made the mistake of stopping the the installation of X11 way back in January. As a result some of what I compiled and installed back in January, was no long compatible with what is on the Beyond Linux From Scratch (BLFS) page. As a result I had to recompile and install a lot of stuff to move on again. Once that was done, I was able to proceed again. Basically it boiled down to reinstalling  the the X11, that way I knew I had a good baseline, rather than continuing to get software that was incompatible with what was already installed. When I left off in January, BLFS was at 7.0, now it is at 7.2, thus the incompatibilities.I now have a working X11, working on the Seamonkey browser and KDE now. I'll write up a more detailed version of what I did to build X11 later.

Saturday, November 3, 2012

Well, after nearly a year, I have started back up on Linux From Scratch. I left off at a bootable system, but only a command line interface. For me it is easier to work in a GUI environment, so I had started building X11. X11 no longer builds as one bundle. I am well on my way, but there is lots to be done. I left off in January compiling the applications for X11, the last two days I have worked on completing them.

total 176K
drwxr-xr-x  2 root  root 4.0K Jan 16  2012 xbitmaps-1.1.0
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 bdftopcf-1.0.3
drwxr-xr-x  4   501   20 4.0K Jan 16  2012 iceauth-1.0.5
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 luit-1.1.0
drwxr-xr-x  2 root  root 4.0K Jan 16  2012 mkfontdir-1.0.6
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 mkfontscale-1.0.9
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 sessreg-1.0.7
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 setxkbmap-1.2.0
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 smproxy-1.0.5
drwxr-xr-x  5 root  root 4.0K Jan 16  2012 twm-1.0.7
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 x11perf-1.5.4
drwxr-xr-x  4   501   20 4.0K Jan 16  2012 xauth-1.0.6
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xbacklight-1.1.2
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 xclock-1.0.5
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 xcmsdb-1.0.3
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xcursorgen-1.0.4
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 xdpyinfo-1.3.0
drwxr-xr-x  2 root  root 4.0K Jan 16  2012 xdriinfo-1.0.4
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xev-1.1.0
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xgamma-1.0.4
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xhost-1.0.4
drwxr-xr-x  5   501   20 4.0K Jan 16  2012 xinit-1.3.1
drwxr-xr-x  3 root  root 4.0K Nov  1 08:57 xwd-1.0.4
drwxr-xr-x  3 root  root 4.0K Nov  1 08:59 xpr-1.0.3
drwxr-xr-x  4 root  root 4.0K Nov  1 09:00 xset-1.2.2
drwxr-xr-x  4 root  root 4.0K Nov  1 09:03 xmodmap-1.0.5
drwxr-xr-x  4 root  root 4.0K Nov  1 09:05 xwininfo-1.1.2
drwxr-xr-x  3 root  root 4.0K Nov  1 09:06 xkill-1.0.3
drwxr-xr-x  4 root  root 4.0K Nov  1 09:09 xprop-1.2.1
drwxr-xr-x  3 root  root 4.0K Nov  1 09:10 xwud-1.0.3
drwxr-xr-x  4 root  root 4.0K Nov  1 09:14 xrandr-1.3.5
drwxr-xr-x  3 root  root 4.0K Nov  1 09:15 xlsatoms-1.1.0
drwxr-xr-x  3 root  root 4.0K Nov  1 09:16 xkbutils-1.0.3
drwxr-xr-x  3 root  root 4.0K Nov  1 09:17 xsetroot-1.1.0
drwxr-xr-x  3 root  root 4.0K Nov  1 09:22 xvinfo-1.1.1
drwxr-xr-x  3 root  root 4.0K Nov  1 09:23 xrefresh-1.0.4
drwxr-xr-x  4   500  500 4.0K Nov  1 09:25 xinput-1.5.3
drwxr-xr-x  3 root  root 4.0K Nov  1 09:26 xkbevd-1.1.2
drwxr-xr-x  4 16209   50 4.0K Nov  1 09:27 xrdb-1.0.9
drwxr-xr-x  4 root  root 4.0K Nov  1 09:28 xlsclients-1.1.2
drwxr-xr-x  4  1000 1000 4.0K Nov  1 09:29 xkbcomp-1.2.3
drwxr-xr-x  5 root  root 4.0K Nov  2 07:26 ..
drwxr-xr-x  2 root  root 4.0K Nov  2 13:30 tars
-rw-r--r--  1 root  root    0 Nov  2 13:33 xapps
drwxr-xr-x 44 root  root 4.0K Nov  2 13:33 .

Monday, January 16, 2012

Beyond Linux From Sctrach

My last post stated I had a bootable OS now. Once bootable, I needed a network connection. I started trying to get DHCP to work, but after running into some problems, I decided to go with a fixed address, and return to DHCP later. The one thing I find annoying is not being able to cut and paste, so I decided the first thing I needed to get working was some sort of Desktop. The windowing system will be based on X, so I jumped to Xorg to try and get that working. There is a LOT to compiling X. I remember way back in the early 90ties, I download X11 and it honestly took me three days of just compiling to get it to work. Of course that was on a Sun3 system, running Sun OS. I have a faster system, but still this is going to be a lot of work. For example, this is just one section of Xorg, that has to be downloaded, compiled, and installed:
                                             
http://xorg.freedesktop.org/releases/individual/proto/bigreqsproto-1.1.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/compositeproto-0.4.2.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/damageproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/dmxproto-2.3.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/dri2proto-2.6.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/fixesproto-5.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/fontsproto-2.1.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/glproto-1.4.14.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/inputproto-2.0.2.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/kbproto-1.0.5.tar.bz2
# printproto required for Java
http://xorg.freedesktop.org/releases/individual/proto/printproto-1.0.5.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/randrproto-1.3.2.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/recordproto-1.14.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/renderproto-0.11.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/resourceproto-1.2.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/scrnsaverproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/videoproto-2.3.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xcmiscproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xextproto-7.2.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86bigfontproto-1.2.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86dgaproto-2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86driproto-2.1.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86vidmodeproto-2.3.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xineramaproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xproto-7.0.22.tar.bz2
 
 
Luckily, using wget, the downloads are made easier. And with a few short scripts, so is the compiling. More on that later. 

Monday, January 2, 2012

Finally boots

I have spent the last two days trying to get a bootable kernel. Well, it finally boots. I kept ignoring an error that was right in from of me. The error:

Cannot open root device "sda1" of unknown-block(2,0)
....

hda1
hda2
hda3
hda4

I kept trying to get the machine to recognize /dev/sda, when in fact I should have been looking for /dev/hda. I made sure the disk interface was being recognized, the filesystem was in the kernel,, and a number of other things I compiled into the kernel. I spent a lot of time running "make menuconfig" and installing  new kernels. The biggest reason I was trying to get /dev/sda recognized, was when I was working on the drive externally, Fedora was seeing it as /dev/sdb. Finally I changed my grub.cfg to look for /dev/hda and it booted. There are further problems, I have only a command line interface, but now I can move on the Beyond Linux From Scratch.