Bug 908096 - libev build doesn't respect $RPM_OPT_FLAGS
Summary: libev build doesn't respect $RPM_OPT_FLAGS
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libev
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mathieu Bridon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-05 21:14 UTC by Nalin Dahyabhai
Modified: 2013-02-08 15:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-08 10:08:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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!


Note You need to log in before you can comment on or make changes to this bug.