2
0

050-pie.patch 1.1 KB

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