All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
@ 2014-09-01  7:55 Alexey Brodkin
  2014-09-08  5:53 ` Alexey Brodkin
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Brodkin @ 2014-09-01  7:55 UTC (permalink / raw)
  To: buildroot

From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

The gcc.mk file is passing --enable-target-optspace to gcc configure
script, to ask for space-optimized (-Os) target libraries. However,
passing this option has the effect of overriding any custom
CFLAGS_FOR_TARGET or CXXFLAGS_FOR_TARGET values that may be passed.

These are some situations when it is required to pass custom flags on buildong
of libgcc:
 * Default flags "-g -Os" lead to build isses as with PowerPC on gcc 4.5
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810)
 * Particular CPU requires specific instructions for HW support
 * Deep optimizations

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
---

Compared to v3 use "=" instead of ":=" which is not actually required here.

---
 package/gcc/gcc.mk | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index b344a14..4160180 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -107,16 +107,22 @@ HOST_GCC_COMMON_CONF_OPT = \
 HOST_GCC_COMMON_CONF_ENV = \
 	MAKEINFO=missing
 
+GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
+GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810
 # Workaround until it's fixed in 4.5.4 or later
 ifeq ($(ARCH),powerpc)
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
-HOST_GCC_COMMON_CONF_OPT += --disable-target-optspace
+GCC_COMMON_TARGET_CFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CFLAGS))
+GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CXXFLAGS))
 endif
-else
-HOST_GCC_COMMON_CONF_OPT += --enable-target-optspace
 endif
 
+# Propagate options used for target software building to GCC target libs
+HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
+HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
+
 # gcc 4.6.x quadmath requires wchar
 ifneq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
 HOST_GCC_COMMON_CONF_OPT += --disable-libquadmath
-- 
1.9.3

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2014-09-01  7:55 [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace Alexey Brodkin
@ 2014-09-08  5:53 ` Alexey Brodkin
  2014-09-15 13:29   ` Alexey Brodkin
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Brodkin @ 2014-09-08  5:53 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, 2014-09-01 at 11:55 +0400, Alexey Brodkin wrote:
> From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
> 
> The gcc.mk file is passing --enable-target-optspace to gcc configure
> script, to ask for space-optimized (-Os) target libraries. However,
> passing this option has the effect of overriding any custom
> CFLAGS_FOR_TARGET or CXXFLAGS_FOR_TARGET values that may be passed.
> 
> These are some situations when it is required to pass custom flags on buildong
> of libgcc:
>  * Default flags "-g -Os" lead to build isses as with PowerPC on gcc 4.5
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810)
>  * Particular CPU requires specific instructions for HW support
>  * Deep optimizations
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> 
> Cc: Anton Kolesov <akolesov@synopsys.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
> Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
> 
> Compared to v3 use "=" instead of ":=" which is not actually required here.

I'm wondering if this version is fine and we may go ahead an apply it?

Regards,
Alexey

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2014-09-08  5:53 ` Alexey Brodkin
@ 2014-09-15 13:29   ` Alexey Brodkin
  2014-09-23 11:10     ` Alexey Brodkin
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Brodkin @ 2014-09-15 13:29 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, 2014-09-08 at 09:53 +0400, Alexey Brodkin wrote:
> Hi Thomas,
> 
> On Mon, 2014-09-01 at 11:55 +0400, Alexey Brodkin wrote:
> > From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
> > 
> > The gcc.mk file is passing --enable-target-optspace to gcc configure
> > script, to ask for space-optimized (-Os) target libraries. However,
> > passing this option has the effect of overriding any custom
> > CFLAGS_FOR_TARGET or CXXFLAGS_FOR_TARGET values that may be passed.
> > 
> > These are some situations when it is required to pass custom flags on buildong
> > of libgcc:
> >  * Default flags "-g -Os" lead to build isses as with PowerPC on gcc 4.5
> > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810)
> >  * Particular CPU requires specific instructions for HW support
> >  * Deep optimizations
> > 
> > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> > 
> > Cc: Anton Kolesov <akolesov@synopsys.com>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Cc: Peter Korsgaard <peter@korsgaard.com>
> > Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
> > ---
> > 
> > Compared to v3 use "=" instead of ":=" which is not actually required here.
> 
> I'm wondering if this version is fine and we may go ahead an apply it?

Please treat this as a polite reminder about this pending patch.

Regards,
Alexey

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2014-09-15 13:29   ` Alexey Brodkin
@ 2014-09-23 11:10     ` Alexey Brodkin
  2014-09-23 11:19       ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Brodkin @ 2014-09-23 11:10 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, 2014-09-15 at 17:29 +0400, Alexey Brodkin wrote:
> Hi Thomas,
> 
> On Mon, 2014-09-08 at 09:53 +0400, Alexey Brodkin wrote:
> > Hi Thomas,
> > 
> > On Mon, 2014-09-01 at 11:55 +0400, Alexey Brodkin wrote:
> > > From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
> > > 
> > > The gcc.mk file is passing --enable-target-optspace to gcc configure
> > > script, to ask for space-optimized (-Os) target libraries. However,
> > > passing this option has the effect of overriding any custom
> > > CFLAGS_FOR_TARGET or CXXFLAGS_FOR_TARGET values that may be passed.
> > > 
> > > These are some situations when it is required to pass custom flags on buildong
> > > of libgcc:
> > >  * Default flags "-g -Os" lead to build isses as with PowerPC on gcc 4.5
> > > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810)
> > >  * Particular CPU requires specific instructions for HW support
> > >  * Deep optimizations
> > > 
> > > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> > > 
> > > Cc: Anton Kolesov <akolesov@synopsys.com>
> > > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > > Cc: Peter Korsgaard <peter@korsgaard.com>
> > > Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
> > > ---
> > > 
> > > Compared to v3 use "=" instead of ":=" which is not actually required here.
> > 
> > I'm wondering if this version is fine and we may go ahead an apply it?
> 
> Please treat this as a polite reminder about this pending patch.

Any chance for this change to made its way into upstream Buildroot?

-Alexey

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2014-09-23 11:10     ` Alexey Brodkin
@ 2014-09-23 11:19       ` Thomas Petazzoni
  2014-09-23 11:24         ` Alexey Brodkin
  2015-04-21 13:43         ` Alexey Brodkin
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2014-09-23 11:19 UTC (permalink / raw)
  To: buildroot

Dear Alexey Brodkin,

On Tue, 23 Sep 2014 11:10:16 +0000, Alexey Brodkin wrote:

> > > I'm wondering if this version is fine and we may go ahead an apply it?
> > 
> > Please treat this as a polite reminder about this pending patch.
> 
> Any chance for this change to made its way into upstream Buildroot?

Yes. Please give us some time to test it before applying it. It's
touching a fairly sensitive area, so we don't apply such patches
lightly.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2014-09-23 11:19       ` Thomas Petazzoni
@ 2014-09-23 11:24         ` Alexey Brodkin
  2015-04-21 13:43         ` Alexey Brodkin
  1 sibling, 0 replies; 9+ messages in thread
From: Alexey Brodkin @ 2014-09-23 11:24 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Tue, 2014-09-23 at 13:19 +0200, Thomas Petazzoni wrote:
> Dear Alexey Brodkin,
> 
> On Tue, 23 Sep 2014 11:10:16 +0000, Alexey Brodkin wrote:
> 
> > > > I'm wondering if this version is fine and we may go ahead an apply it?
> > > 
> > > Please treat this as a polite reminder about this pending patch.
> > 
> > Any chance for this change to made its way into upstream Buildroot?
> 
> Yes. Please give us some time to test it before applying it. It's
> touching a fairly sensitive area, so we don't apply such patches
> lightly.

Sure, I completely understand and support your comment.
I just want to make sure this change is not lost and in one or other
form is applied.

This change is important for us because allows us to build entire target
binaries in consistency, otherwise with inconsistent binaries in some
corner cases there happen error on linkage of libgcc and other software
like busybox etc.

Personally I did build tests this patch for ARC, ARM and PPC (with GCC
4.5), essentially run-time test was only done on ARC because this is the
only HW I had handy.

-Alexey

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2014-09-23 11:19       ` Thomas Petazzoni
  2014-09-23 11:24         ` Alexey Brodkin
@ 2015-04-21 13:43         ` Alexey Brodkin
  2015-04-21 16:25           ` Baruch Siach
  1 sibling, 1 reply; 9+ messages in thread
From: Alexey Brodkin @ 2015-04-21 13:43 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Tue, 2014-09-23 at 13:19 +0200, Thomas Petazzoni wrote:
> Dear Alexey Brodkin,
> 
> On Tue, 23 Sep 2014 11:10:16 +0000, Alexey Brodkin wrote:
> 
> > > > I'm wondering if this version is fine and we may go ahead an apply it?
> > > 
> > > Please treat this as a polite reminder about this pending patch.
> > 
> > Any chance for this change to made its way into upstream Buildroot?
> 
> Yes. Please give us some time to test it before applying it. It's
> touching a fairly sensitive area, so we don't apply such patches
> lightly.
> 
> Best regards,
> 
> Thomas

I just got a reminder on my pending patches in Buildroot so I'm updating
that one.

This v4 patch should be dropped because it is now superseded with v5
(http://patchwork.ozlabs.org/patch/453849/) which in its turn is just a
rebase of v4 on top of more up to date master.

-Alexey

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2015-04-21 13:43         ` Alexey Brodkin
@ 2015-04-21 16:25           ` Baruch Siach
  2015-04-21 17:04             ` Alexey Brodkin
  0 siblings, 1 reply; 9+ messages in thread
From: Baruch Siach @ 2015-04-21 16:25 UTC (permalink / raw)
  To: buildroot

Hi Alexey,

On Tue, Apr 21, 2015 at 01:43:53PM +0000, Alexey Brodkin wrote:
> I just got a reminder on my pending patches in Buildroot so I'm updating
> that one.
> 
> This v4 patch should be dropped because it is now superseded with v5
> (http://patchwork.ozlabs.org/patch/453849/) which in its turn is just a
> rebase of v4 on top of more up to date master.

Please mark this patch as "Superseded" in Buildroot's patchwork, then.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
  2015-04-21 16:25           ` Baruch Siach
@ 2015-04-21 17:04             ` Alexey Brodkin
  0 siblings, 0 replies; 9+ messages in thread
From: Alexey Brodkin @ 2015-04-21 17:04 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

On Tue, 2015-04-21 at 19:25 +0300, Baruch Siach wrote:
> Hi Alexey,
> 
> On Tue, Apr 21, 2015 at 01:43:53PM +0000, Alexey Brodkin wrote:
> > I just got a reminder on my pending patches in Buildroot so I'm updating
> > that one.
> > 
> > This v4 patch should be dropped because it is now superseded with v5
> > (http://patchwork.ozlabs.org/patch/453849/) which in its turn is just a
> > rebase of v4 on top of more up to date master.
> 
> Please mark this patch as "Superseded" in Buildroot's patchwork, then.

Already done. Made it before sending my previous email.

-Alexey

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

end of thread, other threads:[~2015-04-21 17:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01  7:55 [Buildroot] [PATCH v4] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace Alexey Brodkin
2014-09-08  5:53 ` Alexey Brodkin
2014-09-15 13:29   ` Alexey Brodkin
2014-09-23 11:10     ` Alexey Brodkin
2014-09-23 11:19       ` Thomas Petazzoni
2014-09-23 11:24         ` Alexey Brodkin
2015-04-21 13:43         ` Alexey Brodkin
2015-04-21 16:25           ` Baruch Siach
2015-04-21 17:04             ` Alexey Brodkin

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.