perl-unicode

Re: Issue: Encode.so: undefined symbol: PL_utf8skip

2015-07-23 22:14:26
On 07/23/2015 11:13 AM, Bright Dadson wrote:
Hi Guys,

I am trying to create a perl embed application which expose
WWW::Mechanize into my Cython extension project.

I compile and link my extension using:


x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC
-I/usr/lib/perl/5.18/CORE -I/usr/include/python3.4m
-I/home/losintikfos/git/testproj/env/include/python3.4m -c src/perlxsi.c
-o build/temp.linux-x86_64-3.4/src/perlxsi.o -O0 -g3 -Wall -c
-fmessage-length=0 -Wl,-E -fstack-protector -L/usr/local/lib
-L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl/5.18/CORE

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC
-I/usr/lib/perl/5.18/CORE -I/usr/include/python3.4m
-I/home/losintikfos/git/testproj/env/include/python3.4m -c
src/perlmechanize.c -o build/temp.linux-x86_64-3.4/src/perlmechanize.o
-O0 -g3 -Wall -c -fmessage-length=0 -Wl,-E -fstack-protector
-L/usr/local/lib -L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lc
-lcrypt -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl/5.18/CORE

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions
-Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2
build/temp.linux-x86_64-3.4/src/perlxsi.o
build/temp.linux-x86_64-3.4/src/perlmechanize.o
build/temp.linux-x86_64-3.4/src/pymechanize.o -lperl -o
build/lib.linux-x86_64-3.4/pymechanize.cpython-34m.so
<http://pymechanize.cpython-34m.so>

Which works fine.

My problem is - when I import calls from my extension module
pymechanize.cpython-34m.so <http://pymechanize.cpython-34m.so> I get
below error:


Can't load '/usr/local/lib/perl/5.18.2/auto/Encode/Encode.so' for module
Encode: /usr/local/lib/perl/5.18.2/auto/Encode/Encode.so: undefined
symbol: PL_utf8skip at /usr/share/perl/5.18/XSLoader.pm line 68.
  at /usr/local/lib/perl/5.18.2/Encode.pm line 10.
Compilation failed in require at
/usr/local/share/perl/5.18.2/HTML/Form.pm line 6.
BEGIN failed--compilation aborted at
/usr/local/share/perl/5.18.2/HTML/Form.pm line 6.
Compilation failed in require at
/usr/local/share/perl/5.18.2/WWW/Mechanize.pm line 133.
BEGIN failed--compilation aborted at
/usr/local/share/perl/5.18.2/WWW/Mechanize.pm line 133.
Compilation failed in require.
BEGIN failed--compilation aborted.
Attempt to reload WWW/Mechanize.pm aborted.
Compilation failed in require at (eval 9) line 1.
BEGIN failed--compilation aborted at (eval 9) line 1.


For almost two weeks now I have tried various options - including
reinstalling Encode.pm but to no luck. I can see the symbol is there
when I do:

nm /usr/local/lib/perl/5.18.2/auto/Encode/Encode.so | grep PL_utf8skip

Do anyone know what might be causing this?

-Bright

I don't know, but I can tell you that that symbol (a reference to a C array) is defined in the core's utf8.h file. The macro DOINIT must be defined in order to get the definition; otherwise the symbol is just a declaration of the array which is defined elsewhere. Things are supposed to work out that DOINIT is defined just once automatically in the compilation.

<Prev in Thread] Current Thread [Next in Thread>