This is the mail archive of the
mailing list for the glibc project.
Re: newbie trying to compile libc 2.9 latest
On 4 Feb 2009, Justin Mattock verbalised:
> /mnt/glib/glibc-build/libc_pic.os: In function `__libc_fork':
> undefined reference to `__sync_bool_compare_and_swap_4'
This is all for the same reason: glibc doesn't know what CPU you've got,
so doesn't know what atomic operations to provide. You called configure
> here is my command line:
> sudo /mnt/glib/glibc-20090202/configure --prefix=/usr
> CC=/usr/local/bin/i686-pc-linux-gnu-gcc-4.4.0 --enable-add-ons
> (I know I need more, but not sure what to use);
You *always* have to provide at least a --build argument, e.g.
--build=i686-pc-linux-gnu. The default is i386-pc-linux-gnu, which is
too old to build NPTL.
The rest of the configure flags are a matter of taste: personally, last
time I built glibc, I built with --prefix=/usr --enable-shared
--enable-profile --disable-bounded --enable-bind-now
(Why are you sudoing configure? Never, never, never configure or compile
things as root! If you can avoid it, don't even install things as root:
use fakeroot or something similar instead. But compilation, no, no,
compilers are far too complex beasts to trust with root privileges.)
> I'm using a livecd(ubuntu intrepid)
> and then mounting /dev/sda1 to /mnt
> which will be used for a new system(libc is for the new system);
Run 'make check' and inspect every failure to make sure that it's one
you can live with (e.g. math/test-ildoubl fails on x86-32 and has for
years, but it's a tiny least-significant-bit failure that you can
probably ignore). ('make check' stops every time it hits a failure: run
it again after inspecting that failure and seeing if you're happy with
it. Eventually it will complete without error.)
Take care not to overwrite your existing glibc when installing. Install
somewhere else via 'make install install_root=/installation/location'.
(If you wanted to replace your existing glibc on a handbuilt system,
you'd have to whip something up to atomically move the new glibc's lib/
directory into the real /lib, so that at no time do /lib/ld-linux.so.2
and /lib/libc.so.6 point to different versions of glibc. In practice,
moving the glibc lib/ subdirectory into a newly-created subdirectory of
/lib on the root filesystem and then a mv * into /lib does the trick
unless you have a very badly-timed power failure.)