Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 154708

Summary: ocaml compile uses -O instead of optimization level specified in RPM_OPT_FLAGS
Product: [Fedora] Fedora Reporter: Toshio Kuratomi <toshio>
Component: ocamlAssignee: GĂ©rard Milmeister <gemi>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: ocaml-3.08.3-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-26 11:53:27 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 Flags
Patch to allow user defined CFLAGS to override the default optimization level none

Description Toshio Kuratomi 2005-04-13 16:55:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050323 Firefox/1.0.2 Fedora/1.0.2-1.3.1

Description of problem:
when building ocaml, the optimization flags passed to gcc via RPM_OPT_FLAGS are included but the optimization (-O2) is overridden by -O definitions in the Makefile.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. cd cvs/extras/ocaml
2. make i386

Actual Results:  Watch the build logs and notice lines similar to the following:
gcc -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -I../../byterun -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC   -c -o write.o write.c

Expected Results:  gcc -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -I../../byterun -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC   -c -o write.o write.c

Additional info:

The Makefiles seem to contian the following definitions:
(From byterun/Makefile)::

Since the CC var is where we're defining the RPM_OPT_FLAGS (./configure -ccoption "gcc $RPM_OPT_FLAGS") the commandline ends up with the RPM_OPT_FLAGS -O2 entered first and the CFLAGS -O overriding it.

Unless upstream has a reason for only compiling with -O, I think we should be pulling the -O from the CFLAGS.

Comment 1 Toshio Kuratomi 2005-05-09 00:36:52 UTC
Created attachment 114148 [details]
Patch to allow user defined CFLAGS to override the default optimization level

This is a patch to the ocaml configure script that allows a CFLAGS environment
variable to add to the flags that are eventually passed to gcc when the package
is built.  We can then use this functionality in the rpm spec file to send the
RPM_OPT_FLAGS to gcc.  This addition occurs after the -O defined by the ocaml
defaults so the RPM_OPT_FLAGS supplied optimization level takes precedence.

Comment 2 Toshio Kuratomi 2005-05-26 11:53:27 UTC
Fixes applied and package built.