Skip Menu |

This queue is for tickets about the PHP-Serialization-XS CPAN distribution.

Report information
The Basics
Id: 51590
Status: resolved
Priority: 0/
Queue: PHP-Serialization-XS

People
Owner: kulp [...] cpan.org
Requestors: peter [...] makholm.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.06



Subject: Does not compile on Debian Linux/amd64
I get the following error trying to compile PHP::Serialization::XS om my Debian amd64-box: makholm@makholm:/tmp/PHP-Serialization-XS-0.04$ make cp lib/PHP/Serialization/XS.pm blib/lib/PHP/Serialization/XS.pm /usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap XS.xs > XS.xsc && mv XS.xsc XS.c cc -c -I. -Iphpserialize/parser -std=c99 -D_XOPEN_SOURCE=700 -O2 -g - DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -fPIC "- I/usr/lib/perl/5.10/CORE" XS.c cc -c -I. -Iphpserialize/parser -std=c99 -D_XOPEN_SOURCE=700 -O2 -g - DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -fPIC "- I/usr/lib/perl/5.10/CORE" convert.c convert.c: In function '_convert_recurse': convert.c:38: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type cc -std=c99 -D_XOPEN_SOURCE=700 -c -o phpserialize/parser/stringstore.o phpserialize/parser/stringstore.c cc -std=c99 -D_XOPEN_SOURCE=700 -c -o phpserialize/parser/ps_parser.o phpserialize/parser/ps_parser.c Running Mkbootstrap for PHP::Serialization::XS () chmod 644 XS.bs rm -f blib/arch/auto/PHP/Serialization/XS/XS.so cc -shared -O2 -g -L/usr/local/lib -fstack-protector XS.o convert.o phpserialize/parser/stringstore.o phpserialize/parser/ps_parser.o -o blib/arch/auto/PHP/Serialization/XS/XS.so \ \ /usr/bin/ld: phpserialize/parser/stringstore.o: relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC phpserialize/parser/stringstore.o: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [blib/arch/auto/PHP/Serialization/XS/XS.so] Error 1 makholm@makholm:/tmp/PHP-Serialization-XS-0.04$ Adding -fPIC to CCFLAGS in Makefile.PL helps. But I'm not sure if this is the correct portable solution
Subject: php_serialization_php.patch
diff --git a/Makefile.PL b/Makefile.PL index 80f8df4..fd504fd 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,7 +13,7 @@ WriteMakefile( DEFINE => '', # e.g., '-DHAVE_SOMETHING' INC => '-I. -Iphpserialize/parser', # e.g., '-I. -I/usr/include/other' OBJECT => '$(O_FILES) phpserialize/parser/stringstore.o phpserialize/parser/ps_parser.o', # link all the C files too - CCFLAGS => '-std=c99 -D_XOPEN_SOURCE=700', + CCFLAGS => '-fPIC -std=c99 -D_XOPEN_SOURCE=700', ); # TODO this shouldn't be necessary
Thanks ! I am not certain how to deal with this across compilers, but at least for GCC it will always work, although the code may be unnecessarily slower (by an undetectable margin in this case, I am sure). I will likely apply this patch or something like it before the end of the day. -- --kulp
This was actually resolved a long time ago, in v0.06. https://github.com/kulp/PHP-Serialization-XS commit 250334d9913aafb667d08a50ba724f0f0a5b35c1 Author: Darren Kulp <darren@kulp.ch> Date: Tue Nov 17 10:41:56 2009 -0600 -- --kulp