linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Makefile: add USE_PIE
@ 2024-05-05 13:39 Fabrice Fontaine
  2024-05-05 17:22 ` Paul Menzel
  2024-05-06 14:56 ` Mariusz Tkaczyk
  0 siblings, 2 replies; 7+ messages in thread
From: Fabrice Fontaine @ 2024-05-05 13:39 UTC (permalink / raw)
  To: linux-raid; +Cc: Jes Sorensen, Mariusz Tkaczyk, Fabrice Fontaine

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-07  6:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05 13:39 [PATCH] Makefile: add USE_PIE Fabrice Fontaine
2024-05-05 17:22 ` Paul Menzel
2024-05-05 17:38   ` Fabrice Fontaine
2024-05-05 17:51     ` Paul Menzel
2024-05-06 14:56 ` Mariusz Tkaczyk
2024-05-06 15:54   ` Fabrice Fontaine
2024-05-07  6:46     ` Mariusz Tkaczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).