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