Evan Martin (evan) wrote in evan_tech,
Evan Martin

stupid libtool

libtool is one piece of the autotools chain that you probably aren’t familiar with unless you build portable software for unices. It abstract libraries, both static and shared, across platforms as diverse as HPUX and Windows. It also does an unbelievable amount of trickery that you may have encountered when randomly building software, stuff like making hidden “.libs” directories and making your compiled executables scripts that call into those directories*.

It also generates “.la” files, which you’ll see scattered in your /usr/lib. These are used to track dependencies of shared libraries. If project P depends on library L which uses library L2, then on some platforms (HPUX is the example, I think) P needs to be built with both -lL and -lL2. This is yet another good thing libtool handles.

But! Recent operating systems, including Linux, handle the dependency problem themselves, and libtool takes a lot of time to process. LogJam takes almost ten seconds to link (that’s link, not build; ten seconds just to stitch the .o’s together) on my laptop, and nearly half of that time is spend in libtool where it’s just calculating the actual link line for gcc. So here’s the trick: you can just rm those la files (I mv them into /usr/lib/la) and things will work as before, but noticeably faster. This solution came from Owen Taylor of GTK+, someone who really knows the gory details of libraries, so it’s pretty safe.

* This is actually important, because it means you can run a program that depends on shared libraries without installing it; libtool fixes up the library paths. But it thwarts running the debugger, because you no longer have a binary. What to do? “libtool gdb ./scriptexecutable” does what you want.

  • flipped bits

    % bdiff /mnt/disk1/large_file /mnt/disk2/same_large_file diffing: [........................................] offset diff 346360387: 01011111 :…

  • yep, it's toast / wait, no it's not

    It wasn't the USB enclosure. Error 47 occurred at disk power-on lifetime: 2330 hours (97 days + 2 hours) Model Family: Seagate Barracuda 7200.7…

  • my "final destination" reference was prescient

    When I last discussed my disk problems, I had finally managed to recover my data though there was an ominous noise from my new disk. In the…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.