commit 3e68c52b941636714d2599ea8adda9520ec2de23
Author: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Tue May 10 10:03:58 2011 +0200
*/crtn.S: Remove .size directive for _init and _fini
These are split across objects so setting size does not (and never did)
work since the expression cannot be computed at assembly time.
This avoids errors from recent (> 2.21) gas.

The second problem ("No rule to make target ‘libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/clone.c’, needed by ‘libc/libc.oS’. Stop.") may rise if so called 'DOMULTI mode' is enabled. The workaround is to never "do multi":

Git

Git & pread() or "cannot clone any remote repos"

This feature has been introduced with commit b8a2486f1524947f232f657e9f2ebf ("index-pack: support multithreaded delta resolving").
And now it is up to you to deal with it when you don't have thread-safe pread().

Earlier, we were forced to patch Makefile. I used the following patch:

Then your autotools are broken somehow. At first, make sure to re-build the following packages, in that order:

libtool

m4

autoconf, automake

Also, make sure to not to play with symbolic links etc. I've solved my

configure.ac:3: warning: macro 'AM_INIT_AUTOMAKE' not found in library
configure.ac:6: warning: macro 'AM_CONFIG_HEADER' not found in library
configure.ac:62: warning: macro 'AM_CONDITIONAL' not found in library
...

issues by commenting out (removing) the following in postcmds-automake:

"Please use exactly Autoconf 2.64 instead of x.yz."

(Originally: Please use exactly Autoconf 2.64 instead of 2.65.) No way, I will use sed -i 's/2.64/2.65/' config/override.m4 instead. Never force people to use ancient versions of software just because you (or RHEL, or whatever) do.

The universal solution for any autoconf version you have:

# never force people to use ancient versions of software just because you (or RHEL, or Obama The President, or whatever) do
sed -i '/dnl Ensure exactly this Autoconf version is used/d' ./config/override.m4
autoconf_version=`autoconf -V | grep "autoconf" | tr ' ' '\n' | tail -1`
sed -i "s/2.64/${autoconf_version}/g" ./config/override.m4

NOTE: this is known to work for binutils. For other packages (complaining like binutils), just grep the source tree for "Please use exactly".

GCC

GCC and GMP, MPFR, MPC

It is recommended to build and install 'gmp', 'mpfr' and 'mpc' separately from GCC.

About some ./configure options for GCC

--disable-nls

Disable Native Language Support (NLS), so GCC output is in American English only.

--with-system-zlib

Use installed ‘zlib’ rather than that included with GCC.

--disable-checking

Disable internal consistency checks. This does not change the generated code, but adds error checking within the compiler. Disabling assertions will make the compiler and runtime slightly faster but increase the risk of undetected internal errors causing wrong code to be generated.

--disable-werror

Controls whether certain files in the compiler are built without -Werror in bootstrap stage2 and later.

--disable-multilib

Specify that multiple target libraries to support different target variants, calling conventions, etc. should not be built.

--disable-libssp

Specify that the run-time libraries for stack smashing protection should not be built.

--enable-shared

Build shared versions of libraries (libgcc, libstdc++, etc.).

--enable-threads=single

Disable thread support, should work for all platforms.

--disable-tls

Specify that the target does not support Thread Local Storage.

--disable-__cxa_atexit

Don't use __cxa_atexit (use atexit instead) to register C++ destructors for local statics and global objects. __cxa_atexit is currently only available on systems with GNU libc.

--enable-linker-build-id

Pass --build-id option to the linker for all links performed without the -r (or --relocatable) option.

--disable-gnu-unique-object

Don't use the gnu_unique_object relocation for C++ template static data members and inline function local statics.

--disable-libunwind-exceptions

Don't use libunwind, to avoid undefined reference to `_Unwind_GetIPInfo'.

"Official" GCC git repositories

Important: build libtool right after GCC

You'll need to re-build libtool each time after you bootstrap new version of GCC. It's because libtool uses hard-coded GCC-related paths.

binutils

binutils vs texinfo

Note: binutils refuses to build without 'cmp' (from diffutils; also available in busybox) and 'makeinfo' (from texinfo), so you can install them first.

If you still get the error message "WARNING: ‘makeinfo’ is missing on your system." and you're sure that makeinfo is properly installed on your path, try
$ makeinfo --version
If your makeinfo version is 4.11 or higher, then you may have encountered a well-known ‘binutils’ bug. In short, the build scripts incorrectly thinks 4.11 is an older version than 4.4. If you are sure that you have a correct version of makeinfo, then you can manually remove this broken check. In binutils' Makefile, find MAKEINFO = <...>/missing makeinfo and change it to MAKEINFO = /usr/bin/makeinfo. Also you can fix build scripts:

./configure binutils with --disable-shared --enable-static and build with make AM_LDFLAGS="-all-static".

SBU

The time it takes to compile Binutils is what is referred to as the Standard Build Unit (SBU) in LFS book. So, on my PowerPC 7400 466.666665MHz 'time make' prints

real 18m 51.57s
user 13m 53.34s
sys 2m 4.43s

OpenSSH

If you choose not to use OpenSSH on Unix, the following free SSH implementations are available for interoperating with OpenSSH:

OSSH is an SSH1-only implementation. BSD Licence. Björn Grönvall was the original person to remind our community that very old versions of the real ssh had a free licence. This is his own implementation, based on the old Tatu code. OpenSSH was based on an early version of OSSH, but OpenSSH added SSH2 and extended the SSH1 protocol support.

Dropbear is a small SSH2 server-only implementation written by Matt Johnston. It is available under a MIT-style license.

LSH/psst is an SSH2-only implementation, by Niels Möller in Sweden, GPL Licence.

OpenSSL

Upgrading OpenSSL

After an upgrade of OpenSSL package to the newer version, make sure to create links for old .so files (libssl.so.x.x.x and libcrypto.so.x.x.x). For example:

Otherwise, some packages (built with old version of openssl), will refuse to run.

Wget

wget 1.13 vs OpenSSL

This version loves GNU TLS, but not OpenSSL (that's good). But even without --with-ssl specified explicitly, ./configure fails with:

configure: error: --with-ssl was given, but GNUTLS is not available.

wget and texinfo

There is absolutely no need for 'texinfo' to build wget, period. Unless of course you're using development sources, rather than release sources. Even there, it's pretty straightforward to build without it. After doing 'autogen' and 'configure', just go directly into src/ and do a make there. I'd do the "make install" within src/, too, but really you could just copy wget to /usr/bin (or wherever).
Guess you'd also need to go into lib, and md5, and make in those places too. If you continue to run into problems, it might be well just to replace the "all" and "install" targets in doc/Makefile with empty targets or something.

Subversion

It requires a lot. First of all, arp and arp-util libraries ("Apache Portable Runtime Library"; the base portability library and a number of helpful abstractions on top of ‘libapr’). Then sqlite.
But even when svn has been successfully built with all those dependencies met, you will have… nosupport for http:// subversion repositories (like the subversion repo itself, hmm)!
Solution is to choose from libneon or libserf. At first, I tried the first one. It builds perfectly, configured with --without-webdav and nothing about XML (it is really not required for libneon, absolutely)…
What have I got? Working (also with HTTP) subversion? Nope! "configure: error: cannot find Neon" at svn configure stage!

pkgconfig v0.26 versus glib

pkgconfig package now depends on another package to be installed before building — glib.
Otherwise, build will fail on ./configure stage:

checking for pkg-config... pkg-config
configure: error: pkg-config and glib-2.0 not found, please set GLIB_CFLAGS and GLIB_LIBS to the correct values

Considering this removal of embedded glib, it looks like pkgconfig devs do think that glib is installed everywhere ;-) Well, we have two choices: to stuck with v0.25 (which is impossible for Manulix), or get that glib. LFS team has a nice how-to about this topic. Gnome dev center too. The latter also says:

The two tools needed during the build process (as differentiated from the tools used in when creating GLib mentioned above such as autoconf) are pkg-config and GNU make.

Heh, very nice. Another "chicken and egg", which makes it harder to bootstrap new systems "from scratch".

Guile also complains about "gnu-style malloc", where calling malloc(0) returns not NULL, but a scary pointer to something(!?!?): guile-v2.0.0.builddir/libguile/<stdout>:2163: undefined reference to `rpl_malloc'. Workaround is to export the following variables before running autoreconf:

GPM (General Purpose Mouse daemon)

To build GPM, you'll need gpm.h header, which is included in GPM. (Circular reference.) So, to bootstrap GPM, the easiest solution would be:

[ -f /usr/include/gpm.h ] || cp ./src/headers/gpm.h /usr/include/

libiconv

You should install the gettext package at the same time (!) as libiconv due to a circular dependency that is present between the two.
To bootstrap libiconv+gettext, build (1) libiconv, then (2) gettext, then (3) libiconv again.

Mercurial

Note: mercurial still requires python 2.x (>=2.4), but not 3.x. This is considered impossible for Manulix to have multiple versions of the same package, especially for ancient versions which are kept alive (as in zombie) only due to inertia of RHEL and other "corporate" (read: "slowpoke") users.

man-1.6f: configuring

e2fsprogs

You'll need a patch to build e2fsprogs. Fixed in cc84d86 -> 1d18a55.
Note: your uClibc must have been built with UCLIBC_HAS_FTW=y (and probably UCLIBC_HAS_NFTW=y too), otherwise e2fsprogs will complain on "ftw.h".

libtermcap and libtermlib are obsoleted by libncurses. Just create in /usr/lib links 'libtermcap.so' and 'libtermlib.so' pointing to 'libncurses.so' (ln -s libncurses.so libtermlib.so) or even better — replace all occurrences of -ltermcap and -ltermlib with -lncurses, examples: