[PATCH] Makefile: add USE_PIE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not hardcode -pie and allow the user to drop it (e.g. PIE could be
enabled or disabled by the buildsystem such as buildroot)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@xxxxxxxxx>
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 7c221a89..a5269687 100644
--- a/Makefile
+++ b/Makefile
@@ -137,7 +137,11 @@ LDFLAGS = -Wl,-z,now,-z,noexecstack
 # If you want a static binary, you might uncomment these
 # LDFLAGS += -static
 # STRIP = -s
-LDLIBS = -ldl -pie
+LDLIBS = -ldl
+USE_PIE = 1
+ifdef USE_PIE
+LDLIBS += -pie
+endif
 
 # To explicitly disable libudev, set -DNO_LIBUDEV in CXFLAGS
 ifeq (, $(findstring -DNO_LIBUDEV,  $(CXFLAGS)))
-- 
2.43.0





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux