Skip to content

Commit 4deefc8

Browse files
fishilicodavidmalcolm
authored andcommitted
Link with libpython3.8.so
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.
1 parent cdb7020 commit 4deefc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ PYTHON_CONFIG=python-config
104104
#PYTHON_CONFIG=python3.3dm-config
105105

106106
PYTHON_INCLUDES=$(shell $(PYTHON_CONFIG) --includes)
107-
PYTHON_LIBS=$(shell $(PYTHON_CONFIG) --libs)
107+
PYTHON_LIBS=$(shell $(PYTHON) -c 'import sys;print("-lpython%d.%d" % sys.version_info[:2])') $(shell $(PYTHON_CONFIG) --libs)
108108

109109
# Support having multiple named plugins
110110
# e.g. "python2.7" "python3.2mu" "python 3.2dmu" etc:

0 commit comments

Comments
 (0)