linking issue

Ellery Newcomer via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun Nov 8 18:32:07 PST 2015


Hi

I apologize in advance for not whittling this down more.

In travis, the shiny new pyd build for ldc is failing:

https://travis-ci.org/ariovistus/pyd/jobs/90001771

circa line 489:

ImportError: 
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-32mu.so: 
undefined symbol: PyExc_SystemError

a similar build with dmd works fine:

https://travis-ci.org/ariovistus/pyd/jobs/90001737

So what is happening is the main python library is static, so the symbol 
ends up in the executable and the numpy shared library can't seem to see 
it at run time (with the ldc build).

The symbol certainly seems to exist:

$ nm ./extra | grep PyExc_SystemError
00000000008d0220 D PyExc_SystemError
00000000008d39e0 d _PyExc_SystemError

in both dmd-generated and ldc-generated executables.

The linkage attributes are different, for reasons derived from the fact 
that usually these symbols live in libpythonxx.so:

// dmd:
extern(C) extern __gshared PyObject* PyExc_SystemError;

// ldc:
extern(C) extern export __gshared PyObject* PyExc_SystemError;


Anyone know what might be the problem?


More information about the digitalmars-d-ldc mailing list