Bug 224108 - %configure macro generates unusable FFLAGS
Summary: %configure macro generates unusable FFLAGS
Alias: None
Product: Fedora
Classification: Fedora
Component: make
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Petr Machata
QA Contact:
Whiteboard: bzcl34nup
Depends On:
TreeView+ depends on / blocked
Reported: 2007-01-24 05:03 UTC by Chris Schanzle
Modified: 2015-05-05 01:32 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-07-14 17:14:10 UTC
Type: ---

Attachments (Terms of Use)

Description Chris Schanzle 2007-01-24 05:03:43 UTC
Description of problem:
%configure macro sets FFLAGS to CFLAGS, which adds -fstack-protector, 
--param=ssp-buffer-size=4, and -mtune=generic to FFLAGS.  Neither g77 or
gfortran accept these options, making it impossible to build packages with
"system default" optimization flags.

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

How reproducible:

Steps to Reproduce:
1.  rpm --eval "%configure"
Actual results:
  FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables}" ; export FFLAGS ; 

Expected results:
FFLAGS to be set to something that can at least make executables.

Additional info:

I'm making a package that uses f77 or gfortran, and this is how configure barfs:

configure:1850: checking for Fortran 77 compiler default output file name
configure:1853: g77 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --
param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables  conftest.f
f771: error: unrecognized command line option "-fstack-protector"
f771: error: invalid parameter `ssp-buffer-size'
conftest.f:0: error: bad value (generic) for -mtune= switch
configure:1856: $? = 1
configure: failed program was:
|       program main
|       end
configure:1895: error: Fortran 77 compiler cannot create executables

Comment 1 Jon Masters 2007-08-20 06:22:21 UTC
Hmmm...this bug slipped under the radar. I'll take a look.


Comment 2 Jon Masters 2008-04-03 06:47:51 UTC
Do you have a suggestion for an appropriate fix/set of flags to be using?

Comment 3 Chris Schanzle 2008-04-03 13:48:45 UTC
Since when this bug was reported, gfortran now (at least in F8) accepts and can
build with the default RPM FFLAGS.  I suspect it is desirable to retain those
build flags where possible.

If one tries to write a "portable" Makefile using the default Make implicit
rules of .f -> .o, which is "$(FC) -c $(FFLAGS)" [see 'info make' and search for
FC], it won't work since FC is by default defined to be f77:

f771: error: unrecognized command line option "-fstack-protector"
f771: error: invalid parameter `ssp-buffer-size'
a2.f:0: error: bad value (generic) for -mtune= switch

So I guess this is more complicated:

If f77 is installed, we want RPM's FFLAGS to not include -fstack-protector,
ssp-buffer-size, and omit or use something else for -mtune.

If gfortran is installed and is the "preferred" Fortran system compiler for
Fedora, then the default flags are fine, except Make doesn't conform.

Perhaps the appropriate quick fix is to patch "make" so FC is defined to be
gfortran, not f77 (make sure man pages & info files are updated too).


Comment 4 Bug Zapper 2008-04-04 05:42:57 UTC
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

Comment 5 Jon Masters 2008-04-16 00:25:59 UTC
For now, I'm closing this bug as alternative fixes are outside of the scope of
the redhat-rpm-config package.

Comment 6 Chris Schanzle 2008-04-20 14:31:03 UTC
By closing it, you're saying "it's not my problem, go away".

Is it possible to redirect this bug at 'make'?

Comment 7 Jon Masters 2008-04-21 01:03:53 UTC
Can't you just define FC to be the compiler you want? Or use autotools with a
configure script to determine this in a portable fashion?

Comment 8 Jon Masters 2008-04-21 01:07:28 UTC
Ok, I'm passing this bug on. You're right, closing it because it's not my
package isn't a good idea. However, part of the reason I closed before was
because IMO you should be setting FC according to the compiler you want to use
(through configure). But we'll see what the make maintainer thinks :)

Comment 9 Petr Machata 2008-04-21 10:07:19 UTC
Setting FC would probably be the easiest solution.

make goes to extreme lengths to be useful "out of the box", with implicit rules
and all.  Array with default variable values is rich with conditionals, but all
of them are compile-time settings (e.g. favoring "gpp" for c++ compiler on MS
DOS).  I don't think make should "guess" the right Fortran compiler for the user.

That said, it is simple to change make to favor "gfortran".  But I need to know
what's the situation in Fortran community in general--is gfortran considered the
de facto standard Fortran compiler on Fedora?  Are there other Fortran systems?
 Are they commonplace?  Are their users willing to bypass make logic with
explicitly set FC?  Should we use /etc/alternatives?

I'm slightly biased towards changing the default to be gfortran, simply because
picking f77 seems like defaulting to K&R C in gcc, but I don't know enough
context to make this decision.  Maybe fedora-devel-list would be the right
choice for this discussion (or is there Fortran SIG?).  Care to write a proposal?

Comment 10 John Poelstra 2008-04-23 23:08:04 UTC
changing version to 'rawhide' so this bug does not get closed w/ EOL bugs

Comment 11 Bug Zapper 2008-05-14 02:34:06 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:

Comment 12 Bug Zapper 2009-06-09 22:25:20 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Comment 13 Bug Zapper 2009-07-14 17:14:10 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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