Bug 908096

Summary: libev build doesn't respect $RPM_OPT_FLAGS
Product: [Fedora] Fedora Reporter: Nalin Dahyabhai <nalin>
Component: libevAssignee: Mathieu Bridon <bochecha>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bochecha
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: 2013-02-08 10:08:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nalin Dahyabhai 2013-02-05 21:14:38 UTC
Description of problem:
When building libev, the build log shows that it's using CFLAGS set to "-g -O3" rather than the ones provided by RPM.

Version-Release number of selected component (if applicable):
libev-4.11-1.fc19

How reproducible:
Always

Steps to Reproduce:
1. rpmbuild --rebuild libev-4.11-1.fc19.src.rpm
  
Additional info:
It's not the most elegant workaround, but adding 'CFLAGS="$RPM_OPT_FLAGS"' to the command line for 'make' should do the trick.  To avoid warnings due to violating strict aliasing rules, a '-fno-strict-aliasing' would probably need to be added to turn off strict aliasing.

Comment 1 Mathieu Bridon 2013-02-08 10:08:25 UTC
Thanks for the bug report Nalin.

Looking at configure.ac, I see this:

    orig_CFLAGS="$CFLAGS"
    [... snip ...]
    dnl Supply default CFLAGS, if not specified
    if test -z "$orig_CFLAGS"; then
      if test x$GCC = xyes; then
        CFLAGS="-g -O3"
      fi
    fi

But looking at the configure script, the orig_CFLAGS="..." line isn't there.

The problem is that this line needs to be after AC_INIT, but before AC_PROG_CC
(thanks emias in #schmorpforge for the help)

I committed the patch to the Rawhide package and rebuilt, see the build.log:
http://kojipkgs.fedoraproject.org//work/tasks/8147/4938147/build.log

I'll try submitting all the Fedora patches upstream though.

Comment 2 Nalin Dahyabhai 2013-02-08 15:28:21 UTC
Thanks!