[OE-core] [PATCH 2/4] base/bbclass: disallow appending the compile options in debugging info
Hongxu Jia
hongxu.jia at windriver.com
Wed Jan 27 08:45:16 UTC 2016
In order to drop TMPDIR in debugging info, add option '-gno-record-gcc-switches'
to disallow appending the compile options to the DW_AT_producer attribute in
DWARF debugging information.
Compile with '-fdebug-prefix-map':
objdump -g packages-split/lib32-glibc-dev/usr/lib/gcrt1.o
...
| <0><5e>: Abbrev Number: 1 (DW_TAG_compile_unit)
| <5f> DW_AT_producer : (indirect string, offset: 0xbb): GNU C99 5.3.0 -m32
-march=core2 -mtune=core2 -msse3 -mfpmath=sse -mpreferred-stack-boundary=4 -g -O2
-std=gnu99 -fgnu89-inline -fdebug-prefix-map=/buildarea/raid0/hjia/build-20160119-
yocto-buildpath/tmp/work/core2-32-pokymllib32-linux/lib32-glibc/2.22-r0/git=/usr/src/glibc
-feliminate-unused-debug-types -fmerge-all-constants -frounding-math -ftls-model=initial-exec
| <64> DW_AT_name : (indirect string, offset: 0xb9): init.c
| <68> DW_AT_comp_dir : (indirect string, offset: 0x60): /usr/src/glibc/csu
...
Compile with '-gno-record-gcc-switches' and '-fdebug-prefix-map':
objdump -g packages-split/lib32-glibc-dev/usr/lib/gcrt1.o
...
| <5f> DW_AT_producer : (indirect string, offset: 0x1b): GNU C99 5.3.0
| <64> DW_AT_name : (indirect string, offset: 0xb9): init.c
| <68> DW_AT_comp_dir : (indirect string, offset: 0x6e): /usr/src/glibc/csu
...
[YOCTO #7058]
Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
meta/classes/base.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 3159587..e05552c 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -91,6 +91,7 @@ def debug_prefix_map(d):
buildsrc = d.getVar("S", True)
targetsrc = "/usr/src/%s" % d.getVar("BPN", True)
opts += " -fdebug-prefix-map=%s=%s" % (buildsrc, targetsrc)
+ opts += " -gno-record-gcc-switches"
return opts
TARGET_CFLAGS += "${@debug_prefix_map(d)}"
--
1.9.1
More information about the Openembedded-core
mailing list