Bug 9543

Summary: Resolve string formatting issues in gcc
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Joshua Lock <joshuagloe>
Component: devtools / tool chainAssignee: Khem Raj <raj.khem>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: elena.reshetova, meta.mr.watcher, meta.watcher
Version: 2.2   
Target Milestone: 2.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
log.do_compile from gcc none

Description Joshua Lock 2016-04-28 10:39:14 UTC
gcc fails to compile with compiler flags which elevate common string formatting issues into an error (-Wformat -Wformat-security -Werror=format-security).

We may get this for free in the gcc6 upgrade?
Comment 1 Joshua Lock 2017-02-07 13:21:21 UTC
Issue still present in gcc-6.3. Setting assignee to recipe maintainer. Khem, please feel free to update estimate, target, etc. to suit your workload.
Comment 2 Joshua Lock 2017-02-07 13:24:54 UTC
Note: to observe the failures comment out the recipe's SECURITY_STRINGFORMAT entry in security_cflags.inc and build the recipe with a configuration that utilises security_cflags (i.e. the poky-lsb distro).
Comment 3 Khem Raj 2017-02-07 16:52:57 UTC
Can you attach a link to kind of failures seen ?
Comment 4 Joshua Lock 2017-02-07 17:03:36 UTC
Created attachment 3627 [details]
log.do_compile from gcc

We're seeing errors like:

../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libcpp/expr.c:686:18: error: format not a string literal and no format arguments [-Werror=format-security]
        0, message);


I've attached a full log.do_compile for a configuration using poky-lsb with the SECURITY_STRINGFORMAT_pn-gcc = "" line commented out in meta/conf/distro/include/security_flags.inc
Comment 5 Khem Raj 2017-10-09 16:46:39 UTC
I think this has been fixed in 2.4 along with secflags reworks, we do not exclude gcc from SECURITY_FLAGS anymore.