[linux-yocto] [PATCH 1/1] Makefile: add -grecord-gcc-switches if using -mfentry

Tom Zanussi tom.zanussi at linux.intel.com
Tue Apr 16 09:31:10 PDT 2013


Commit a2546fae [ftrace: Add -mfentry to Makefile on function tracer]
adds support for using -mfentry when possible, whenever the ftrace
CONFIG_FUNCTION_TRACER option is enabled.

This unfortunately causes bogus dwarf debuginfo to be generated:

  gcc Bug 54793 - the location of a formal_parameter is not started from a
                  function entry with -mfentry

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54793

This can be fixed by applying the gcc patch above, which will be
present in gcc-4.8, but in the meantime, the problem is currently
being worked around in different ways by various tools.  One of those
tools that we support in Yocto, Systemtap, requires the DW_AT_producer
string contain -mfentry, which means that it's assuming
record-gcc-switches is also used:

  SystemTap Bug 15123 - workaround for bad debuginfo for -mfentry
  http://sourceware.org/bugzilla/show_bug.cgi?id=15123

The lack of -grecord-gcc-switches and therefore a missing -mfentry
string in Yocto leads to the following Yocto bug:

  Bug 4099 - Crosstap script check fails
  https://bugzilla.yoctoproject.org/show_bug.cgi?id=4099

Which is what this patch intends to fix.

It only affects architectures that HAVE_FENTRY when
CONFIG_FUNCTION_TRACER is turned on and in any case is just adding to
the debuginfo, so there doesn't seem to be much risk to adding it.

Signed-off-by: Tom Zanussi <tom.zanussi at linux.intel.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 61e2c24..c2988a6 100644
--- a/Makefile
+++ b/Makefile
@@ -624,7 +624,7 @@ endif
 
 ifdef CONFIG_FUNCTION_TRACER
 ifdef CONFIG_HAVE_FENTRY
-CC_USING_FENTRY	:= $(call cc-option, -mfentry -DCC_USING_FENTRY)
+CC_USING_FENTRY	:= $(call cc-option, -mfentry -DCC_USING_FENTRY -grecord-gcc-switches)
 endif
 KBUILD_CFLAGS	+= -pg $(CC_USING_FENTRY)
 KBUILD_AFLAGS	+= $(CC_USING_FENTRY)
-- 
1.7.11.4






More information about the linux-yocto mailing list