[oe-commits] [openembedded-core] 02/33: gcc-sanitizers: fix -Werror=maybe-uninitialized issue

git at git.openembedded.org git at git.openembedded.org
Tue Apr 23 22:39:33 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit d8d657f082d4a86f93ce810e5d99eb5c93333d8a
Author: Mingli Yu <Mingli.Yu at windriver.com>
AuthorDate: Mon Apr 22 16:41:32 2019 +0800

    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.
    
    Signed-off-by: Mingli Yu <Mingli.Yu at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-sanitizers.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index e5e8452..8b1d1c9 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"
 ALLOW_EMPTY_${PN} = "1"
 DEPENDS = "gcc-runtime virtual/${TARGET_PREFIX}gcc"
 
+# 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]
+DEBUG_OPTIMIZATION_append = " -Wno-error"
+
 BBCLASSEXTEND = "nativesdk"
 
 PACKAGES = "${PN} ${PN}-dbg"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list