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

When using Apple Clang, --with-lto builds should not check for llvm-ar #87275

Closed
acmorrow mannequin opened this issue Feb 2, 2021 · 6 comments
Closed

When using Apple Clang, --with-lto builds should not check for llvm-ar #87275

acmorrow mannequin opened this issue Feb 2, 2021 · 6 comments
Assignees
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build OS-mac type-feature A feature request or enhancement

Comments

@acmorrow
Copy link
Mannequin

acmorrow mannequin commented Feb 2, 2021

BPO 43109
Nosy @ronaldoussoren, @vstinner, @ned-deily, @miss-islington, @xrisk, @acmorrow
PRs
  • bpo-43109: Use /usr/bin/ar on macOS for LTO builds #25999
  • bpo-43109: Fix --with-lto configure option on macOS #26341
  • [3.10] bpo-43109: Fix --with-lto configure option on macOS (GH-26341) #26342
  • [3.9] bpo-43109: Fix --with-lto configure option on macOS (GH-26341) #26343
  • bpo-43109: configure doc: LTO requires "ar" on macOS #26349
  • [3.10] bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349) #26350
  • 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 = 'https://github.com/ned-deily'
    closed_at = <Date 2021-05-25.10:58:37.915>
    created_at = <Date 2021-02-02.22:52:49.269>
    labels = ['OS-mac', 'build', '3.9', '3.10', '3.11', 'type-feature']
    title = 'When using Apple Clang, --with-lto builds should not check for llvm-ar'
    updated_at = <Date 2021-05-25.10:58:37.914>
    user = 'https://github.com/acmorrow'

    bugs.python.org fields:

    activity = <Date 2021-05-25.10:58:37.914>
    actor = 'vstinner'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2021-05-25.10:58:37.915>
    closer = 'vstinner'
    components = ['Build', 'macOS']
    creation = <Date 2021-02-02.22:52:49.269>
    creator = 'acmorrow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43109
    keywords = ['patch']
    message_count = 6.0
    messages = ['386174', '393334', '394291', '394292', '394323', '394324']
    nosy_count = 6.0
    nosy_names = ['ronaldoussoren', 'vstinner', 'ned.deily', 'miss-islington', 'xrisk', 'acmorrow']
    pr_nums = ['25999', '26341', '26342', '26343', '26349', '26350']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue43109'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @acmorrow
    Copy link
    Mannequin Author

    acmorrow mannequin commented Feb 2, 2021

    When building with --with-lto, an explicit check for llvm-ar is performed as part of the configure step. However, Apple does not ship llvm-ar as part of Xcode, so when building with Apple Clang this check fails and prevents using --with-lto.

    However, using the builtin ar seems to work just fine, and it can be selected by passing LLVM_AR=/path/to/ar to configure. It would be nice to see the configure script updated to know that system ar is sufficient when using Apple Clang on macOS.

    Please see Homebrew/homebrew-core#70177 for additional background.

    @acmorrow acmorrow mannequin added 3.9 only security fixes build The build process and cross-build type-feature A feature request or enhancement labels Feb 2, 2021
    @ned-deily ned-deily self-assigned this May 9, 2021
    @ned-deily
    Copy link
    Member

    Thanks for the PR. I am looking at this area currently.

    @miss-islington
    Copy link
    Contributor

    New changeset 25a9cf1 by Miss Islington (bot) in branch '3.10':
    bpo-43109: Fix --with-lto configure option on macOS (GH-26341)
    25a9cf1

    @ned-deily
    Copy link
    Member

    New changeset 3af61a7 by Miss Islington (bot) in branch '3.9':
    bpo-43109: Fix --with-lto configure option on macOS (GH-26341) (GH-26343)
    3af61a7

    @miss-islington
    Copy link
    Contributor

    New changeset ddc503c by Miss Islington (bot) in branch '3.10':
    bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349)
    ddc503c

    @vstinner
    Copy link
    Member

    Thanks to the bug report Andrew C. Morrow, it's now fixed.

    Commits in main:

    commit 59acfd4
    Author: Ned Deily <nad@python.org>
    Date: Mon May 24 23:00:04 2021 -0400

    bpo-43109: Fix --with-lto configure option on macOS (GH-26341)
    
    Allow --with-lto configure option to work with Apple-supplied Xcode or
    Command Line Tools which do not provide llvm-ar.
    

    commit 63f17c2 (HEAD -> main, upstream/main)
    Author: Victor Stinner <vstinner@python.org>
    Date: Tue May 25 12:25:22 2021 +0200

    bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349)
    

    Commits in 3.10 branch:

    commit ddc503c (upstream/3.10, 3.10)
    Author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
    Date: Tue May 25 03:56:37 2021 -0700

    bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349)
    
    (cherry picked from commit 63f17c252ab1b9357c5f022296213c42d9629458)
    
    Co-authored-by: Victor Stinner <vstinner@python.org>
    

    @vstinner vstinner added 3.10 only security fixes 3.11 only security fixes labels May 25, 2021
    @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
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build OS-mac type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants