[CRIU] [PATCH] Ensure LDFLAGS is passed to CC not LD.

Chris J Arges chris.j.arges at canonical.com
Wed Jun 25 12:52:31 PDT 2014


If we build with something like:
make LDFLAGS="-Wl,-Bsymbolic-functions"

We'll get an error because the LDFLAGS are being passed to LD when they
should be pased to CC.

Signed-off-by: Chris J Arges <chris.j.arges at canonical.com>
---
 scripts/Makefile.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 5ea61b7..ad0b245 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -172,7 +172,7 @@ $(1)-all-objs += $(all-objs)
 
 $$(obj)/$(1).built-in.o: $$($(1)-all-objs) $$($(1)-libs-e) $(libs-e)
 	$$(E) "  LINK    " $$@
-	$$(Q) $$(LD) $$(LDFLAGS) -r -o $$@ $$^
+	$$(Q) $$(LD) -r -o $$@ $$^
 
 _all += $$(obj)/$(1).built-in.o
 cleanup-y += $$(obj)/$(1).built-in.o
@@ -193,7 +193,7 @@ ifeq ($(targets),)
 ifneq ($(all-objs),)
 $(obj)/built-in.o: $(all-objs) $(libs-e)
 	$(E) "  LINK    " $@
-	$(Q) $(LD) $(LDFLAGS) -r -o $@ $^
+	$(Q) $(LD) -r -o $@ $^
 
 _all += $(obj)/built-in.o
 cleanup-y += $(obj)/built-in.o
@@ -205,7 +205,7 @@ endif
 ifneq ($(lib-so),)
 $(obj)/$(lib-so).so: $(all-objs) $(libs-e)
 	$(E) "  LINK    " $@
-	$(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so)
+	$(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
 
 _all += $(obj)/$(lib-so).so
 cleanup-y += $(obj)/$(lib-so).so
-- 
1.9.1



More information about the CRIU mailing list