Bug 1596874 - python3.7-config --cflags contains -flto
Summary: python3.7-config --cflags contains -flto
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-29 21:34 UTC by Miro Hrončok
Modified: 2019-01-06 02:22 UTC (History)
13 users (show)

Fixed In Version: python3-3.7.2-1.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-06 02:22:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 31354 0 None None None 2018-11-19 11:04:21 UTC
Red Hat Bugzilla 1593431 0 unspecified CLOSED Perf fails to compile with python 3.7 2021-02-22 00:41:40 UTC

Internal Links: 1593431

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.


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