Bug 667144 - Source RPM spec file doesn't obey %__cc, %__cpp, %__cxx compiler macros
Source RPM spec file doesn't obey %__cc, %__cpp, %__cxx compiler macros
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gzip (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: pstodulk
: Patch
Depends On:
  Show dependency treegraph
Reported: 2011-01-04 11:02 EST by Gordan Bobic
Modified: 2017-03-23 16:14 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to add correct passing of compiler settings specified in the rpm macros (286 bytes, patch)
2011-01-04 11:02 EST, Gordan Bobic
no flags Details | Diff

  None (edit)
Description Gordan Bobic 2011-01-04 11:02:13 EST
Created attachment 471689 [details]
Patch to add correct passing of compiler settings specified in the rpm macros

Description of problem:

The spec file in the source rpm package ignores the compiler rpm macros (or rather, doesn't specify them, so the build defaults to gcc whatever the rpm macros are set to. The macros %__cc, %__cpp, %__cxx, etc. should always be passed to the build process in the appropriate way (environment variables, parameters, whatever) - that's what they are for.

bzip2 spec file, for example, does this correctly, as do a number of other packages, so there is ample precedent for doing this right.

Version-Release number of selected component (if applicable):
gzip-1.3.12-18.el6.src.rpm from RHEL6

How reproducible:
Every time.

Steps to Reproduce:
1. Use a different compiler, or build a custom gcc and call the binaries something different, e.g. mygcc
2. Specify it in /usr/lib/rpm/rpmmacros or ~/.rpmmacros
3. rpm -ivh gzip-1.3.12-18.el6.src.rpm; cd ~/rpmbuild/SPECS; rpmbuild -bb gzip.spec
Actual results:
gzip builds using gcc regardless of what is specified in the rpm macros.

Expected results:
rpm macros should be obeyed and the specified compiler should be used.

Additional info:
gzip builds and works correctly with Intel ICC / XE compiler (and runs a few percent faster), so as a package, it isn't very GCC specific.

A rather trivial patch to fix this is attached.
Comment 2 RHEL Product and Program Management 2011-01-07 10:37:26 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support

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