diff mbox series

[v2] Makefile: Move -pie to LDFLAGS

Message ID 20240507173216.275378-1-fontaine.fabrice@gmail.com (mailing list archive)
State Accepted
Headers show
Series [v2] Makefile: Move -pie to LDFLAGS | expand

Checks

Context Check Description
mdraidci/vmtest-md-6-10-PR fail merge-conflict
mdraidci/vmtest-md-6-10-VM_Test-0 success Logs for Lint
mdraidci/vmtest-md-6-10-VM_Test-5 success Logs for set-matrix
mdraidci/vmtest-md-6-10-VM_Test-1 success Logs for ShellCheck
mdraidci/vmtest-md-6-10-VM_Test-9 fail Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-7 success Logs for x86_64-gcc / build-release
mdraidci/vmtest-md-6-10-VM_Test-3 success Logs for Validate matrix.py
mdraidci/vmtest-md-6-10-VM_Test-4 success Logs for build-kernel
mdraidci/vmtest-md-6-10-VM_Test-10 fail Logs for x86_64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-12 success Logs for x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-6 success Logs for x86_64-gcc / build / build for x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-15 success Logs for x86_64-llvm-17 / build / build for x86_64 with llvm-17
mdraidci/vmtest-md-6-10-VM_Test-14 fail Logs for x86_64-gcc / veristat / veristat on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-21 success Logs for x86_64-llvm-17 / veristat
mdraidci/vmtest-md-6-10-VM_Test-18 fail Logs for x86_64-llvm-17 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-17
mdraidci/vmtest-md-6-10-VM_Test-13 fail Logs for x86_64-gcc / test (test_verifier, false, 360) / test_verifier on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-11 success Logs for x86_64-gcc / test (test_progs_no_alu32_parallel, true, 30) / test_progs_no_alu32_parallel on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-24 fail Logs for x86_64-llvm-18 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-18
mdraidci/vmtest-md-6-10-VM_Test-27 fail Logs for x86_64-llvm-18 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-18
mdraidci/vmtest-md-6-10-VM_Test-19 fail Logs for x86_64-llvm-17 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-17
mdraidci/vmtest-md-6-10-VM_Test-2 success Logs for Unittests
mdraidci/vmtest-md-6-10-VM_Test-16 success Logs for x86_64-llvm-17 / build-release / build for x86_64 with llvm-17 and -O2 optimization
mdraidci/vmtest-md-6-10-VM_Test-25 fail Logs for x86_64-llvm-18 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-18
mdraidci/vmtest-md-6-10-VM_Test-8 fail Logs for x86_64-gcc / test (test_maps, false, 360) / test_maps on x86_64 with gcc
mdraidci/vmtest-md-6-10-VM_Test-20 fail Logs for x86_64-llvm-17 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-17
mdraidci/vmtest-md-6-10-VM_Test-22 success Logs for x86_64-llvm-18 / build / build for x86_64 with llvm-18
mdraidci/vmtest-md-6-10-VM_Test-29 success Logs for x86_64-llvm-18 / veristat
mdraidci/vmtest-md-6-10-VM_Test-26 fail Logs for x86_64-llvm-18 / test (test_progs_cpuv4, false, 360) / test_progs_cpuv4 on x86_64 with llvm-18
mdraidci/vmtest-md-6-10-VM_Test-28 fail Logs for x86_64-llvm-18 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-18
mdraidci/vmtest-md-6-10-VM_Test-23 success Logs for x86_64-llvm-18 / build-release / build for x86_64 with llvm-18 and -O2 optimization
mdraidci/vmtest-md-6-10-VM_Test-17 fail Logs for x86_64-llvm-17 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-17

Commit Message

Fabrice Fontaine May 7, 2024, 5:32 p.m. UTC
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(-)

Comments

Mariusz Tkaczyk May 8, 2024, 10:29 a.m. UTC | #1
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
diff mbox series

Patch

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)))