davidmalcolm / gcc-python-plugin

GCC plugin that embeds CPython inside the compiler
GNU General Public License v3.0
197 stars 58 forks source link

Link with libpython3.8.so #185

Closed fishilico closed 3 years ago

fishilico commented 4 years ago

Since Python 3.8, python-config --libs no longer includes /usr/lib/libpython3.8.so in the linked libraries. This results in the following error when using plugins, for example in make man:

PYTHONPATH=./ CC_FOR_CPYCHECKER=cc LD_LIBRARY_PATH=gcc-c-api:
CC=cc ./gcc-with-python generate-passes-svg.py test.c
cc1: error: cannot load plugin
/usr/src/gcc-python-plugin/src/gcc-python-plugin-0.17/python.so
   /usr/src/gcc-python-plugin/src/gcc-python-plugin-0.17/python.so: undefined symbol:
PyUnicode_FromFormat

Fix this by adding -lpython3.8 to $(PYTHON_LIBS) in Makefile.