Damon Cortesi's blog

Musings of an entrepreneur.

MySQL 4.1 Upgrade on Gentoo

| Comments

Like a few others, I had a problem upgrading MySQL to 4.1 on Gentoo. I was faithfully following the upgrade guide and got to the revdep-rebuild part of step 3. Revdep-rebuild said it was going to take the following actions:

emerge –oneshot –nodeps -pv =dev-php/mod_php-4.4.0-r9 =dev-php/php-4.4.0 =net-libs/libwww-5.4.0-r3

However, I got the following error during the first part of revdep-rebuild when it was trying to compile mod_php:

can not run test program while cross compiling

Well that’s definitely odd as I wasn’t attempting to cross-compile. I googled around quickly and found several people with a similar problem (with quite a few in German…) and a couple solutions. I tried re-emerging gentoolkit, but that didn’t help. I then came across Bob Rasey who was having the same problem. Looking through my config.log, it did appear that something was trying to link against libmysqlclient.so.12, which I didn’t have…but I didn’t like his solution of adding a symlink as that seemed somewhat hackish. Gentoo is already sensitive enough, and I didn’t want to take any chances.

Going back through the config.log, I noticed that the test compile mentioned in this thread was failing with the following error:

libmysqlclient.so.12, needed by /usr/lib/libxmlparse.so, not found

A quick

equery belongs /usr/lib/libxmlparse.so

revealed that the file actually belongs to libwww. Ah-ha! This is beginning to make more sense now.

mod_php links to libxmlparse, which requires libmysqlclient.so.12. But that’s not there anymore since I upgraded MySQL. libxmlparse is part of libwww, though, which is also slated to be rebuilt, but not until after mod_php. And that is where the problem lies. Re-emerging libwww by itself to get libxmlparse.so to link to the proper libraries and then continuing with the revdep-rebuild solved the problem.