Hello,

I have a python binary compiled statically, when I try to do the same with ctypes (outside of python compilation using the tar.gz) I get error because is trying to build the .so instead of a .a

Sorry I'm a bit lost with this, but anyways here is the compilation flags:

$> LDFLAGS="-Wl,-no-export-dynamic -static-libgcc -static -ldl -L/usr/local/lib -L/usr/local/lib64 -lev" CPPFLAGS="-static -fPIC -I/usr/local/include" /usr/local/python-static/bin/python setup.py build

Here is the output:

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.6/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/crtbeginT.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Any help will be appreciated.

Thanks.
--
Roberto Bouza Fraga.
www: http://www.robertobouza.com
t: http://twitter.com/bouzafr - @bouzafr
e: bouzafr@gmail.com