All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS
@ 2013-09-11 12:53 Gustavo Zacarias
  2013-09-11 13:40 ` Thomas Petazzoni
  2013-09-12 22:12 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo Zacarias @ 2013-09-11 12:53 UTC (permalink / raw)
  To: buildroot

When building for nommu flat targets the CFLAGS/CXXFLAGS/LDFLAGS must be
adjusted accordingly.
For gcc this means passing along -Wl,-elf2flt to signal the linker.
For ld this means -elf2flt.

Also correct the error in STACKSIZE settings from commit 9edf482d which
is setting gcc flags as ld flags and will surely fail (no package uses
it at the moment so it was never seen).

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/Makefile.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 91ae1b9..dd365be 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -115,7 +115,11 @@ 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))
+TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
+	-Wl$(comma)-elf2flt)
+TARGET_CXXFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
+	-Wl$(comma)-elf2flt)
+TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),-elf2flt)
 endif
 
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS
  2013-09-11 12:53 [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS Gustavo Zacarias
@ 2013-09-11 13:40 ` Thomas Petazzoni
  2013-09-11 13:41   ` Gustavo Zacarias
  2013-09-12 22:12 ` Peter Korsgaard
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2013-09-11 13:40 UTC (permalink / raw)
  To: buildroot

Dear Gustavo Zacarias,

On Wed, 11 Sep 2013 09:53:44 -0300, Gustavo Zacarias wrote:

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

Nitpicking, can't this be written:

TARGET_CFLAGS += -Wl$(comma)-elf2flt$(if $($(PKG)_FLAT_STACKSIZE),=-s$($(PKG)_FLAT_STACKSIZE))

not sure if it's more readable though.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS
  2013-09-11 13:40 ` Thomas Petazzoni
@ 2013-09-11 13:41   ` Gustavo Zacarias
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo Zacarias @ 2013-09-11 13:41 UTC (permalink / raw)
  To: buildroot

On 09/11/2013 10:40 AM, Thomas Petazzoni wrote:

> Dear Gustavo Zacarias,
> 
> On Wed, 11 Sep 2013 09:53:44 -0300, Gustavo Zacarias wrote:
> 
>>  ifeq ($(BR2_BINFMT_FLAT),y)
>> +TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
>> +	-Wl$(comma)-elf2flt)
> 
> Nitpicking, can't this be written:
> 
> TARGET_CFLAGS += -Wl$(comma)-elf2flt$(if $($(PKG)_FLAT_STACKSIZE),=-s$($(PKG)_FLAT_STACKSIZE))
> 
> not sure if it's more readable though.

Yes very likely, but i went for readable :)
If the FLAT support is extended there may be other options appended
there and separate clauses will be likely/better to avoid duplication
and general uglyness.
Regards.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS
  2013-09-11 12:53 [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS Gustavo Zacarias
  2013-09-11 13:40 ` Thomas Petazzoni
@ 2013-09-12 22:12 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2013-09-12 22:12 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 Gustavo> When building for nommu flat targets the CFLAGS/CXXFLAGS/LDFLAGS must be
 Gustavo> adjusted accordingly.
 Gustavo> For gcc this means passing along -Wl,-elf2flt to signal the linker.
 Gustavo> For ld this means -elf2flt.

 Gustavo> Also correct the error in STACKSIZE settings from commit 9edf482d which
 Gustavo> is setting gcc flags as ld flags and will surely fail (no package uses
 Gustavo> it at the moment so it was never seen).

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-12 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 12:53 [Buildroot] [PATCH] nommu/flat: build packages with the correct FLAGS Gustavo Zacarias
2013-09-11 13:40 ` Thomas Petazzoni
2013-09-11 13:41   ` Gustavo Zacarias
2013-09-12 22:12 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.