X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fmtd-utils%2Fpatches%2F310-add-static-linking-option.patch;fp=tools%2Fmtd-utils%2Fpatches%2F310-add-static-linking-option.patch;h=273aa85e146fc10faf22c94a98cd1dced21868bc;hb=63cee1cf68047d3063c2d986f76d447d4e0c4083;hp=0000000000000000000000000000000000000000;hpb=42f39be86e5d45c4adf3c5673dc62a87881dce8e;p=openwrt-github%2F.git diff --git a/tools/mtd-utils/patches/310-add-static-linking-option.patch b/tools/mtd-utils/patches/310-add-static-linking-option.patch new file mode 100644 index 0000000000..273aa85e14 --- /dev/null +++ b/tools/mtd-utils/patches/310-add-static-linking-option.patch @@ -0,0 +1,23 @@ +--- a/common.mk ++++ b/common.mk +@@ -2,6 +2,11 @@ CC := $(CROSS)gcc + AR := $(CROSS)ar + RANLIB := $(CROSS)ranlib + ++ifeq ($(STATIC),1) ++ LD_STATIC_ON := -Wl,-Bstatic ++ LD_STATIC_OFF := -Wl,-Bdynamic ++endif ++ + # Stolen from Linux build system + comma = , + try-run = $(shell set -e; ($(1)) >/dev/null 2>&1 && echo "$(2)" || echo "$(3)") +@@ -68,7 +73,7 @@ endef + + %: %.o $(LDDEPS) + $(call BECHO,LD) +- $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_$(notdir $@)) -g -o $@ $^ $(LDLIBS) $(LDLIBS_$(notdir $@)) ++ $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_$(notdir $@)) -g -o $@ $(LD_STATIC_ON) $^ $(LDLIBS) $(LDLIBS_$(notdir $@)) $(LD_STATIC_OFF) + + $(BUILDDIR)/%.a: + $(call BECHO,AR)