summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-08-18 12:41:11 +0200
committerMark Wielaard <mark@klomp.org>2017-08-18 22:29:46 +0200
commit07737584e73714eff3481fcf17f9f0331c8a5b88 (patch)
tree67958824d82e2be085ac94e75aa2e047d4166704 /lib
parent6d2e7e7100429df3d548251e9685a1eb7bb434cb (diff)
Check for -z,defs, -z,relro, -fPIC, -fPIE before using them
Those flags are not available on all platforms, and omitting them when not available will not cause any harm. In particular: -z,defs disallows undefined symbols in object files. This option is unsupported if the target binary format enforces the same condition already. Furthermore it is only a compile time sanity check. When it is omitted, the same binary is produced. -z,relro instructs the loader to mark sections read-only after loading the library, where possible. This is a hardening mechanism. If it is unavailable, the functionality of the code is not affected in any way. -fPIC instructs the compiler to produce position independent code. While this is preferable to relocatable code, relocatable code also works and may even be faster. Relocatable code might just be loaded into memory multiple times for different processes. -fPIE is the same thing as -fPIC for executables rather than shared libraries. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog4
-rw-r--r--lib/Makefile.am2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 1f162286..67ef2792 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpic_CFLAGS.
+
2017-07-18 Mark Wielaard <mark@klomp.org>
* bpf.h: New file.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index ada2030d..c30d38bf 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -28,7 +28,7 @@
## not, see <http://www.gnu.org/licenses/>.
##
include $(top_srcdir)/config/eu.am
-AM_CFLAGS += -fPIC
+AM_CFLAGS += $(fpic_CFLAGS)
AM_CPPFLAGS += -I$(srcdir)/../libelf
noinst_LIBRARIES = libeu.a