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 1596874

Summary: python3.7-config --cflags contains -flto
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python3Assignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: bkabrda, cstratak, dmalcolm, fweimer, jcline, mcyprian, mhroncok, pviktori, rkuska, shcherbina.iryna, tomspur, torsava, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python3-3.7.2-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-06 02:22:02 UTC 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 Miro Hrončok 2018-06-29 21:34:43 UTC
Description of problem: Since the upgrade to 3.7, we now export -flto as part of python3.7-config --cflags. This is changed since 3.6 and may bring troubles. See for example bz1593431.


Version-Release number of selected component: python3-3.7.0-1.fc29, python37-3.7.0-1.fc28.x86_64


Steps to Reproduce:
$ python3.7-config --cflags | grep -- -flto || echo nope

Actual results:
-I/usr/include/python3.7m -I/usr/include/python3.7m  -Wno-unused-result -Wsign-compare -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv

Expected results:
nope

Additional info:
This is related to closed bz1217376.

I think we should start getting a list of flags we don't want to export.
Be it annobin, hardening, link time optimizations...

If the list is not in redhat-rpm-config, we shall maintain our own.

Comment 1 Florian Weimer 2018-06-30 07:47:04 UTC
Just to be clear, -flto comes from Python.  It's not part of the recommended build flags for Fedora.

Comment 2 Miro Hrončok 2018-06-30 09:59:16 UTC
Right. It's because we invoke configure with --enable-optimizations.

What's weird is that we did that with 3.6 as well.

Comment 3 Charalampos Stratakis 2018-06-30 10:24:38 UTC
Wasn't the flag exported with 3.6 as well?

Comment 4 Miro Hrončok 2018-06-30 12:15:00 UTC
Not on my Fedora 28.

Comment 5 Jan Kurik 2018-08-14 09:56:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 6 Charalampos Stratakis 2018-11-12 16:53:47 UTC
This is due to https://github.com/python/cpython/pull/3110/commits/84e153278217011fc0784d8a3487568823aa0682

I bisected it with:
$ ./configure  --prefix=$PWD/_install --with-lto && make -j4 && make install && ./_install/bin/python3-config --cflags | grep -- -flto || echo nope

Note that python 3.6 is also affected now as the commit was backported by me to 3.6

Comment 7 Fedora Update System 2019-01-04 09:13:32 UTC
python3-3.7.2-1.fc29 python3-docs-3.7.2-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-f9d5bbef82

Comment 8 Fedora Update System 2019-01-06 02:22:02 UTC
python3-3.7.2-1.fc29, python3-docs-3.7.2-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.