Installing Fileutils-4.1

Estimated build time:           0.94 SBU
Estimated required disk space:  40 MB

Contents of Fileutils

Last checked against version 4.1.

Fileutils is a package containing basic file manipulation programs. Included are programs to list and create directories, update timestamps, change permissions and so forth.

Fileutils installs the following files:

Program Files

chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir

Fileutils Installation Dependencies

Last checked against version 4.1.

Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr

Installation of Fileutils

There is a documented bug with the atexit() function in glibc-2.2.3 when it is compiled with gcc-2.95.3. This bug only occurs on some systems (primarily AMD, but not exclusively). This bug causes segmentation faults in fileutils-4.1 when it is compiled statically. This patch causes on_exit() to be called instead of atexit().

Note that in some cases using this patch will result in not being able to compile this package at all, even when your system has an AMD CPU and has Glibc-2.2.3 (or higher) installed. If that's the case, you'll need to remove the fileutils-4.1 directory and unpack it again from the tarball before continuing. We believe this may be the case when your distribution has altered Glibc-2.2.3 somehow, but the exact details are unknown.

To fix this package to compile properly on AMD/Glibc-2.2.3 machines, run the following command. Do NOT attempt this fix if you don't have Glibc-2.2.3 installed. It will more than likely result in all kinds of compilation problems.

patch -Np1 -i ../fileutils-4.1.patch

Prepare the package to be compiled:

LDFLAGS="-static" \
����./configure --disable-nls --prefix=$LFS/static

Continue with compiling the package:

make

And finish off installing the package:

make install

Once you have installed Fileutils, you can test whether the segmentation fault problem has been avoided by running $LFS/static/bin/ls. If this works, then you are OK. If not, then you need to re-do the installation with the patch if you didn't use it, or without the patch if you did use it.