From: Michael Jeanson Date: Wed, 25 Oct 2017 20:30:31 +0000 (-0400) Subject: Fix: python bindings when building with PIE hardening X-Git-Tag: v1.5.4~16 X-Git-Url: https://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=9de34faace8ca957d6b71e392f7100690bdb9f7e Fix: python bindings when building with PIE hardening Work around a bug/limitation in python distutils where object files are built with -fPIC appended after the CFLAGS but the final shared object is linked with -shared before the LDFLAGS which can then be overriden by hardening flags and result in an invalid build. The work around is to append -shared to the LDFLAGS making sure it's not overriden. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index 2ceab037..5e4dde84 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -25,7 +25,7 @@ BINDINGS_DEPS=setup.py \ BUILD_FLAGS=CC="$(CC)" \ CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS)" \ CPPFLAGS="$(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)" \ - LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(GLIB_LIBS) $(LIBS)" + LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(GLIB_LIBS) -shared $(LIBS)" build-python-bindings.stamp: $(BINDINGS_DEPS) $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build_ext