Subject: pkg/31975: www/py-clearsilver
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <eggert@macvaerk.dtu.dk>
List: pkgsrc-bugs
Date: 11/01/2005 23:49:00
>Number:         31975
>Category:       pkg
>Synopsis:       www/py-clearsilver (neo_cgi.so) on macppc contain unsupported relocation type 6 in non-PLT relocations
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 01 23:49:00 +0000 2005
>Originator:     Daniel Eggert
>Release:        NetBSD 2.1_RC5
>Organization:
Macvaerk, DTU
>Environment:
System: NetBSD ipv6 2.1_RC5 NetBSD 2.1_RC5 (GENERIC) #0: Mon Sep 19 20:54:23 UTC 2005 riz@faith.netbsd.org:/home/builds/ab/netbsd-2-1-RC5/macppc/200509182312Z-obj/home/builds/ab/netbsd-2-1-RC5/src/sys/arch/macppc/compile/GENERIC macppc
Architecture: powerpc
Machine: macppc

# ldd /usr/pkg/lib/python2.3/site-packages/neo_cgi.so
/usr/pkg/lib/python2.3/site-packages/neo_cgi.so:
         -lz.0 => /usr/lib/libz.so.0
         -lpthread.0 => /usr/lib/libpthread.so.0

>Description:
The file
    /usr/pkg/lib/python2.3/site-packages/neo_cgi.so
is not compiled correctly. It is part of www/py-clearsilver.

When it is imported into python code with
    import neo_cgi
the following error results:
    ImportError: /usr/pkg/lib/python2.3/site-packages/neo_cgi.so: Unsupported relocation type 6 in non-PLT relocations\n

According to this reference
    <http://mail-index.netbsd.org/port-powerpc/2005/03/11/0001.html>
this is because it was not compiled with -fPIC or -fpic. I don't quite know about that myself, though.

Seems to be powerpc specific.

I ran into this problem while trying to run www/trac on a macppc machine.

When i 'make' www/py-clearsilver I see this as the last lines:
    cc -fno-strict-aliasing -DNDEBUG -O2 -I/usr/include -O2 -I/usr/include -I/usr/pkg/include/python2.3 -Wall -I../ -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -I../ -I/usr/include -I/usr/pkg/include/python2.3 -fPIC -I/usr/include -I/usr/pkg/include/python2.3 -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -c neo_util.c -o build/temp.netbsd-2.1_RC5-macppc-2.3/neo_util.o
    cc -fno-strict-aliasing -DNDEBUG -O2 -I/usr/include -O2 -I/usr/include -I/usr/pkg/include/python2.3 -Wall -I../ -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -I../ -I/usr/include -I/usr/pkg/include/python2.3 -fPIC -I/usr/include -I/usr/pkg/include/python2.3 -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -c neo_cs.c -o build/temp.netbsd-2.1_RC5-macppc-2.3/neo_cs.o
    cc -fno-strict-aliasing -DNDEBUG -O2 -I/usr/include -O2 -I/usr/include -I/usr/pkg/include/python2.3 -Wall -I../ -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -I../ -I/usr/include -I/usr/pkg/include/python2.3 -fPIC -I/usr/include -I/usr/pkg/include/python2.3 -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -c neo_cgi.c -o build/temp.netbsd-2.1_RC5-macppc-2.3/neo_cgi.o
   cc -pthread -shared -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L../libs/ -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib/python2.3/config -Wl,-R/usr/pkg/lib/python2.3/config -Wl,-R/usr/pkg/lib -O2 -I/usr/include -I/usr/pkg/include/python2.3 -Wall -I../ -I/usr/include -I/usr/pkg/include/python2.3 -I../ -I/usr/pkg/include/python2.3 -I../ -I/usr/include -I/usr/pkg/include/python2.3 build/temp.netbsd-2.1_RC5-macppc-2.3/neo_cgi.o build/temp.netbsd-2.1_RC5-macppc-2.3/neo_cs.o build/temp.netbsd-2.1_RC5-macppc-2.3/neo_util.o -L/usr/lib -L/usr/pkg/lib/python2.3/config -L../libs -lz -lneo_cgi -lneo_cs -lneo_utl -o neo_cgi.so -L../libs/ -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib/python2.3/config -Wl,-R/usr/pkg/lib/python2.3/config -Wl,-R/usr/pkg/lib

There is -fPIC on the three first lines, but not on the last one. Maybe that's the cause of the problem?

>How-To-Repeat:
Build
    www/py-clearsilver
and run
    % python2.3
type
    import neo_cgi
at the python prompt. You'll get the above error.

>Fix:

Need to add -fPIC or -fpic to compilation?