]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Makefile: Move -pie to LDFLAGS main master
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Tue, 7 May 2024 17:32:16 +0000 (19:32 +0200)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Wed, 8 May 2024 10:27:44 +0000 (12:27 +0200)
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>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Makefile

index 7c221a891181fbf85e81514272ba3ef3c6afc32d..adac7905ab576fce4a072b9a074184495f239309 100644 (file)
--- 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)))