Hi,
A couple of weeks ago I sent a couple of patches via private e-mail to
David Malcom and one of them (attached) was not accepted because it
was not clear why it was needed. At the moment I didn't have more info
on that, but now that I came back to the issue, found some interesting
input. It turns out that, according to [0] you must compile shared
objects with -fPIC, so I keep getting this error when trying to build
the plugin in amd64:
======================================================================
ERROR: test_module_with_type (__main__.SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "testcpybuilder.py", line 188, in test_module_with_type
bm.build(MODNAME)
File "testcpybuilder.py", line 102, in build
self.compile_src(extra_cflags)
File "testcpybuilder.py", line 95, in compile_src
raise CompilationError(self)
CompilationError:
returncode: 1
compiling: gcc -o /tmp/tmpzNKYHi/module_with_type.so
-I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing
-march=athlon64 -O2 -pipe -fwrapv -DNDEBUG -Wall -Werror -shared
/tmp/tmpzNKYHi/module_with_type.c
Stdout:
Stderr:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/cco3TFC3.o: relocation R_X86_64_32 against `.rodata.str1.1' can
not be used when making a shared object; recompile with -fPIC
/tmp/cco3TFC3.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
Can anybody give any input on this? Would it hurt to add the -fPIC
flag to the compilation?
Thanks!
David E. Narváez
[0]
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3