On Wed, 2011-09-07 at 23:04 +0100, Vinay Sajip wrote:
> In addition to the notes in the previous mail, this sounds a
little
like
> this bug report:
>
http://bugs.python.org/issue4434
> though that didn't seem to have a "real" resolution.
I think you're right - preloading using LD_PRELOAD makes the problem
go away. The log from LD_DEBUG=all make demo shows that when the
symbol is sought from python.so, libpython2.7.so is never consulted.
Can one mark python.so to show that it depends on libpython2.7.so? ldd
shows no such dependency.
On my builds, libpython2.7.so.1.0 _is_ showing up in the metadata:
[david@surprise pyapi]$ ldd python.so | grep libpython
libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007f9a6e3d1000)
[david@surprise pyapi]$ eu-readelf -d python.so | grep libpython
NEEDED Shared library: [libpython2.7.so.1.0]
I wonder why it's present for my builds, and not for yours. What does
python-config --ldflags
show for you?
On this Fedora 15 x86_64 box I get:
[david@surprise pyapi]$ python-config --ldflags
-lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic
and the linker invocation from the "make plugin" looks like this:
gcc -I/usr/lib/gcc/x86_64-redhat-linux/4.6.0/plugin/include -fPIC -O2
-Wall -Werror -g -I/usr/include/python2.7 -I/usr/include/python2.7
-fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
-mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC
-fwrapv -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic
-shared gcc-python.o gcc-python-callgraph.o gcc-python-cfg.o
gcc-python-closure.o gcc-python-function.o gcc-python-gimple.o
gcc-python-location.o gcc-python-option.o gcc-python-parameter.o
gcc-python-pass.o gcc-python-pretty-printer.o gcc-python-rtl.o
gcc-python-tree.o gcc-python-variable.o autogenerated-callgraph.o
autogenerated-cfg.o autogenerated-option.o autogenerated-function.o
autogenerated-gimple.o autogenerated-location.o
autogenerated-parameter.o autogenerated-pass.o
autogenerated-pretty-printer.o autogenerated-rtl.o autogenerated-tree.o
autogenerated-variable.o -o python.so
> BTW, what were the 4 test failures?
cpychecker/absinterp/arrays3
cpychecker/refcounts/module_handling
plugin/constants
plugin/switch
The complete log of the test failures is at:
https://gist.github.com/1201924
Thanks! All of these look like false failures, due to me
over-specifying the expected output in various ways. I'll try to
reproduce them on a 32-bit 4.6.1 build of gcc.
Dave