| Summary: | dash-7 source RPM does not build | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | mick <mgoulish> |
| Component: | distribution | Assignee: | mick <mgoulish> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Frantisek Reznicek <freznice> |
| Severity: | high | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 2.0 | CC: | esammons, freznice, iboverma, tross |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | qpid-cpp-mrg-0.10-8 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-12-07 17:43:10 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
mick
2011-06-01 19:31:34 UTC
/*---------------------------------------
root cause
---------------------------------------*/
In the brew mock build, just before the configure script is run in the cpp directory, the CXXFLAGS environment variable is set this way:
export CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DNDEBUG -O3'
This environment variable affects the operation of the GCC compiler.
Then, when the configure script is run, GCC reports that it will NOT honor the -Werror flag.
So that flag is never used.
So warnings are not treated as errors.
So we did not notice the warning saying that a variable in one cpp function was unused.
~~~ HOWEVER ~~~
In the rpmbuild process, when I give the normal command:
rpmbuild --recompile /path/to/qpid-cpp-mrg-0.10-7.el5.src.rpm
it sets a *different* CXXFLAGS value:
CXXFLAGS='-O2 -g -m64 -mtune=generic -DNDEBUG -O3'
This causes GCC to report that it *will* honor the -Werror flag -- so the build fails.
The important difference is the absence of the -Wall flag.
If you remove that flag from the brew mock build, i.e. if it were to set this value for CXXFLAGS:
export CXXFLAGS='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DNDEBUG -O3'
Then everything works right.
It looks like there is an undocumented relationship between -Wall and -Werror in gcc. i.e. -Wall disables -Werror
Fixed upstream in revision 1127947 Both qpid-cpp-mrg-0.10-8.el5 qpid-cpp-0.10-6.el6 now build ok - rpmbuild way(-Wall) - custom build way (CXXFLAGS w/o -Wall). Tested on RHEL5.6 / 6.1 i/x. -> VERIFIED |