Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1980549 - h5cc passes through flags from package build process
Summary: h5cc passes through flags from package build process
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: hdf5
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-08 20:00 UTC by taw-rhb
Modified: 2021-07-08 20:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description taw-rhb 2021-07-08 20:00:16 UTC
Description of problem:

The compiler driver program 'h5cc' includes what appear to be the CFLAGS from the package build process.  This causes problems because those flags include things which meaningfully change the interpretation of source code (-D_BSD_SOURCE), as well as other things that should be chosen by the user such as optimisation and debug flags (-O2, -g and others).

I believe this happens because the HDF5 library's autotools build process copies CFLAGS into the output of h5cc.  It expects H5_CFLAGS to be used instead, for flags to be used for building HDF5 itself but not to be passed through to h5cc.

I noticed the problem because Meson uses the output of h5cc as one way to detect HDF5, in the absence of a pkg-config file.  Stripping out the extra flags in Meson was discussed as a potential solution, but is really more of a band-aid/hacky solution: https://github.com/mesonbuild/meson/issues/8932 - see that issue for some more background.

I believe this is exactly the same problem as reported and fixed earlier for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1794625
Here's the fix used over there: https://src.fedoraproject.org/rpms/hdf5/c/6a442e16217e3eee5ecd670a57297c73cd81cdc5?branch=rawhide


Version-Release number of selected component (if applicable):
Version     : 1.8.12
Release     : 12.el7


How reproducible:
100%


Steps to Reproduce:
1. Run h5cc -c -show


Actual results:
$ h5cc -c -show
gcc -I/usr/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_BSD_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c


Expected results:
$ h5cc -c -show
gcc -I/usr/include -c


Additional info:


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