Bug 2177253

Summary: redhat-rpm-config injects invalid flags to gfortran
Product: [Fedora] Fedora Reporter: nvwarr
Component: redhat-rpm-configAssignee: Florian Weimer <fweimer>
Status: ASSIGNED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 38CC: ajax, carl, ffesti, fweimer, igor.raits, j, maxwell, mhroncok, ngompa13, nickc, pmatilai, sipoyare, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 nvwarr 2023-03-10 15:35:33 UTC
Description of problem:

redhat-rpm-config injects flags to gfortran, which are appropriate for the C/C++ compiler and/or preprocessor but not for Fortran.

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

redhat-rpm-config-252-1.fc38.noarch

How reproducible:

always

Steps to Reproduce:
1. build an rpm containing Fortran code

Actual results:

three warnings are generated, which are not generated outside of rpmbuild

f951: Warning: ‘-Werror=’ argument ‘-Werror=format-security’ is not valid for Fortran
f951: Warning: -D_FORTIFY_SOURCE not defined
annobin: test.f: Warning: -D_GLIBCXX_ASSERTIONS not defined

Expected results:

should not pass -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS to gfortran.

Additional info:

this has actually been around for a while, but has only just crossed my annoyance threshold:)

Comment 1 Florian Weimer 2023-07-05 10:50:09 UTC
Some discussion in PR 254. I'm working on a different approach.