Patchwork [v5,5/7] package: Introduce package-specific BINFMT_FLAT options.

login
register
mail settings
Submitter Sonic Zhang
Date April 12, 2013, 10:18 a.m.
Message ID <1365761909-15305-5-git-send-email-sonic.adi@gmail.com>
Download mbox | patch
Permalink /patch/236020/
State Accepted
Commit 9edf482d6b210d16a22fdf561da2a2f0fb84824d
Headers show

Comments

Sonic Zhang - April 12, 2013, 10:18 a.m.
From: Sonic Zhang <sonic.zhang@analog.com>

Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v4-change:
- Use late binding in make to expand package specific flat stack size
to TARGET_LDFLAGS.

v2-changes:
- Fix typo error in macro BINFMT_FLAT
---
 package/Makefile.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Thomas Petazzoni - April 16, 2013, 9:31 p.m.
Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:27 +0800, Sonic Zhang wrote:

> +ifeq ($(BR2_BINFMT_FLAT),y)
> +TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
> +endif

I haven't tested this, but it follows Arnout suggestion, and I find it
quite nice. It just lacks some documentation update, but I'm otherwise
fine with this patch.

Thomas

Patch

diff --git a/package/Makefile.in b/package/Makefile.in
index dd3bc7d..a449089 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -103,6 +103,10 @@  TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET
 TARGET_CXXFLAGS = $(TARGET_CFLAGS)
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
+ifeq ($(BR2_BINFMT_FLAT),y)
+TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
+endif
+
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
 TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0
 TARGET_CFLAGS += -mid-shared-library -mshared-library-id=0