Archive

Archive for May, 2011

perl-XML::LibXML + global external entity loader

May 15th, 2011 No comments

Just created a quick patch against perl XML::LibXML module, that adds global external entity loader support. Till now it was only possible to have per instance entity loader, but this is not enough if you want i.e., XML::LibXSLT to also use yours entity loader for imports, and input callbacks doesn’t suit all your needs.

Usage is simple:

XML::LibXML::externalEntityLoader(\&_entity_handler);

where _entity_handler is subroutine like by option ext_ent_handler described in (http://search.cpan.org/dist/XML-LibXML/lib/XML/LibXML/Parser.pod#PARSER_OPTIONS).

Note: when you define global entity loader, per instance entity loader is simply ignored.

You can download this patch  from http://devel.dob.sk/patches/perl-XML::LibXML+global_entity_loader-0.1.diff. Just download XML::LibXML from cpan, patch it and install. I’ll try to push it to CPAN if possible ;-)

Categories: devel, perl, xml Tags: ,

gentoo + xen compilation problems

May 11th, 2011 No comments

If you get following compilation error while emerging xen (resp. xen-tools):

arch/i386/core/cpu.c: In function 'get_cpuinfo':
arch/i386/include/bits/cpu.h:79:2: error: can't find a register in class 'BREG' while reloading 'asm'
arch/i386/include/bits/cpu.h:79:2: error: can't find a register in class 'BREG' while reloading 'asm'
arch/i386/include/bits/cpu.h:79:2: error: can't find a register in class 'BREG' while reloading 'asm'
arch/i386/include/bits/cpu.h:79:2: error: can't find a register in class 'BREG' while reloading 'asm'
arch/i386/include/bits/cpu.h:79:2: error: 'asm' operand has impossible constraints
arch/i386/include/bits/cpu.h:79:2: error: 'asm' operand has impossible constraints
arch/i386/include/bits/cpu.h:79:2: error: 'asm' operand has impossible constraints
arch/i386/include/bits/cpu.h:79:2: error: 'asm' operand has impossible constraints
make[7]: *** [bin/cpu.o] Error 1
make[7]: *** Waiting for unfinished jobs....

Than you should not only switch to non-hardened gentoo profile as everywhere is written (via eselect profile), but you need also to switch to vanilla gcc compilator (via gcc-config). Doing just one thing is not enough – thats the magic. You can switch back your profile & gcc back when xen compiled.

Categories: admin, time saver Tags: ,