* [Buildroot] [PATCH v5] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
@ 2015-03-24 13:55 Alexey Brodkin
2015-04-21 13:49 ` Alexey Brodkin
2015-07-22 21:21 ` Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Alexey Brodkin @ 2015-03-24 13:55 UTC (permalink / raw)
To: buildroot
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.
Compared to v4 simply rebased on top of today's master
---
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 b5d2ddb..7086969 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -100,16 +100,22 @@ HOST_GCC_COMMON_CONF_OPTS = \
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_OPTS += --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_OPTS += --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)"
+
# libitm needs sparc V9+
ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
HOST_GCC_COMMON_CONF_OPTS += --disable-libitm
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Buildroot] [PATCH v5] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
2015-03-24 13:55 [Buildroot] [PATCH v5] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace Alexey Brodkin
@ 2015-04-21 13:49 ` Alexey Brodkin
2015-07-22 21:21 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Alexey Brodkin @ 2015-04-21 13:49 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Tue, 2015-03-24 at 16:55 +0300, Alexey Brodkin wrote:
> 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.
> Compared to v4 simply rebased on top of today's master
> ---
I just got a reminder about my pending Buildroot patches.
I'm still interested in that patch. We had a long discussion of that
change in the past and keeping in mind importance of the item (libgcc)
it indeed requires careful testing etc.
But maybe if we're OK with the change patch introduces we may try to
apply it and see how many problems autobuilder will produce with it.
-Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread* [Buildroot] [PATCH v5] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace
2015-03-24 13:55 [Buildroot] [PATCH v5] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace Alexey Brodkin
2015-04-21 13:49 ` Alexey Brodkin
@ 2015-07-22 21:21 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2015-07-22 21:21 UTC (permalink / raw)
To: buildroot
Dear Alexey Brodkin,
On Tue, 24 Mar 2015 16:55:15 +0300, Alexey Brodkin wrote:
> 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.
> Compared to v4 simply rebased on top of today's master
> ---
> package/gcc/gcc.mk | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-22 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 13:55 [Buildroot] [PATCH v5] gcc: explicitly use C{XX}FLAGS_FOR_TARGET instead of --enable-target-optspace Alexey Brodkin
2015-04-21 13:49 ` Alexey Brodkin
2015-07-22 21:21 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox