summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2014-09-18 18:14:21 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2014-09-18 18:14:21 +0200
commitb72e9d3a933fd72eb4c08f13f5a3d3a7259a7741 (patch)
tree5b266e8361299149585f383f31092f2a700e8c77
parentd450c7fb102652985a7271f3ea76ed72235060e7 (diff)
downloadlvm2-b72e9d3a933fd72eb4c08f13f5a3d3a7259a7741.tar.gz
makefiles: fix linking of PIE code
PIE documentation: : https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html http://lfs.osuosl.org/hlfs/view/unstable/glibc/chapter02/pie.html suggest to suply -fPIE (or -fpie) with -pie during executable compilation. When -fPIC and -fPIE are used together - -fPIE wins Drop usage of -DPIE - we are not using this flag anywhere TODO: cleanup linking flags
-rw-r--r--make.tmpl.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/make.tmpl.in b/make.tmpl.in
index 7a178ad02..7efe46b9c 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -158,8 +158,8 @@ endif
ifneq ("@STATIC_LINK@", "yes")
ifeq ("@HAVE_PIE@", "yes")
ifeq ("@HAVE_FULL_RELRO@", "yes")
- EXTRA_EXEC_CFLAGS += -fPIE -DPIE
- EXTRA_EXEC_LDFLAGS += -Wl,-z,relro,-z,now -pie
+ EXTRA_EXEC_CFLAGS += -fPIE
+ EXTRA_EXEC_LDFLAGS += -Wl,-z,relro,-z,now -pie -fPIE
CLDFLAGS += -Wl,-z,relro
endif
endif