diff --git a/package/python/python.mk b/package/python/python.mk index 94765cbb84..216448e309 100644 --- a/package/python/python.mk +++ b/package/python/python.mk @@ -34,6 +34,12 @@ HOST_PYTHON_CONF_OPT += \ --disable-ssl \ --disable-pyo-build +# Make sure that LD_LIBRARY_PATH overrides -rpath. +# This is needed because libpython may be installed at the same time that +# python is called. +HOST_PYTHON_CONF_ENV += \ + LDFLAGS="$(HOST_LDFLAGS) -Wl,--enable-new-dtags" + # Building host python in parallel sometimes triggers a "Bus error" # during the execution of "./python setup.py build" in the # installation step. It is probably due to the installation of a diff --git a/package/python3/python3.mk b/package/python3/python3.mk index 880b66e3c5..3d95a6d8e2 100644 --- a/package/python3/python3.mk +++ b/package/python3/python3.mk @@ -30,6 +30,12 @@ HOST_PYTHON3_CONF_OPT += \ --disable-idle3 \ --disable-pyo-build +# Make sure that LD_LIBRARY_PATH overrides -rpath. +# This is needed because libpython may be installed at the same time that +# python is called. +HOST_PYTHON3_CONF_ENV += \ + LDFLAGS="$(HOST_LDFLAGS) -Wl,--enable-new-dtags" + PYTHON3_DEPENDENCIES = host-python3 libffi HOST_PYTHON3_DEPENDENCIES = host-expat host-zlib