Summary: | sys-auth/elogind-246.9.1 fails to build with -ftracer on gcc-10: /usr/include/bits/stdio2.h:184:10: error: ‘%s’ directive argument is null [-Werror=format-overflow=] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Torsten Kaiser <Storklerk> |
Component: | Current packages | Assignee: | Andreas Sturmlechner <asturm> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | herrtimson, kensington, sam, slashbeast |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/elogind/elogind/issues/189 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98444 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | failed build.log with gcc-10.2 |
Description
Torsten Kaiser
2021-01-07 19:21:24 UTC
Possible dupe of bug 764158? (In reply to Sam James from comment #1) > Possible dupe of bug 764158? I don't think so. Bug 764158 / the GCC Bug 95353 is about a wrong size of the target of the string. In this case it complains about a 'null' value. The comment for the fixing change in the GCC bug also said: "... writing to a trailing array plus offset". The changes page for gcc-10 talks about a number of enhancements for Wstringop-overflow, so I would rather suspect there really is some initialization missing that gcc now is able to detect. It might be that it only triggers with -O3 like the other bug... (In reply to Torsten Kaiser from comment #2) > (In reply to Sam James from comment #1) > > Possible dupe of bug 764158? > > I don't think so. Bug 764158 / the GCC Bug 95353 is about a wrong size of > the target of the string. In this case it complains about a 'null' value. > The comment for the fixing change in the GCC bug also said: "... writing to > a trailing array plus offset". Yeah, that's completely reasonable, I just thought it was an interesting coincidence. I should've checked the bug details ;) Just found the upstream bug: https://github.com/elogind/elogind/issues/189 It's -ftracer, not -O3. And it looks more of an elogind issue than a gcc issue. I should have reads that elogind bug completely and not only the last line like ""I like his idea of putting a 'if (!runtime) __builtin_unreachable ();' infront of the line in question.". https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98444 Known to work: 11.0, 9.3.0 Known to fail: 10.2.0 "In GCC 9 or on trunk (GCC 11), jump threading doesn't introduce the the invalid call so the warning doesn't trigger. So I can confirm this regression for GCC 10 but I don't expect to be able to do anything about it there. Longer term, we're aware of these warnings for synthesized code but we're still looking for a solution to avoid them." I'm not sure if a patch to add that line or filtering -ftracer on gcc-10 is a beautiful solution... Using unsafe CFLAGS like Ofast, ffast-math, ftracer and sometimes flto is known to break things. Issues with ftracer should be addressed upstream, I'd not consider ftracer breaking build a real problem, since this is... ftracer. |