Total Pageviews

Tuesday, November 8, 2011

Compiling and Patching Glibc

Basically building LFS consists of lots and lots and building packages. In this case I am building glibc, the main "C" library. So I am in the LFS directory. In this case:

/home/LFS

so the first thing I need to do is untar the package:

tar jxvf glibc-2.14.1.tar.bz2

Notice this was a tar file, which was also compressed. This could be done in a two step process, but I did it in one. "j" takes care of the uncompressing. "x" is used to extract the tar file. "v" is verbose, which will display the extraction. "f" is for the file that follows.

Now that the file is extracted, I change to that directory:

cd glibc-2.14.1

Now it needs to be patched:

patch -Np1 -i ../glibc-2.14.1-gcc_fix-1.patch

patch -Np1 -i ../glibc-2.14.1-cpuid-1.patch

glibc had two required patches. Now make the build directory:

mkdir -v ../glibc-build

Now cd to it:

cd ../glibc-build

Set up the configuration parameters:

case `uname -m` in i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;; esac

Now configure:

../glibc-2.14.1/configure --prefix=/tools --host=$LFS_TGT --build=$(../glibc-2.14.1/scripts/config.guess) --disable-profile --enable-add-ons --enable-kernel=2.6.25 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes


Now build the package:

make

And finally install it:

make install

No comments:

Post a Comment