diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-09-14 14:51:07 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-09-14 14:51:07 +0000 |
commit | cf77766e64dfba8c72906edc3fdedaf71684ebc1 (patch) | |
tree | 35f5d7830942af7d275b7f333ba4d180d93b90de /tools/mtd-utils/patches | |
parent | b4e49ad8f0c75f2c3f22e6bc8a8c1af7fddff258 (diff) | |
download | upstream-cf77766e64dfba8c72906edc3fdedaf71684ebc1.tar.gz upstream-cf77766e64dfba8c72906edc3fdedaf71684ebc1.tar.bz2 upstream-cf77766e64dfba8c72906edc3fdedaf71684ebc1.zip |
tools/mtd-utils: prefer static linking
- Add patch for optional static linking preference
- Prefer static linking on Linux systems
- Enable verbose compiler messages when building with V=c
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 46908
Diffstat (limited to 'tools/mtd-utils/patches')
-rw-r--r-- | tools/mtd-utils/patches/310-add-static-linking-option.patch | 23 |
1 files changed, 23 insertions, 0 deletions
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) |