blob: 59c96f51ba1b3753461a17378c2cb53f932dc064 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 893a55831e5abbcd15b171db66fa1f389fb61506 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Tue, 7 May 2024 19:32:16 +0200
4Subject: Makefile: Move -pie to LDFLAGS
5
6Move -pie from LDLIBS to LDFLAGS and make LDFLAGS configurable to allow
7the user to drop it by setting their own LDFLAGS (e.g. PIE could be
8enabled or disabled by the buildsystem such as buildroot).
9
10Suggested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
11Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
12Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
13---
14 Makefile | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17--- a/Makefile
18+++ b/Makefile
19@@ -132,12 +132,12 @@ CFLAGS += -DUSE_PTHREADS
20 MON_LDFLAGS += -pthread
21 endif
22
23-LDFLAGS = -Wl,-z,now,-z,noexecstack
24+LDFLAGS ?= -pie -Wl,-z,now,-z,noexecstack
25
26 # If you want a static binary, you might uncomment these
27 # LDFLAGS += -static
28 # STRIP = -s
29-LDLIBS = -ldl -pie
30+LDLIBS = -ldl
31
32 # To explicitly disable libudev, set -DNO_LIBUDEV in CXFLAGS
33 ifeq (, $(findstring -DNO_LIBUDEV, $(CXFLAGS)))