From: Francis Deslauriers Date: Tue, 10 Jul 2018 18:36:44 +0000 (-0400) Subject: Fix: Tests: use -no-pie linker option only when available X-Git-Tag: v2.11.0-rc1~160 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=b75d311fbb53cb2f9c857349a6cd1877b411ff60;hp=b75d311fbb53cb2f9c857349a6cd1877b411ff60;p=lttng-tools.git Fix: Tests: use -no-pie linker option only when available Issue ===== To keep the userspace callstack tests simple, we want to prevent the testapp to be linked as a Position Independent Execution (PIE) binary as it is simpler to resolve the addresses of functions. Some distributions now ship GCC built with the --enable-default-pie option which turns on PIE by default. To prevent that, we use the -no-pie linker flag when building the gen-syscall-events-callstack testapp. The issue is that this flag is not available on older version of GCC thus triggering an error when building the project. gcc: error: unrecognized command line option ‘-no-pie’ Solution ======== Test for the availability of the -no-pie option at the configure time and enable it only when found. If the option is unavailable we assume that the -pie option is not enabled by default thus removing the need to prevent its usage with -no-pie in the first place. Known drawbacks =============== None Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau ---