Skip to content

bpo-43109: Fix --with-lto configure option on macOS#26341

Merged
ned-deily merged 1 commit into
python:mainfrom
ned-deily:bpo-43109-clang-lto
May 25, 2021
Merged

bpo-43109: Fix --with-lto configure option on macOS#26341
ned-deily merged 1 commit into
python:mainfrom
ned-deily:bpo-43109-clang-lto

Conversation

@ned-deily

@ned-deily ned-deily commented May 25, 2021

Copy link
Copy Markdown
Member

Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.

https://bugs.python.org/issue43109

Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.
@xrisk

xrisk commented May 25, 2021

Copy link
Copy Markdown
Contributor

Hi Ned, were you able to take a look at bpo-44093? In my testing, this code path never gets hit because the configure script always detects gcc on macOS.

@ned-deily

Copy link
Copy Markdown
Member Author

@xrisk, the way this has worked for many years is that you need to specifically add CC=clang to the ./configure arguments if you want to explicitly call clang. OTOH, in this case, I believe it doesn't matter as you end up with the same LTO options on macOS whether you explicitly set CC=clang or you default to the Apple-supplied gcc wrapper.

@xrisk

xrisk commented May 25, 2021

Copy link
Copy Markdown
Contributor

Right, doesn’t that mean that —with-lto still wouldn’t work, unless the user also specifies CC=clang? At the very least, we should document that fact, I think never mind, sorry for the noise!

@ned-deily

Copy link
Copy Markdown
Member Author

@xrisk No problem and thanks for your feedback. I don't claim to have a lot of experience with LTO and friends but it looks to me like the --with-lto option produces the same result in both cases. But I could be wrong. In any case, I would prefer to put off further housecleaning in configure et al until we get 3.10 out the door.

@ned-deily
ned-deily merged commit 59acfd4 into python:main May 25, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @ned-deily for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 25, 2021
Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.
(cherry picked from commit 59acfd4)

Co-authored-by: Ned Deily <nad@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 25, 2021
Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.
(cherry picked from commit 59acfd4)

Co-authored-by: Ned Deily <nad@python.org>
@bedevere-bot

Copy link
Copy Markdown

GH-26342 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label May 25, 2021
@bedevere-bot

Copy link
Copy Markdown

GH-26343 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request May 25, 2021
Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.
(cherry picked from commit 59acfd4)

Co-authored-by: Ned Deily <nad@python.org>
ned-deily added a commit that referenced this pull request May 25, 2021
)

Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.
(cherry picked from commit 59acfd4)

Co-authored-by: Ned Deily <nad@python.org>
@ned-deily
ned-deily deleted the bpo-43109-clang-lto branch September 4, 2021 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants