Fix: build example SO when PIE is enabled
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
AppliedMerged into lttng-ust master, thanks!
Mathieu
Quoted 73 lines · ----- On Oct 25, 2017, at 2:28 PM, Michael Jeanson [email protected] wrote:
In the example Makefiles, when building shared object libraires, make sure we set the custom linker options after the CFLAGS/LDFLAGS so that it overrides them. This is useful when the build system set some hardening features like PIE in the CFLAGS.
Signed-off-by Michael Jeanson <[email protected]>---
doc/examples/clock-override/Makefile | 4 ++-- doc/examples/demo/Makefile | 8 ++++---- doc/examples/getcpu-override/Makefile | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)doc/examples/clock-override/Makefile +0
-0@@ -26,8 +26,8 @@ lttng-ust-clock-override-example.o:
lttng-ust-clock-override-example.c$(CFLAGS) -fpic -c -o $@ $<lttng-ust-clock-override-example.so: lttng-ust-clock-override-example.o
doc/examples/clock-override/Makefile +2
-2- $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ - $(AM_LDFLAGS) $(CFLAGS) lttng-ust-clock-override-example.o + $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ + $(AM_LDFLAGS) $(CFLAGS) -shared -fpic lttng-ust-clock-override-example.o.PHONY: clean
clean:doc/examples/demo/Makefile +0
-0@@ -29,16 +29,16 @@ tp2.o: tp2.c ust_tests_demo2.h $(CFLAGS) -fpic -c -o $@ $<lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o
doc/examples/demo/Makefile +2
-2- $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ - $(AM_LDFLAGS) $(CFLAGS) -llttng-ust tp.o tp2.o + $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ + $(AM_LDFLAGS) $(CFLAGS) -shared -fpic tp.o tp2.o $(LIBS) -llttng-usttp3.o:
tp3.cust_tests_demo3.h$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ $(CFLAGS) -fpic -c -o $@ $<lttng-ust-provider-ust-tests-demo3.so: tp3.o
doc/examples/demo/Makefile +2
-2- $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ - $(AM_LDFLAGS) $(CFLAGS) -llttng-ust tp3.o + $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ + $(AM_LDFLAGS) $(CFLAGS) -shared -fpic tp3.o $(LIBS) -llttng-ustdemo.o:
demo.c$(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \doc/examples/getcpu-override/Makefile +0
-0@@ -26,8 +26,8 @@ lttng-ust-getcpu-override-example.o:
lttng-ust-getcpu-override-example.c$(CFLAGS) -fpic -c -o $@ $<lttng-ust-getcpu-override-example.so: lttng-ust-getcpu-override-example.o
doc/examples/getcpu-override/Makefile +2
-2- $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ - $(AM_LDFLAGS) $(CFLAGS) lttng-ust-getcpu-override-example.o + $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \ + $(AM_LDFLAGS) $(CFLAGS) -shared -fpic lttng-ust-getcpu-override-example.o.PHONY: clean
clean:
--
2.7.4
Signature · 7 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev