linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Makefile: Move -pie to LDFLAGS
@ 2024-05-07 17:32 Fabrice Fontaine
  2024-05-08 10:29 ` Mariusz Tkaczyk
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2024-05-07 17:32 UTC (permalink / raw)
  To: linux-raid; +Cc: Jes Sorensen, Mariusz Tkaczyk, Fabrice Fontaine

Move -pie from LDLIBS to LDFLAGS and make LDFLAGS configurable to allow
the user to drop it by setting their own LDFLAGS (e.g. PIE could be
enabled or disabled by the buildsystem such as buildroot).

Suggested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7c221a89..adac7905 100644
--- a/Makefile
+++ b/Makefile
@@ -132,12 +132,12 @@ CFLAGS += -DUSE_PTHREADS
 MON_LDFLAGS += -pthread
 endif
 
-LDFLAGS = -Wl,-z,now,-z,noexecstack
+LDFLAGS ?= -pie -Wl,-z,now,-z,noexecstack
 
 # If you want a static binary, you might uncomment these
 # LDFLAGS += -static
 # STRIP = -s
-LDLIBS = -ldl -pie
+LDLIBS = -ldl
 
 # To explicitly disable libudev, set -DNO_LIBUDEV in CXFLAGS
 ifeq (, $(findstring -DNO_LIBUDEV,  $(CXFLAGS)))
-- 
2.43.0


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

* Re: [PATCH v2] Makefile: Move -pie to LDFLAGS
  2024-05-07 17:32 [PATCH v2] Makefile: Move -pie to LDFLAGS Fabrice Fontaine
@ 2024-05-08 10:29 ` Mariusz Tkaczyk
  0 siblings, 0 replies; 2+ messages in thread
From: Mariusz Tkaczyk @ 2024-05-08 10:29 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: linux-raid, Jes Sorensen

On Tue,  7 May 2024 19:32:16 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Move -pie from LDLIBS to LDFLAGS and make LDFLAGS configurable to allow
> the user to drop it by setting their own LDFLAGS (e.g. PIE could be
> enabled or disabled by the buildsystem such as buildroot).
> 
> Suggested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---

We did compilation testing:
https://github.com/md-raid-utilities/mdadm/pull/5
Looks good. Applied!

Thanks,
Mariusz

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

end of thread, other threads:[~2024-05-08 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 17:32 [PATCH v2] Makefile: Move -pie to LDFLAGS Fabrice Fontaine
2024-05-08 10:29 ` 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).