I've found a workaround (solution?) to this problem.
A stack trace revealed the problem to be occurring in gethostbyname_r in libnss.
Specifying C(XX)FLAGS=DUNDEF_HAVE_GETHOSTBYNAME_R will cause the code to compile without using gethostbyname_r (it will fall back to gethostbyname, using pthread mutexs for thread safety), which solves the problem.
I've created a patch for mysql-5.0.51 that patches configure.in. Running autoconf and then compiling with --without-server will result in a working libmysqlclient (autoconf must be installed).
(This isn't the version that ships with ubuntu, this patch still needs to be worked back into the version that ships with ubuntu).
I've found a workaround (solution?) to this problem.
A stack trace revealed the problem to be occurring in gethostbyname_r in libnss.
Specifying C(XX)FLAGS= DUNDEF_ HAVE_GETHOSTBYN AME_R will cause the code to compile without using gethostbyname_r (it will fall back to gethostbyname, using pthread mutexs for thread safety), which solves the problem.
I've created a patch for mysql-5.0.51 that patches configure.in. Running autoconf and then compiling with --without-server will result in a working libmysqlclient (autoconf must be installed).
(This isn't the version that ships with ubuntu, this patch still needs to be worked back into the version that ships with ubuntu).