Skip to content

bpo-41181: macOS build script uses LTO and PGO - #21256

Closed
vstinner wants to merge 1 commit into
python:masterfrom
vstinner:mac_lto_pgo
Closed

bpo-41181: macOS build script uses LTO and PGO#21256
vstinner wants to merge 1 commit into
python:masterfrom
vstinner:mac_lto_pgo

Conversation

@vstinner

@vstinner vstinner commented Jul 1, 2020

Copy link
Copy Markdown
Member

The script to build the macOS installer now configures Python with
Link Time Optimization (LTO) and Profile-Guided Optimizatio (PGO).

https://bugs.python.org/issue41181

The script to build the macOS installer now configures Python with
Link Time Optimization (LTO) and Profile-Guided Optimizatio (PGO).
@vstinner

vstinner commented Jul 1, 2020

Copy link
Copy Markdown
Member Author

cc @ronaldoussoren @ambv

@vstinner

vstinner commented Jul 1, 2020

Copy link
Copy Markdown
Member Author

macOS 10.15.4 provides clang 11.0.3, but it seems like python.org binaries are built with Clang 6.0: https://bugs.python.org/issue41181#msg372743

While GCC had bugs with LTO a few years ago, as far as I recall, Clang always fine with LTO. PGO is a command optimization, I'm not aware of any issue with GCC or Clang.

Note: on macOS, "gcc" is a wrapper to Clang in practice:

$ gcc --version
Configured with: (...)
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ clang --version
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Maybe the build script should be more explicit and require clang explicitly.

@@ -0,0 +1,2 @@
The script to build the macOS installer now configures Python with Link Time
Optimization (LTO) and Profile-Guided Optimizatio (PGO).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits: Optimization

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Profile-Guided Optimizatio/Profile-Guided Optimization/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message could be updated too (same typo)

@ned-deily

Copy link
Copy Markdown
Member

Thanks for the suggestion but, as discussed in the bpo issue, we are not using this option now.

@ned-deily ned-deily closed this Jul 1, 2020
@vstinner
vstinner deleted the mac_lto_pgo branch January 19, 2021 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants