Back to XS

ethan on 2003-04-06T08:27:52

Eventually XS is having me back. I prepared a new release for Mail::Transport::Dbx to wipe out one rare segfault. Unfortunately sourceforge has taken down their FreeBSD machine from their compile-farm for maintenance. I don't expect any problems with the new package on BSD but I learnt to be very cautious with releasing XS stuff.

Other than that, I again tackled my XSification of the AA-Lib. It's the second attempt after the first one brought me into a hell of indeterministic segmentation faults and inexplicable behaviour. So I changed my approach a little. But still, it's a hassle. I haven't finished the constructor yet but nonetheless AALib.xs is already over 100 lines long (plus a typemap of course). And that does not include the more sophisticated initialization via aa_init() but only the "basic" one aa_autoinit().

I have the hope - once the init-phase properly done - that the rest is basically just setting up the XSUBs stubs along with a PREFIX directive of "aa_".

Btw, something appears to have changed with h2xs (v1.22), I don't know what. I am using the one that comes with perl5.8.0 in order to use the "-b" switch. Anyway, h2xs is getting the constants from the C libraries mostly wrong. After an initial

h2xs -b 5.5.3 -n Module::Name header.h

I hardly ever get a module that compiles out of the box. Instead I have to manually exclude some symbols with something like

h2xs -b 5.5.3 -n Module::Name -M '^[A-Za-z]' header.h

This is a little annoying because there is not always an exclude pattern that only affects the not-to-be-exported constants. A while back I reported this to the porters who didn't have a solution for it (I guess no one wants to plunge into the innards of h2xs, quite understandably).