Bug 9543 - Resolve string formatting issues in gcc
Summary: Resolve string formatting issues in gcc
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4
Assignee: Khem Raj
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-04-28 10:39 UTC by Joshua Lock
Modified: 2017-10-09 16:46 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
log.do_compile from gcc (498.97 KB, application/octet-stream)
2017-02-07 17:03 UTC, Joshua Lock
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.