From 1655eb2ec8823e3c7e2cbe383bf368a4d8e6d9a0 Mon Sep 17 00:00:00 2001 From: Fabio Scotoni <34964387+fscoto@users.noreply.github.com> Date: Thu, 12 Dec 2019 09:48:36 +0100 Subject: [PATCH] makefile: Honor LDFLAGS variable if given This allows specifying e.g. hardening options like -Wl,-z,relro for link-time options. It *is* normally possible to add these to CFLAGS, but LDFLAGS is the established way to do this and tooling expects it to work. See also POSIX on make(1), whose default rules use LDFLAGS. --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index bb25830..b17092e 100644 --- a/makefile +++ b/makefile @@ -100,7 +100,7 @@ lib/libmonocypher.so: lib/$(SONAME) ln -sf `basename $<` $@ lib/$(SONAME): lib/monocypher.o $(LINK_ED25519) @mkdir -p $(@D) - $(CC) $(CFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ + $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ lib/monocypher-ed25519.o: src/optional/monocypher-ed25519.c \ src/optional/monocypher-ed25519.h lib/chacha20.o : src/deprecated/chacha20.c src/deprecated/chacha20.h -- 2.47.3