Bug 224108 - %configure macro generates unusable FFLAGS
%configure macro generates unusable FFLAGS
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: make (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Machata
bzcl34nup
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-24 00:03 EST by Chris Schanzle
Modified: 2015-05-04 21:32 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-14 13:14:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Schanzle 2007-01-24 00:03:43 EST
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):
redhat-rpm-config-8.0.45-6.noarch

How reproducible:
always

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
  >&5
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 02:22:21 EDT
Hmmm...this bug slipped under the radar. I'll take a look.

Jon.
Comment 2 Jon Masters 2008-04-03 02:47:51 EDT
Do you have a suggestion for an appropriate fix/set of flags to be using?
Comment 3 Chris Schanzle 2008-04-03 09:48:45 EDT
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).

Thoughts?
Comment 4 Bug Zapper 2008-04-04 01:42:57 EDT
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.
http://fedoraproject.org/wiki/LifeCycle/EOL

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:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

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-15 20:25:59 EDT
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 10:31:03 EDT
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-20 21:03:53 EDT
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-20 21:07:28 EDT
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 06:07:19 EDT
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 19:08:04 EDT
changing version to 'rawhide' so this bug does not get closed w/ EOL bugs
Comment 11 Bug Zapper 2008-05-13 22:34:06 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 Bug Zapper 2009-06-09 18:25:20 EDT
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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 13 Bug Zapper 2009-07-14 13:14:10 EDT
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.