Today, I hate... who?
Not sure who to hate today. At first I was going to hate Karsten, but I quickly realized that he's actually on the good side, fixing problems rather than causing them. But someone has to be responsible for the abomination known as libtool, right?
It all started when I wanted to run Hercules. I extracted my old images and hercules.cnf, ran "yum install hercules", and then... Hercules starts, but recognizes no devices, starting with the 3505.
The problem is in the so-called "dynamic load": emulators for devices are shared objects, and our stock Hercules on Fedora searches for them everywhere except where necessary:
write(4, "HHCCF065I Hercules: tid=2AD76E5C"..., 72) = 72
open("/hercules/hdt3505.la", O_RDONLY) = -1 ENOENT
open("/hercules/hdt3505", O_RDONLY) = -1 ENOENT
open("/lib/hdt3505.la", O_RDONLY) = -1 ENOENT
open("/usr/lib/hdt3505.la", O_RDONLY) = -1 ENOENT
open("hdt3505.la", O_RDONLY) = -1 ENOENT
access("/lib/hdt3505", R_OK) = -1 ENOENT
access("/usr/lib/hdt3505", R_OK) = -1 ENOENT
open("/etc/ld.so.cache", O_RDONLY) = 10
fstat(10, {st_mode=S_IFREG|0644, st_size=84779, ...}) = 0
mmap(NULL, 84779, PROT_READ, MAP_PRIVATE, 10, 0) = 0x2aaaaf55b000
close(10) = 0
open("/lib64/tls/hdt3505", O_RDONLY) = -1 ENOENT
open("/lib64/hdt3505", O_RDONLY) = -1 ENOENT
open("/usr/lib64/tls/hdt3505", O_RDONLY) = -1 ENOENT
open("/usr/lib64/hdt3505", O_RDONLY) = -1 ENOENT
munmap(0x2aaaaf55b000, 84779) = 0
write(4, "HHCCF042E Device type 3505 not r"..., 42) = 42
The real path is /usr/lib64/hercules/hdt3505.so. Did nobody ever test?!
So I download the source, configure with --disable-dynamic-load, build, everything works. After all, the whole /usr/lib64/hercules is only 240KB, who needs dynamic modules anyway? Then, I want to be good and try to build an RPM... It bombs with "ld: undefined hdl_genhdl".
It gets even more involved. Apparently, when I run configure by hand, libtool fails, falls back to linking from .a, and then everything works. But when I build an RPM, libtool succeeds, produces .so, then linking fails because...
So, spent a day trying to understand how libtool worked and why removal of rpath causes it to produce garbage, etc. until it was time to sleep. Today, filed a bug, moved on. Let Matthias to puzzle it out.
UPDATE 20080103: Hans de Goede fixed it.
Syndicated 2008-01-29 21:42:38 (Updated 2008-02-03 19:57:30) from Pete Zaitcev