diff options
author | Mingli Yu <Mingli.Yu@windriver.com> | 2019-04-22 16:41:32 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-23 23:30:19 +0100 |
commit | b9b57a52ed93237de414ef100357ed0a1dc6b434 (patch) | |
tree | 1dfbb0d913c2e6b235fd0924dd9f868958a310e2 | |
parent | 0ad9bbaf9dc26848d8a0e8036129c3e7449c22bc (diff) | |
download | poky-b9b57a52ed93237de414ef100357ed0a1dc6b434.tar.gz |
gcc-sanitizers: fix -Werror=maybe-uninitialized issue
When DEBUG_BUILD = "1" added in local.conf, there
comes below build error when "bitbake gcc-sanitizers":
| ./../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c: In function 'elf_is_symlink':
| ../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
| return S_ISLNK (st.st_mode);
After commit[16643b0322 bitbake.conf: Use -Og in DEBUG_OPTIMIZATION]
introduced, "-Og" added to compiler when debug
build enabled.
Per https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00315.html,
the gcc upstream thinks the warning is a false
positive and suggests to use -O2 rather than -Og
or -O1 when compiling that file, so pass -Wno-error
to compiler when -Og is used to silence the error.
(From OE-Core rev: d8d657f082d4a86f93ce810e5d99eb5c93333d8a)
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-sanitizers.inc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc index e5e84526fa..8b1d1c94bf 100644 --- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc +++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc | |||
@@ -45,6 +45,9 @@ INHIBIT_DEFAULT_DEPS = "1" | |||
45 | ALLOW_EMPTY_${PN} = "1" | 45 | ALLOW_EMPTY_${PN} = "1" |
46 | DEPENDS = "gcc-runtime virtual/${TARGET_PREFIX}gcc" | 46 | DEPENDS = "gcc-runtime virtual/${TARGET_PREFIX}gcc" |
47 | 47 | ||
48 | # used to fix ../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
49 | DEBUG_OPTIMIZATION_append = " -Wno-error" | ||
50 | |||
48 | BBCLASSEXTEND = "nativesdk" | 51 | BBCLASSEXTEND = "nativesdk" |
49 | 52 | ||
50 | PACKAGES = "${PN} ${PN}-dbg" | 53 | PACKAGES = "${PN} ${PN}-dbg" |