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