talideon.com

Everyone’s alive! Everyone survived!

February 18, 2007 at 1:05AM Anything that uses a threaded libxml2 in the FreeBSD ports is horribly broken

It appears there’s a number of rather important ports that don’t do enough checking on what the build configuration they should use should be.

I’ve spent, on and off, a good chunk of today trying to figure out why some of my ports--the likes of GNOME 2 and PHP 5--weren’t building correctly. This was driving me demented. I was convinced that I was going something utterly retarded--a not entirely unlikely situation--when I was installing them.

Eventually I figured out what the problem was. I had WITH_THREADS=yes in my make.conf file because I need it for various reasons for various ports I’ve installed. When WITH_THREADS=yes, it appears that various ports doen’t bother to dereference the PTHREAD_LIBS variable in the command-line arguments for the compiler even when WITH_THREADS=yes is on. Smack, smack, smack, smack!

So, note to self: don’t set WITH_THREADS in make.conf; instead have it passed to make by portinstall. It’s a pain, but it’s safer and avoids retardedness.

To know if you’re having this problem yourself, check the autoconf log (config.log, IIRC) that portinstall will tell you about when the ./configure stage of the build fails. It’s a wee bit annoying that it doesn’t just tell you that the aclocal file for libxml2 doesn’t include a check for this and an actual diagnostic error when it fails. Anyway, you should find something like this:

/usr/local/lib/libxml2.so: undefined reference to `pthread_equal'

If you do, you’ve got a threaded libxml2 library and a port that uses it but is too dumb to check if it needs to link to pthreads or not.

Technorati Search Technorati Search Irish Bloggers

Comments

1 On March 23, 2007 at 21:41, John M. wrote:

Thanks for the article - this really saved my bacon. I exactly put WITHTHREADS in the makefile and ran up against this. I haven’t solved it yet, but I’m now on the right track.

Post a comment

All form information is optional, but it’s a good idea to fill in your name and email address if you want me to take your comment seriously.

Spammers, don’t bother posting crap down here. The site is set up so that legitimate search engines (Google, for instance) won’t index pages with comments on them. Posting crud here only means you’re wasting my time and patience. Shoo!

Real names, please. Please include!
Won’t be displayed. Please include!
Displayed, if present.