Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_distutils fails when configured --with-lto #70974

Closed
gpshead opened this issue Apr 17, 2016 · 7 comments
Closed

test_distutils fails when configured --with-lto #70974

gpshead opened this issue Apr 17, 2016 · 7 comments
Labels
build The build process and cross-build

Comments

@gpshead
Copy link
Member

gpshead commented Apr 17, 2016

BPO 26787
Nosy @gpshead, @methane
Files
  • issue26787.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-02-21.06:59:15.485>
    created_at = <Date 2016-04-17.06:21:25.439>
    labels = ['build']
    title = 'test_distutils fails when configured --with-lto'
    updated_at = <Date 2019-02-21.06:59:15.485>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2019-02-21.06:59:15.485>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-21.06:59:15.485>
    closer = 'methane'
    components = ['Build']
    creation = <Date 2016-04-17.06:21:25.439>
    creator = 'gregory.p.smith'
    dependencies = []
    files = ['42504']
    hgrepos = []
    issue_num = 26787
    keywords = ['patch']
    message_count = 7.0
    messages = ['263598', '263624', '263666', '263673', '284027', '287978', '336187']
    nosy_count = 3.0
    nosy_names = ['gregory.p.smith', 'methane', 'alecsandru.patrascu']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue26787'
    versions = ['Python 3.5', 'Python 3.6']

    @gpshead
    Copy link
    Member Author

    gpshead commented Apr 17, 2016

    When configured using './configure --with-lto' (added in bpo-25702) and doing a 'make profile-opt' build, test_distutils fails:

    ======================================================================
    FAIL: test_sysconfig_compiler_vars (distutils.tests.test_sysconfig.SysconfigTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/greg/sandbox/python/cpython/3.5/Lib/distutils/tests/test_sysconfig.py", line 156, in test_sysconfig_compiler_vars
        sysconfig.get_config_var('LDSHARED'))
    AssertionError: 'gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-obje[20 chars]none' != 'gcc -pthread -shared'
    - gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none
    + gcc -pthread -shared

    ======================================================================
    FAIL: test_sysconfig_module (distutils.tests.test_sysconfig.SysconfigTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/greg/sandbox/python/cpython/3.5/Lib/distutils/tests/test_sysconfig.py", line 133, in test_sysconfig_module
        sysconfig.get_config_var('LDFLAGS'))
    AssertionError: '-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none' != ''
    - -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none
    +

    @gpshead gpshead added the build The build process and cross-build label Apr 17, 2016
    @alecsandrupatrascu
    Copy link
    Mannequin

    alecsandrupatrascu mannequin commented Apr 17, 2016

    I will investigate this and submit a fix. At a first glance, it seems the test is failing because it does not have the knowledge of the LTO flags.

    @alecsandrupatrascu
    Copy link
    Mannequin

    alecsandrupatrascu mannequin commented Apr 18, 2016

    Hello,

    You can find a patch for this issue attached. Basically, since LTO needs LD flags when used, I modified the makefile template file and the test to push the flags up to the sysconfig module.

    @alecsandrupatrascu
    Copy link
    Mannequin

    alecsandrupatrascu mannequin commented Apr 18, 2016

    This patch is for CPython 3, and if it looks good I will post also the CPython 2 version.

    @methane
    Copy link
    Member

    methane commented Dec 26, 2016

    LGTM

    @methane
    Copy link
    Member

    methane commented Feb 17, 2017

    Would you send pull request on Github?

    @methane
    Copy link
    Member

    methane commented Feb 21, 2019

    Fixed in bpo-35257

    @methane methane closed this as completed Feb 21, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants