For that, you can easily build an ELF cross compiler using MacPorts. The name of the required packages are i386-elf-gcc and i386-elf-binutils.
Moreover, Mac OS X does not provide necessary Perl modules but you can install them with MacPorts. The package names are p5-xml-xpath and p5-xml-libxml.