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 <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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