[U-Boot-Users] [PATCH 1/6] AVR32: Use -g instead of -gstabs in AFLAGS_DEBUG

Haavard Skinnemoen hskinnemoen at atmel.com
Wed Oct 25 14:41:51 CEST 2006


On Tue, 24 Oct 2006 19:44:35 -0500
Matthew McClintock <msm at freescale.com> wrote:

> Commit 2da2d9a4766063b9848f3a35ad6025499cf87265 is causing build
> problems when building the latest MPC8540ADS with the follow tools
> installed:
> 
> $ powerpc-unknown-linux-gnu-as
> 
> [r56630 at cde-tx32-ldt330 u-boot]$ powerpc-unknown-linux-gnu-as  -v
> GNU assembler version 2.15 (powerpc-unknown-linux-gnu) using BFD
> version 2.15

Right. The 2.15 documentation doesn't seem to mention the -g option,
only -g<debug format>.

Wolfgang, please consider applying the patch below to fix this problem.

---

From: Haavard_Skinnemoen <hskinnemoen at atmel.com>
Subject: [PATCH] Use -g in AFLAGS_DEBUG only on AVR32

Commit 2da2d9a4766063b9848f3a35ad6025499cf87265 changed AFLAGS_DEBUG
to use -g instead of -gstabs. It turns out this breaks certain
toolchains; at least binutils 2.15 on ppc and 2.16.1 on ARM, as
reported by Matthew McClintock and Ulf Samuelsson, respectively.

This is arguably a bug in gas, as the man page for gas 2.16.1 states
that the -g option should "generate debugging information for each
assembler source line using whichever debug format is preferred by
the target."

However, the 2.15 documentation says no such thing, so we should
probably stick with using -gstabs for a while longer.

This patch changes config.mk to use -g only when compiling for AVR32
and -gstabs for all other targets.

Signed-off-by: Haavard Skinnemoen <hskinnemoen at atmel.com>
---
 config.mk |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index 46e956f..6408ade 100644
--- a/config.mk
+++ b/config.mk
@@ -169,7 +169,11 @@ CFLAGS := $(CPPFLAGS) -Wall -Wno-trigrap
 endif
 endif
 
+ifeq ($(ARCH),avr32)
 AFLAGS_DEBUG := -Wa,-g
+else
+AFLAGS_DEBUG := -Wa,-gstabs
+endif
 
 # turn jbsr into jsr for m68k
 ifeq ($(ARCH),m68k)
-- 
1.4.1.1





More information about the U-Boot mailing list