From 3e023b19f8486e8201a882db725ec9ca6fbc5dd9 Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 27 Dec 2022 17:33:32 -0800 Subject: [PATCH] btrfs-progs: build: static should pick up EXTRA_LDFLAGS and SUBST_LDFLAGS Concrete use-case: - I want a static build to run in a small test VM. - RedHat regrettably does not provide util-linux static libraries - like libuuid.a and libblkid.a. - So, one has to build them from source. - Installing these to /usr is lame. - This change lets me do make btrfs.static EXTRA_LDFLAGS=-L/path/to/util-linux-2.38/.libs Pull-request: #563 Author: Alexey Signed-off-by: David Sterba --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0da0b553..29015fc7 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,7 @@ LIBBTRFS_LIBS = $(LIBS_BASE) $(LIBS_CRYPTO) # Static compilation flags STATIC_CFLAGS = $(CFLAGS) -ffunction-sections -fdata-sections -DSTATIC_BUILD -STATIC_LDFLAGS = -static -Wl,--gc-sections +STATIC_LDFLAGS = $(SUBST_LDFLAGS) $(EXTRA_LDFLAGS) -static -Wl,--gc-sections STATIC_LIBS = $(STATIC_LIBS_BASE) # don't use FORTIFY with sparse because glibc with FORTIFY can