Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] dante: fix build on some PowerPC platforms
@ 2016-08-08 12:02 Thomas Petazzoni
  2016-08-09 13:50 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-08 12:02 UTC (permalink / raw)
  To: buildroot

The dante configure script has some logic to remove the -g flag from
CFLAGS, but this logic is flawed and also removed -g in
-mfloat-gprs=double, turning it into the invalid -mfloatprs=double,
causing a build failure.

This commit adds a patch that gets rid of this -g removal logic, since
it is in fact unnecessary.

Fixes:

  http://autobuild.buildroot.net/results/313370bf05efe7fd87c281a97ecb6e06531a87ed/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0002-compiler.m4-do-not-remove-g-flag.patch    | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/dante/0002-compiler.m4-do-not-remove-g-flag.patch

diff --git a/package/dante/0002-compiler.m4-do-not-remove-g-flag.patch b/package/dante/0002-compiler.m4-do-not-remove-g-flag.patch
new file mode 100644
index 0000000..0b41de6
--- /dev/null
+++ b/package/dante/0002-compiler.m4-do-not-remove-g-flag.patch
@@ -0,0 +1,42 @@
+From c00e284dd2baa5ecdb0c9586044399cd7cacce3e Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 8 Aug 2016 12:31:40 +0200
+Subject: [PATCH] compiler.m4: do not remove -g flag
+
+A sed expression such as 's/-g//' not only removes the -g
+debugging-related flag, but also turns more specific flags such as
+-mfloat-gprs=double into -mfloatprs=double, which is no longer a valid
+flag.
+
+However, it turns out that removing -g is not necessary: having -g0
+after -g negates the -g, and having -ggdb after -g is enough to produce
+debugging information for GDB.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ compiler.m4 | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/compiler.m4 b/compiler.m4
+index 3a23406..621372c 100644
+--- a/compiler.m4
++++ b/compiler.m4
+@@ -378,15 +378,9 @@ else
+ 	gcc)
+ 	    if test x"$aixldbug" != x; then
+ 	        #disable debug info
+-		if echo $CFLAGS | grep -- "-g" >/dev/null; then
+-		    CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'`"
+-		fi
+ 		CFLAGS="$CFLAGS${CFLAGS:+ }-g0"
+ 	    else
+ 		#use -ggdb also when not debugging
+-		if echo $CFLAGS | grep -- "-g" >/dev/null; then
+-		    CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'`"
+-		fi
+ 		CFLAGS="$CFLAGS${CFLAGS:+ }-ggdb"
+ 	    fi
+ 	    ;;
+-- 
+2.7.4
+
-- 
2.7.4

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

* [Buildroot] [PATCH] dante: fix build on some PowerPC platforms
  2016-08-08 12:02 [Buildroot] [PATCH] dante: fix build on some PowerPC platforms Thomas Petazzoni
@ 2016-08-09 13:50 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-09 13:50 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon,  8 Aug 2016 14:02:56 +0200, Thomas Petazzoni wrote:
> The dante configure script has some logic to remove the -g flag from
> CFLAGS, but this logic is flawed and also removed -g in
> -mfloat-gprs=double, turning it into the invalid -mfloatprs=double,
> causing a build failure.
> 
> This commit adds a patch that gets rid of this -g removal logic, since
> it is in fact unnecessary.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/313370bf05efe7fd87c281a97ecb6e06531a87ed/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  .../0002-compiler.m4-do-not-remove-g-flag.patch    | 42 ++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 package/dante/0002-compiler.m4-do-not-remove-g-flag.patch

Applied to master, thanks.

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

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

end of thread, other threads:[~2016-08-09 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08 12:02 [Buildroot] [PATCH] dante: fix build on some PowerPC platforms Thomas Petazzoni
2016-08-09 13:50 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox