| Summary: | elfutils FTBFS if "-Werror=format-security" flag is used | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Dhiru Kholia <dkholia> |
| Component: | elfutils | Assignee: | Mark Wielaard <mjw> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | aoliva, bressers, dhiru, fche, fweimer, jakub, jan.kratochvil, mjw, mjw, pmachata, roland |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-05-10 20:17:16 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1038083 | ||
|
Description
Dhiru Kholia
2013-12-03 03:00:49 UTC
(In reply to Dhiru Kholia from comment #0) > elfutils fails to build if "-Werror=format-security" flag is used. > > ... > > cc1: error: -Wformat-security ignored without -Wformat > [-Werror=format-security] > > ... > > Please fix this issue in rawhide with a patch (which you should submit > to upstream to merge moving forward). Please do a new build with the > fix in rawhide. Other releases do not need to be directly fixed, but > there should be no harm in pushing out this fix/patch with other needed > changes to those branches. > > In the event you don't fix this bug before the next mass rebuild, > provenpackagers may step in and update your package(s) to fix this > issue. Help with fixes that are acceptable upstream would be very appreciated since the given trivial example doesn't seem to match the patterns used in elfutils. So it is not as trivial as the example makes it out. See for some discussion of the issue to resolve this fedora devel thread https://lists.fedoraproject.org/pipermail/devel/2013-November/192309.html (no replies or suggestions yet). Well, we already snip -Wall from RPM_OPT_FLAGS. We can just as well snip out the -Werror=format-security bit as well, on the grounds that we enable it again through the build system anyway, where relevant. > Well, we already snip -Wall from RPM_OPT_FLAGS. We can just as well snip > out the -Werror=format-security bit as well, on the grounds that we enable > it again through the build system anyway, where relevant. Agreed. That would be the simplest. Another would be to explicitly mark the places in the code with: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" [... code ...] #pragma GCC diagnostic pop But if there is a more clean way that would be nice.(In reply to Petr Machata from comment #2) 0.157-4 Remove -Werror=format-security from RPM_OPT_FLAGS.
diff --git a/elfutils.spec b/elfutils.spec
index c41e98d..c139c19 100644
--- a/elfutils.spec
+++ b/elfutils.spec
@@ -231,7 +231,11 @@ find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
# Remove -Wall from default flags. The makefiles enable enough warnings
# themselves, and they use -Werror. Appending -Wall defeats the cases where
# the makefiles disable some specific warnings for specific code.
+# Also remove -Werror=format-security which doesn't work without
+# -Wformat (enabled by -Wall). We enable -Wformat explicitly for some
+# files later.
RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-Wall/}
+RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-Werror=format-security/}
%if %{compat}
# Some older glibc headers can run afoul of -Werror all by themselves.
Proposed upstream patch: https://lists.fedorahosted.org/pipermail/elfutils-devel/2014-January/003783.html This has been worked around in fedora since 0.157-4 Remove -Werror=format-security from RPM_OPT_FLAGS. And upstream now explicitly builds with -Wformat=2 which includes -Wformat-security.
commit f48eb6b15fee66e54b488d71738979fc608f25ee
Author: Mark Wielaard <mjw>
Date: Thu Jan 23 00:56:41 2014 +0100
Use -Wformat=2 by default for all files.
This just makes sure that all format strings are given as literals to
printf like functions so the compiler can see and check them. Remove
all no_Wformat, add -Wformat=2 unconditionally to AM_CFLAGS.
Signed-off-by: Mark Wielaard <mjw>
|