summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-08-25 20:04:48 +0200
committerDavid Sterba <dsterba@suse.com>2017-09-08 16:15:05 +0200
commit339019c93455ad8331e057e471d2c1ae6638e25d (patch)
tree9fb9aadcc6548078c3eb6b3b9c250bb013032255
parent092698b40ac77d181c51d6aa020a03f9b164069b (diff)
btrfs-progs: build: add internal LDFLAGS for the D= features
We might want to pass additional linker flags for various sanitization features. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 358b236c..f196198c 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,10 @@ DEBUG_CFLAGS_DEFAULT = -O0 -U_FORTIFY_SOURCE -ggdb3
DEBUG_CFLAGS_INTERNAL =
DEBUG_CFLAGS :=
+DEBUG_LDFLAGS_DEFAULT =
+DEBUG_LDFLAGS_INTERNAL =
+DEBUG_LDFLAGS :=
+
TOPDIR := $(shell pwd)
# Common build flags
@@ -72,7 +76,9 @@ CFLAGS = $(SUBST_CFLAGS) \
$(EXTRA_CFLAGS)
LDFLAGS = $(SUBST_LDFLAGS) \
- -rdynamic -L$(TOPDIR) $(EXTRA_LDFLAGS)
+ -rdynamic -L$(TOPDIR) \
+ $(DEBUG_LDFLAGS_INTERNAL) \
+ $(EXTRA_LDFLAGS)
LIBS = $(LIBS_BASE)
LIBBTRFS_LIBS = $(LIBS_BASE)
@@ -135,6 +141,7 @@ endif
ifeq ("$(origin D)", "command line")
DEBUG_CFLAGS_INTERNAL = $(DEBUG_CFLAGS_DEFAULT) $(DEBUG_CFLAGS)
+ DEBUG_LDFLAGS_INTERNAL = $(DEBUG_LDFLAGS_DEFAULT) $(DEBUG_LDFLAGS)
endif
ifneq (,$(findstring verbose,$(D)))