Tom,
> Doubtless, your problem is that you're setting LD not LDFLAGS.
>
Nope, I originally had LDFLAGS set to "-m32" instead of LD, and it
failed with another error trying to link the localtime.o object (which
it had compiled as 64-bit) to create SYS-something-or-other.o (which it
was trying to create as 32-bit.) A quick Google revealed setting that
flag in the LD environment variable, which got it a bit further but then
bought up this error.
Everything else compiled fine then, it's just the contrib/spi module.
Andy