Painful Learning Experiences

So it turns out instead of learning a language like Erlang, Smalltalk or Lisp, I've ended up learning much more about that old clunker of a language. C.

Not just C really. I already had a passing understanding of C. What I've been learning about this week is the autotools toolchain, gcc, linkers and related kit.

I had a weird problem. This problem only occured on OSX, not on Debian, and everyone I talked to said something along the lines of "It should just work".

Here's a real brief description of the problem:

There are three object files. A, B and C. A contains symbol X. B contains symbol Y, and refers to symbol X. C refers to symbol Y.

As expected, gcc A.o B.o C.o will link these together correctly.

A and B are in an 'ar' archive libD.a, created using ar cru libfoo.a A.o B.o; ranlib libD.a. When linking C.o and libD.a, using gcc C.o libD.a symbol X cannot be found.

Reasonably complicated, but on a basic level, it seems that the linker can't resolve symbols that are in files in an 'ar' file, from other places in the 'ar' file. And that's exactly what was happening, and only on OSX.

It turns out, that much like a dear friend relates about how IBM ''fixed'' awk back in the day. Apple has ''fixed'' libtool and ranlib.

   -c Include common symbols as definitions with respect to the table
      of contents. This is seldom the intended behavior for linking
      from a library, as it forces the linking of a library member
      just because it uses an uninitialized global that is undefined
      at that point in the linking. This option is included only
      because this was the original behavior of ranlib. This option
      is not the default.

Apple have 'added' the -c flag to ranlib, to restore the behaviour that someone using the tool would expect to occur, but Apple in their wisdom have decided to remove.

Now the project in question will make a snarky remark in the ./configure stage if it detects a non-GNU ranlib, and add the -c flag.

'rati tags: ,


Zoom In Dot Com Dot Aye Ewe

Oh My Goodness. We finally have mapping that doesn't suck. Zoom In Dot Com Dot Aye Ewe is a google mapsish web service, and it completely rocks.

Here's an example map, this is a link to one of the places in Brisbane where I like eating out: http://zoomin.com.au/australia/qld/brisbane/milton/park+road. Just look at that url! Isn't it pretty? Gee, I wish some of my urls looked like that.

I'm gushing, but this is just so sexy. There aren't any ads (I don't really expect it will be long before geographical based ads pop up here, it's just a matter of time, and it makes sense)

The service is reasonably new. I have user account number 160. But apparently these blokes have been operating in Kiwi Land for a while now.

'rati tags:


Thanks Be To Sourceforge

Thanks to sourceforge, development rate has increased, we're moving nearly a dozen repositories to darcs (or other VCS's possibly), and people are getting really involved. There's a veritable frenzy of development and maintenance work being done.

This is thanks to SourceForge's CVS being down of course.


All The Safari Books

How to get all the Safari Books Online, a step by step guide.

  1. Go to a branch of the Brisbane City Council library system. Bring photo ID and proof of address. Drivers license is recommended.
  2. Go to the information desk. Request Library Membership. Provide all details requested. Receieve Library Card and PIN.
  3. Thank Library staffperson. Leave the library and go home.
  4. Use your web browser, and summon http://www.brisbane.qld.gov.au/libcatalogue
  5. Log into this website using your barcode number from your Library card, and the PIN you received in step 2.
  6. Click on Authorised Databases
  7. Click on Safari Books Online

Yay For Brisbane! I love this city.


Darcs talk at HUMBUG.

I think my darcs talk went well. Those who were interested got some information that will help them make intelligent decisions.

The talk was recorded. Don't know how good the recording is yet, we'll see.

Slides are available directly out of the darcs repo.

Public speaking always makes me nervous before and after, but during I feel like I'm flying.


Vmware hassles with vmnets and udev

Installing vmware creates a bunch of devices in /dev/ on installation. These devices are used for virtual networks (vmnets). If you're running udev, these devices will be created on install, and then the first time you reboot, they'll disappear.

for i in $(seq 0 9)
do [ -e /dev/vmnet$i ] || mknod /dev/vmnet$i c 119 $i

That's the little bash script you have to run as root to recreate those devices if they don't exist. I couldn't find this little gem anywhere, so I'm recording it here for future generations of vmware users.

'rati tags: