uClibc based LFS hint (uclibc-hint)

Sanctus Evanidus evanidus at videotron.ca
Wed Jul 17 18:38:01 PDT 2002


New hint to build a normal LFS using uClibc
-------------- next part --------------
TITLE:          uclibc-lfs
VERSION:        0.2 (20020718)
LFS VERSION:    N/A
AUTHOR:         Micha?l Tousignant <evanidus at videotron.ca>

SYNOPSIS:       How to build a uClibc based, base LFS system

HINT:

Before trying to build a uClibc system, you should ask yourself if you
really want to because it means:
    - No native C++ (must use static GCC C++ compiler)
    - No groff (Unless you use a static glibc GCC C++ compiler or compile 
                groff statically against glibc)
    - No modutils (Unless if you don't mind using a glibc static modutils)
    - No support (for now) for installing non-LFS packages (good luck)
    - This hint was made/tested using gcc 2.95.3-2 on x86 only. If you are 
      using gcc 3.x.x or different arch, you 'might' encounter new problems. 
      (good luck)
Be sure to check the uClibc website (http://www.uclibc.org/) and docs to see 
what it support and what it don't.


=======================
0. Table of Content
=======================

1. Prerequisites
2. System preparations
3. Building the system
4. Extras
5. F.A.Q.

=======================
1. Prerequisites
=======================

Prerequisites (Before starting LFS chapter6):
    - A complete LFS chapter 5
      (keep chap 5 & 6 separated (/static style) is very recommended moreover 
       since this hint will assume you are using it.)
    - perl-5.6.1 tarball         (http://www.perl.org/)
    - ncurses-5.2 tarball        (ftp://ftp.gnu.org/gnu/ncurses/)
    - (optional) modutils tarball(ftp://ftp.kernel.org/pub/linux/utils/kernel/)
    - (optional) groff tarball   (ftp://ftp.gnu.org/gnu/groff/)
    - (optional) file tarball    (ftp://ftp.gw.com/mirrors/pub/unix/file/)

Prerequisites (To complete LFS chapter6)
    - All LFS chapter6 packages tarballs and patches except:
        1. psmisc 20.2+
        2. modutils
        3. Possibly 'file' (explained later)
	4. Possibly 'groff' (explained later)
        5. glibc

    - uClibc-0.9.12 tarball             (http://www.uclibc.org/)
    - psmisc-20.1 tarball               (http://psmisc.sourceforge.net/)

    - Various patches (their functions are explained later):
           -> ftp://evanidus.ath.cx/uclibc/uclibc-lfs-patches-0.2.tar.bz2

    - The LFS book, 3.3+ recommended.   (http://www.linuxfromscratch.org/)

    - Other (optional) packages:
        1. zlib - needed by recent util-linux and used, if available, by more.
           -> http://www.zlib.org
        2. nasm - needed by recent lilo
           -> http://nasm.sourceforge.net
        3. man2cat - useful if you want to see man pages without groff
           -> ftp://evanidus.ath.cx/misc/man2cat/

=======================
2. System preparations
=======================

Before starting chapter6 in the book, we'll need to add some extras to the 
chapter5 static utilities:

Note: Every commands are expected to be run inside the freshly extracted 
      clean source of the package.

- static perl (tested with 5.6.1)
    Perl is needed to execute a script during uClibc compilation
    It can be installed by running the following commands:

    ./Configure -Dprefix=/static -Dinstallprefix=$LFS/static -Dso=none \
                -Dldflags=-static -Uinstallusrbinperl -Uusedl -Dman1dir=none \
                -d -e &&
    make &&
    make install

    Note: Don't bother configuring perl properly (i.e. the way you want it)
          because it'll be normally reinstalled in chapter6, defaults will do.

- static ncurses-5.2's tic program
    For still obscure reasons, the tic program given by ncurses will compile 
    fine with uClibc but will have troubles doing its job completely. Since 
    most people use this only once (during ncurses' 'make install'), we'll use 
    this static tic for this and delete it afterward. (If not used, things 
    using ncurses such as 'make menuconfig' will display things improperly)

    You can install it by running these commands:

    LDFLAGS=-static ./configure --without-cxx --without-debug \
                                --without-profile &&
    make -C ncurses &&
    make -C progs transform.h tic &&
    cp -f progs/tic $LFS/static/bin

- which
    uClibc will use the command 'which' during its installation. Although on 
    normal systems it is recommended to use the real which, uClibc will do 
    fine with this temporary workaround:

cat > $LFS/static/bin/which <<EOF;
#!/bin/sh
type -p $*
EOF
chmod +x $LFS/static/bin/which

- optional static groff (tested with 1.17.2)
    It is currently impossible (without a lot of work) to compile/use C++ 
    applications on a uClibc "only" system. If you wish you be able to view 
    non-formatted man pages, you'll need to get yourself a static 
    glibc/libstdc++ groff 'or' compile one later using a static GCC C++
    compiler (if you have one). (all groff C-only alternatives are too old 
    and unusable with most of today's man pages)

    Note: An alternative (If you don't want to use static gcc or static groff)
          would be to pre-format your man pages or convert them to HTML using 
          your host system's utilities. (See section 4 for help with 
          preformating man pages using man2cat)

    If you prefer to try to build a shared groff, skip this package for now.

    Warning: A complete static groff will take around 18MB and 11MB stripped!

    You can install a static groff by doing:

    mkdir -p $LFS/usr &&
    LDFLAGS=-static ./configure --prefix=/usr --mandir=$LFS/usr/share/man &&
    make &&
    make prefix=$LFS/usr install &&
    ln -s soelim $LFS/usr/bin/zsoelim &&
    ln -s eqn $LFS/usr/bin/geqn &&
    ln -s tbl $LFS/usr/bin/gtbl

- optional static modutils (tested with 2.4.16)
    For still unknown reasons, utils from modutils tends to segfault when 
    doing certain operations when linked against uClibc making them unusable.

    If, for you, modules are important (you can always build a modules-free 
    kernel), you'll need to build a static glibc modutils by running the 
    following commands:

    ./configure --prefix=$LFS/usr --exec-prefix=$LFS \
                --mandir=$LFS/usr/share/man &&
    make LDFLAGS=-static &&
    make install

- optional static 'file' program (tested with 3.39)
    For reasons as obscure as ncurses' tic problems, uClibc linked 'file' 
    program will have problems to parse the 'magic' file after compilation but 
    will work properly for identifying files.

    You can (if you want to be able to use 'file'):
      a) Compile a static glibc 'file', use it to parse the magic file, install 
         the uClibc linked 'file' and delete the glibc static one.
         (Further details on this will be given later)i
         
      b) Compile a static glibc 'file' and install it permanently on your 
         uClibc system instead of a normal shared one.
         
      c) Don't compile any static 'file' and use the workaround mentioned 
         later when compiling the shared 'file' (Implies removing four 
         file types from the magic file which won't be detectable later. It is 
         also unknown if there might be any hidden problems in the magic 
         output)

   For the 'a)' solution run:

      touch aclocal.m4 configure Makefile.in stamp-h.in &&
      ./configure --prefix=/usr --datadir=/usr/share/misc &&
      make LDFLAGS=-static file &&
      cp -f file $LFS/static/bin
       
   For the 'b)' solution run:

      touch aclocal.m4 configure Makefile.in stamp-h.in &&
      ./configure --prefix=/usr --datadir=/usr/share/misc &&
      make LDFLAGS=-static &&
      make prefix=$LFS/usr install

=======================
3. Building the system
=======================

    Now, let's start the LFS chapter6. Do everything the LFS book tell you to 
    do until you reach glibc.

    First, extract the uclibc-lfs-patches packages inside the same directories
    as other packages if not already done.

    Now, we'll need some symbolic links for things uClibc (and possibly some 
    other packages) will try to use and have their paths hardcoded. You can 
    create them by running:

    ln -s ../static/bin/true /bin &&
    ln -s ../../static/bin/perl /usr/bin

    You might also need, if not already done, to do:

    ln -s ../static/bin/bash /bin/sh

    Note: if any of these binaries were installed in /static/usr/bin instead 
    of /static/bin, you'll need to adjust these links.

    If not already done, (some versions of the book do it while building glibc 
    and some do it before), also do:

    mknod -m 0666 /dev/null c 1 3

    Note: From here on, every commands are expected to be run inside the 
          freshly extracted clean source of the package we are working on.

    Instead of glibc (which we won't install at all), we'll now install 
    uClibc-0.9.12; you can do so by running the following commands for 
    which explanations can be found further down:

    Note: It is strongly recommended to use the default optimizations
          suggested by uClibc. Don't even change -march=

    patch -Np1 < ../uclibc-lfs-patches/uclibc-0.9.12.patch &&
    ln -s extra/Configs/Config.i386 Config &&
    make DO_C99_MATH=true HAS_SHADOW=true DOLFS=true INCLUDE_RPC=true \ 
         all install

    /dev/pty* notes: uClibc can be configured to use /dev/pty* devices 
          rather than devpts/devfs's /dev/pts directory; but to use these, 
          the 'pt_chown' program is needed and is not provided by uClibc.
          If you really need /dev/pty* support, you'll need to grab the 
          pt_chown source from glibc, compile it with uClibc and put it in
          /sbin as set-uid root. - I strongly advise everyone to use devpts 
          or devfs instead (the LFS book explains how to setup devpts)

    Commands explanation:
        patch -Np1 < ../uclibc-lfs-patches/uclibc-0.9.12.patch
          -> This patch for uclibc make and config files will remove the need 
             of a 'already present' libc (such as glibc) and will make it 
             install itself as main libc rather than all in its own dir (such 
             as /usr/i386-linux-uclibc). This will also remove the need for a 
             gcc wrapper.
               
        ln -s extra/Configs/Config.i386 Config
          -> Simply get the default configs for Config.<arch>. If you are 
             using a non-x86 system you'll need to adjust this. (Sadly, this 
             hint was made/tested by using x86 only)
               
        make DO_C99_MATH=true HAS_SHADOW=true DOLFS=true INCLUDE_RPC=true \ 
        all install
          -> Will build and install uClibc, the different variables set will do:
               - DO_C99_MATH=true
                 -> Provide a full set of C99 math features for the math 
                    library (libm) Some recent packages might need this. (It 
                    will however make libm bigger by ~35kB on x86)
               - HAS_SHADOW=true
                 -> Add shadow password support (which a normal LFS use)
               - DOLFS=true
                 -> Add Large File Support (2GB+), although you can disable 
                    the use of this on most packages if you don't need it. 
                    Some (such as recent e2fsprogs) just won't compile without 
                    it. So best to enable it.
                    Note: the kernel will also need to support large files
               - INCLUDE_RPC=true
                 -> RPC is not used by much things besides NFS (network file 
                    system). Yet, some packages like shadow will try to use 
                    functions provided by this. So we enable it by default.

    Now, I suggest you install these packages before anything else 
    (instructions further down):

    1. man-pages
    2. fileutils
    3. sh-utils
    4. Creating devices (run MAKEDEV)
    5. ncurses
    6. bash

    It is not really required to do it this way, yet it will remove some 
    'unresolved group/user name' annoyances. (man-pages is installed first
    because current LFS books install it without having it check for 
    already installed man pages (which is faster))

    After, you can install packages in the same order as in the LFS book 
    (which is roughly the same as the order below) except gettext which should 
    be last. Some of them will need extra flags/command and patches. Keep 
    reading for this.

    To install the following packages, just follow the LFS book instructions 
    in chapter6 and apply the modifications/additions to these commands 
    mentioned below (if any) while doing so:

    Note: exact commands won't be given to increase compatibility with the LFS 
          book version you are using and make this hint be easier to keep up 
          to date.

- man-pages (tested with 1.51)
    Note: If you did not install a static groff earlier or do not intend to
          pre-format/convert your man pages later in order to have them work
          without groff. You should simply skip this package.

- fileutils (tested with 4.1)
    append to ./configure flags: --disable-nls
    
- sh-utils (tested with 2.0)
    run before starting: rm -f /bin/true
    append to ./configure flags: --disable-nls
    
- MAKEDEV (tested with 1.5)

- ncurses (tested with 5.2)
    run before starting: 
          patch -Np1 < ../uclibc-lfs-patches/ncurses-5.2-uClibc.patch
		  
       -> This patch will make ncurses use our static tic compiled earlier for 
          the terminfo database installation.
    append to ./configure flags: --without-cxx

    Note: If you don't like having the partially broken 'tic' program linked 
          against uClibc and would prefer to keep your static one, run:

          cp -f /static/bin/tic /usr/bin
    
- bash (tested with 2.05a)
    run before starting: ln -s ../static/bin/cat /bin
       -> Bash will use /bin/cat for some operations and since we still didn't 
          install textutils, this symbolic link will be needed.
          
- zlib (tested with 1.1.4)
    Note: At the moment where this hint was written, zlib was not present in 
          the LFS book. Yet since it is recommended to install it if you want 
          to use a recent 'util-linux' package without modifying it and allow 
          packages that can use zlib (or use the system zlib instead of their 
          included one) to use it; We included it here (instructions will be 
          removed if it becomes part of the LFS book)

    You can build/install zlib by running the following commands:

    ./configure --prefix=/usr &&
    make libz.a &&
    cp libz.a /usr/lib &&
    chmod -x /usr/lib/libz.a &&
    ./configure --shared --prefix=/usr --libdir=/lib &&
    make clean all &&
    make install &&
    rm -f /lib/libz.so &&
    ln -sf ../../lib/libz.so.1 /usr/lib/libz.so &&
    cp zlib.3 /usr/share/man/man3

    Commands explanations:
        zlib build only either a the static or shared copy of itself. Since it
        is often preferred to get both, we do so by building it twice.

        [...] --libdir=/lib
          -> Since a few programs that use zlib will be installed in /sbin
             we install libz in /lib rather than /usr/lib so that it'll 
             always be available for them even if /usr is not mounted.

        make clean all
          -> code build from the first build could be re-used but cleaning 
             let zlib be build with preferred compiler flags for shared 
             libraries rather than those chosen for the static one.

        rm -f /lib/libz.so &&
        ln -sf ../../lib/libz.so.1 /usr/bin/libz.so
          -> libz.so is not needed in /lib, while it is in /usr/lib, this is
             only used as information for the linker to help it find the 
             library. (No programs will directly be linked against libz.so, 
             they will use /lib/libz.so.1)

- GCC (tested with 2.95.3-2)
    in the ./configure flags, replace: --enable-languages=c,c++
                                   by: --enable-languages=c
          -> c++ compiler and libraries won't build with current uClibc and
             there is no fix available at this moment (And probably for a while)

- ViM (tested with 6.1)
    Note: --disable-nls shouldn't be needed (auto-detected)

- findutils (tested with 4.1)

- gawk (tested with 3.1.1)
    append to ./configure flags: --disable-nls    

- bison (tested with 1.35)
    append to ./configure flags: --disable-nls

- less (tested with 374)

- groff (tested with 1.17.2)
    If you did not compile a static groff and have static GCC C++ compiler from 
    chapter5. You can build this package by running the same commands as in 
    the book.

- textutils (tested with 2.0)
    run: rm -f /bin/cat
      -> We made that symbolic link when building bash, we only remove it 
         because recent LFS books expect /bin/cat to be inexistent.
    append to ./configure flags: --disable-nls

- sed (tested with 3.02)

- flex (tested with 2.5.4a)

- binutils (tested with 2.12.1)
    append to ./configure flags: --disable-nls

- gettext
    Skip this package for now because it'll make some packages think we want 
    NLS support. (Will save us work if they don't) - If you need gettext for 
    other reasons  (such as running 'aclocal' in a source that support gettext 
    and without problems) Do it at the end of this hint, you'll also find
    instructions there.

- net-tools (tested with 1.60)
    Two protocols (enabled by default) won't compile because of missing 
    includes/functions missing in uClibc.
    These are, AX25 and NET/ROM (Packet Radio) which are unused and safe to 
    disable for most people.

    If you configure net-tools 'without' using 'yes "" | make', just say 'n' 
    each time it mention them (AX25 and NET/ROM) and install it normally. 
    Otherwise, use these commands instead of those in the LFS book:

        yes "" | make config &&
        mv config.h config.h~ &&
        sed -e /AX25/s/1/0/ -e /NETROM/s/1/0/ < config.h~ > config.h &&
        make &&
        make update

- m4 (tested with 1.4)
    run before starting: patch -Np1 < ../uclibc-lfs-patches/m4-1.4-uClibc.patch
      -> m4 needs some functions missing in uClibc, this patch provides them.

- texinfo (tested with 4.2)
    append to ./configure flags: --disable-nls

- autoconf (tested with 2.53)

- automake (tested with 1.6.2)

- file (tested with 3.38 and 3.39)
    Previously in this hint, we have talked about a problem we'd meet with 
    file and how to solve it. There was three solutions; based on which one 
    you used (i.e. solution a, b or c - Verify if unsure), do the following:

    Note : do NOT do everything, either a, b or c.
    Note2: Be careful not to confuse the patches, there is two patches with
           two different purposes.

    a) Temporary use of a glibc statically compiled file to make our works:
           run before starting:
	        patch -Np1 < ../uclibc-lfs-patches/file-3.39-uClibc-1.patch
		
             -> This patch simply edit the makefiles to use our static 'file'.

    b) Permanent use of a glibc statically compiled file (safe):
           Nothing to do, go to next package. (file is already installed)

    c) Do a 'dirty' fix to make file work without any external help (unsafe):
           run before starting (use file-3.38-uClibc-2.patch if using 3.38):
	        patch -Np1 < ../uclibc-lfs-patches/file-3.39-uClibc-2.patch
		
             -> Will remove lines 'file' mysteriously errors on in the magic 
                file even if they have correct syntax. These are:
         0 string/b  #\040xmcd           CDDB(tm) format CD text data
         0 string/b  #!\ /bin/tcsh       Tenex C shell script text executable
         0 string/b  #!\ /usr/local/tcsh Tenex C shell script text executable
         0 string/cB \<!doctype\ html    HTML document text
                It is also unknown if the output 'file' will produce parsing 
                the magic file will be 100% correct, yet it will be usable 
                (minus for the four file types detection methods we removed)

- libtool (tested with 1.4.2)

- bin86 (tested with 0.16.3)

- bzip2 (tested with 1.0.2)

- ed (tested with 0.2)

- kbd (tested with 1.06)

- diffutils (tested with 2.8.1)
    append to ./configure flags: --disable-nls

- e2fsprogs (tested with 1.27)
    Note: --disable-nls shouldn't be needed (auto-detected)

- grep (tested with 2.5)
    append to ./configure flags: --disable-nls

- gzip (tested with 1.2.4a)

- man (tested with 1.5j)
    append to make flags: CFLAGS='-DNONLS'
      -> Remove native language support which fix compilation.
         Note: CFLAGS is a empty var for man's makefiles, setting it will not 
               remove any C compiler flags it already use.

- nasm (tested with 0.98.34)
    Note: Just like zlib, nasm is not part of the LFS book at this moment (and 
          might never be) However, if you wish to use a recent lilo, you may 
          need it. If using lilo 22.2 or less (or using grub) just skip this 
          package.

    You can install nasm by running the following simple commands:

        ./configure --prefix=/usr &&
        make &&
        make install

- lilo (tested with 22.2 and 22.3.2)

- make 3.79.1
    append to ./configure flags: --disable-nls

- modutils
    Skip this package, it will compile but will segfault on many operations 
    making it unusable. Either use a modules-less kernel or get a static 
    modutils (until the problem is solved). This was explained earlier in 
    section 2.

- netkit-base (tested with 0.17)

- patch (tested with 2.5.4)

- procinfo (tested with 18)

- procps (tested with 2.0.7)
    run before starting:
         patch -Np1 < ../uclibc-lfs-patches/procps-2.0.7-uClibc.patch

      -> This patch stop top.c from using an include + function not provided 
         by uClibc related to locales in order to have it build properly. 

- psmisc (tested with 20.1)
    Note: psmisc 20.2 and 21 has incomplete '--disable-nls' support and won't 
          compile with uClibc without modifications. Since psmisc 20.1 programs 
          works properly and do not have NLS support at all, we will install 
          it instead. (You can do so by using the same commands as in the LFS
          book)

- reiserfsprogs 3.x.1b
    run before starting:
         patch -Np1 < ../uclibc-lfs-patches/reiserfsprogs-3.x.1b-uClibc.patch
	 
      -> provide the (missing in uClibc) obstack functions and include 
         needed by reiserfs.

- shadow (tested with 4.0.3)
    run before starting: 
         patch -Np1 < ../uclibc-lfs-patches/shadow-4.0.3-uClibc.patch
	 
      -> Shadow tries to use the putgrent function missing in uClibc, this 
         patch will provide it. It also try to use 'innetgr' a NIS related 
         function which is not supported by uClibc at all so disable it.
    append to ./configure flags: --disable-nls

- sysklogd (tested with 1.4.1)

- sysvinit (tested with 2.84)

- tar (tested with 1.13)
    append to ./configure flags: --disable-nls

- util-linux (tested with 2.11r and 2.11t)
    omit from the 'make' and 'make install' flags: HAVE_SLN=yes
      -> The LFS book use this because glibc already provide a sln (static ln)
         Since uClibc don't, we should get the util-linux one.
         
- perl (tested with 5.6.1)
    Note: perl will compile with uClibc but "make test" will fail on three tests
          Yet, there's a good chance you'll never need these features so you 
          shouldn't pay attention to it.

- gettext (tested with 0.11.2)
    Note: You should only install this packages if you need it for other 
          purposes than native language support. (like running aclocal in 
          a source supporting gettext) If you install it, you should consider 
          installing it under a different prefix than /usr (like /opt/gettext 
          for instance)
    append to ./configure flags: --disable-nls

- Chapter 7+ of the LFS book 
    Can be completed without any modifications, it's over for the hint; yet
    you might want to have a look at the section 5 (F.A.Q) and 4 (Extras) if
    not already done.

=======================
4. Extras
=======================

- optional man2cat (tested with 0.1)
    ONLY use this if you didn't/couldn't compile groff. This is an 
    alternative to be able to view man pages without groff.

    To install man2cat, simply uncompress it wherever you prefer.

    man2cat will automaticaly convert all the manpages from a man directories
    and put them in the cat directories. You can convert your uClibc system's
    man pages by running these command on a system that have groff installed
    (remember to re-set $LFS if not already done):

        sh man2cat $LFS/usr/share/man

    Note: If you want the cat pages to be auto-compressed, use the -gz or -bz2 
    flag. If you want the operations to go faster, try the -jall flag which 
    will process all the sections simultaneously (Will fork many processes 
    and use more ressources, use with caution). See man2cat -h for more help.

    Now that they are converted, to stop "man" from trying to convert them 
    again, we need to remove the unformated manpages from their current 
    location:

        cd $LFS/usr/share/man &&
        mkdir ../man.old &&
        mv man* ../man.old

    Now we must tell man were to find our cat pages, by default it search 
    them in /var/cache/man which is FHS compilant but since our cat pages 
    are static and do not need to be in /var, I believe they should use the
    old location /usr/share/man/cat*. You can update your man.conf by doing 
    this:

        cd $LFS/etc &&
        mv man.conf man.conf~ &&
        sed -e 's/^# FSSTND/FSSTND/' -e 's/^FHS/# FHS/' < man.conf~ > man.conf

    That's it.

=======================
5. F.A.Q.
=======================

Q: This hint mention "keep chap 5 & 6 separated", "/static" style, and often
   use some /static directory. What is that? How do I make one?
A: LFS 4.0 (currently only in CVS as this is written) will use a special
   directory ($LFS/static) to install all the statically compiled utilities 
   in chapter5. This is an implementation of the "keep_chap5_and_chap6_sep.txt"
   hint. If you wish to do the same, see that hint or build a chapter5 
   based on LFS CVS/4.0+ instructions. (Note: LFS CVS/4.0+ also use gcc 3.1+.
   If you wish to keep using gcc 2.95.3-2, just use the instructions from the
   LFS 3.3 book and replace the occurences of "/usr" by "/static" for chapter5)

Q: Do I really need to build a static perl?
A: For now yes, uClibc need it to run one perl script required for the 
   build process. It should be easily rewritable using AWK however; if you 
   wish to do so, you'll find the script at "extra/scripts/initfini.pl" inside
   the uClibc source. Patches are welcome (and in this case, it should be sent 
   to uClibc peoples directly)

Q: With many packages, I keep on seeing: "the 'setlocale' function supports 
   only C|POSIX locales" - Is this bad?
A: No. uClibc could be compiled with locales support (i.e. support other 
   locales than C/POSIX locales), but this is a "horrible hack" using parts 
   from glibc. I strongly recommend you don't bother about this.

Q: Why is '--disable-nls' used for so many packages? Some packages compile just 
   fine with native language support.
A: Even if it compile, the NLS won't be usable. It will just make the compiled 
   binaries and files use a little more disk space/RAM for nothing.

Q: Will I be able to use XFree86?
A: You can, but this hint don't explain how. (Expect troubles)

Q: Can I compile C++ binaries linked against uClibc using a static GCC's c++
   compiler linked against glibc?
A: Yes, but it might give bad results (like frequent segmentation faults)
   with some programs/packages. Avoid C++ when possible.

Q: The hint actually mention that I can compile groff if I have a static 
   GCC C++ compiler. How do I make one?
A: Some versions of the LFS book disable the build of the C++ compiler in 
   chapter5 because it is unused. If you want one, simply rebuild gcc the same 
   way but by using: "--enable-languages=c,c++"

Q: I ran man2cat and seen many warnings/error in the process, will I be 
   missing some man pages?
A: Normaly, these are only warnings related to bad syntax in some man pages.
   These man pages will still be formatted and readable, yet some small 
   parts of it might be misadjusted / displayed strangely.

Q: And what about "warning: can't find character with input code ..."? I don't
   want missing characters..
A: Try to use man2cat -roff "groff -mandoc -Tlatin1" then. -Tascii is default 
   to ensure correct display on every terminals.

Q: I ran man2cat and it's taking a lot of space compared to my old man pages 
   even if they are compressed!
A: man2cat don't create symlink for duplicate cat pages at the momment, 
   probably will in the future. (In other words, you have many duplicate pages 
   taking up space - Feel free to create a script to scan for them and symlink
   them if space is important for you)

Q: I ran man2cat but it didn't convert my "insert favorite language here" 
   man pages.
A: Not supported at this momment and probably never will unless someone send 
   a patch.

Q: This hint told me how to make a normal LFS system with uClibc, but I was 
   interested in uClibc to make a minimal system, which packages should I 
   remove?
A: A "minimal system" is very relative on what you want the system to do.
   The thing is that you can have a linux system work with only a kernel and 
   one thing to do such as running a shell.
     - Do you need it to be able to compile binaries? (development)
     - Do you need to be able to login on it?
     - Do you need documentation?
     - Do you need a specific interpreted language?
     - etc...
   Hint: You should look at the busybox package (http://www.busybox.net/)

=======================
  End of Hint
=======================


More information about the hints mailing list