GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-131278: Support building using "computed gotos" for clang-cl on Windows by chris-eibl · Pull Request #131279 · python/cpython

Conversation

@chris-eibl

@chris-eibl chris-eibl commented Mar 15, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

For details please see #131278.

  • Issue: Support building using "computed gotos" for clang-cl on Windows #131278

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chris-eibl
Add optimizing flag WITH_COMPUTED_GOTOS to support such builds using
98de4c1
clang-cl on Windows. Patch by Chris Eibl.
@chris-eibl
chris-eibl requested a review from a team as a code owner March 15, 2025 11:35
@bedevere-app bedevere-app Bot added the awaiting review label Mar 15, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 15, 2025
Support building using "computed gotos" for clang-cl on Windows #131278
Closed
@chris-eibl
ups - double backticks needed
86cb64e
picnixz
picnixz reviewed Mar 15, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Some readability comments. Do you want to actually add a What's New as well? (I don't know how wide is the audience)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread PCbuild/readme.txt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread PCbuild/readme.txt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread PCbuild/readme.txt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Build/2025-03-15-12-32-56.gh-issue-131278.1nd0mJ.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl @picnixz
Apply suggestions from code review
3aabeea
Co-authored-by: Bénédikt Tran <[email protected]>
@Fidget-Spinner

Fidget-Spinner commented Mar 15, 2025

Copy link
Copy Markdown
Member

I don't remember if we had a Whats New for the original clang-cl issue. We should definitely mention in the whats new that clang cl building on Windows is now possible, and say PGO too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner Fidget-Spinner closed this Mar 15, 2025
@Fidget-Spinner Fidget-Spinner reopened this Mar 15, 2025
@Fidget-Spinner

Fidget-Spinner commented Mar 15, 2025

Copy link
Copy Markdown
Member

Woops sorry pressed the wrong button!

picnixz and chris-eibl reacted with laugh emoji
All reactions
  • 😄 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Mar 15, 2025
View reviewed changes
Comment thread PCbuild/readme.txt Resolved

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Mar 15, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Build/2025-03-15-12-32-56.gh-issue-131278.1nd0mJ.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

chris-eibl added 2 commits March 15, 2025 13:36
@chris-eibl
remove space before *
ca22c81
@chris-eibl
revert :prog:
897c527
picnixz
picnixz approved these changes Mar 15, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Mar 15, 2025
@picnixz

picnixz commented Mar 15, 2025

Copy link
Copy Markdown
Member

@chris-eibl How do you plan to address:

We should definitely mention in the whats new that clang cl building on Windows is now possible, and say PGO too.

Are there more PRs for those kind of optimizations on Windows? if so, we can delay everything until they are done. Otherwise, let's mention that in the What's New entry

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl

chris-eibl commented Mar 15, 2025

Copy link
Copy Markdown
Member Author

I don't remember if we had a Whats New for the original clang-cl issue. We should definitely mention in the whats new that clang cl building on Windows is now possible, and say PGO too.

Building with clang-cl has been possible for a very long time: #101352.

The only fixes I am aware of are just these two (and just main and current 3.14 alphas are/have been affected):

  • _GENERATE_DEBUG_SECTION_WINDOWS https://github.com/python/cpython/pull/130040/files#r1981801677 already fixed by you
  • blake2module.c needs to be compiled with libhacl SIMD flags #130213: close to being fixed

So maybe just mention PGO in the Whats New?
Maybe this here and -flto=thin, too?

@zooba treats clang-cl as quite optional in #129907 (comment)
but I think a Whats New entry would not hurt.

Shall I give it a go here and mention those three things?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl

chris-eibl commented Mar 15, 2025

Copy link
Copy Markdown
Member Author

@Fidget-Spinner : your tail call for Windows #130040 (comment) came without What's new, too. Shall I add an entry, too?

Are there more PRs for those kind of optimizations on Windows?

I'd like to work on the many warnings clang-cl emits, but IMHO that won't go into What's new. Regarding optimizations, I think that's it atm, we can amend later, anyway.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner

Fidget-Spinner commented Mar 15, 2025

Copy link
Copy Markdown
Member

@Fidget-Spinner : your tail call for Windows #130040 (comment) came without What's new, too. Shall I add an entry, too?

We don't need it, as there's already a whats new for tail call in general.

chris-eibl reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl
add whats new
1f5b55f
chris-eibl
chris-eibl commented Mar 15, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Outdated

* building with clang-cl on Windows now supports PGO (profile guided
optimization), uses ``-flto=thin`` and can be configured to use
computed gotos. (Contributed by Chris Eibl in

@chris-eibl chris-eibl Mar 15, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

IMHO "computed gotos and/or tail calls" would be better here, but up to @Fidget-Spinner 's liking :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zooba

zooba commented Mar 17, 2025

Copy link
Copy Markdown
Member

I think we want to be careful putting too much into What's New, since we still aren't technically supporting clang-cl on Windows yet, we're really just unblocking it. No doubt if @chris-eibl sticks around it'll remain unblocked, but also, if Clang one day breaks down and MSVC is fine then we're still going to release.

A simple entry (which should already be there?) stating that build.bat now has a clang-cl specific option (previously you needed to set PlatformToolset but that was the only difference) and perhaps calling out that this enables some clang-specific optimisations, referencing PCbuild\readme.txt for more info seems to hit the balance. Let's avoid using the word "support" in regards to our source code.

chris-eibl and Fidget-Spinner reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl

chris-eibl commented Mar 17, 2025

Copy link
Copy Markdown
Member Author

previously you needed to set PlatformToolset but that was the only difference

This is still true, we do not have a "clang" switch for build.bat, yet.

I am fine with entirely removing the whatsnew if that makes it easier :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zooba
zooba reviewed Mar 17, 2025
View reviewed changes

@zooba zooba left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

PCbuild changes look good, just suggesting some clarifications to the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Build/2025-03-15-12-32-56.gh-issue-131278.1nd0mJ.rst Outdated
Comment on lines +1 to +2
Add optimizing flag ``WITH_COMPUTED_GOTOS`` to support such builds using
clang-cl on Windows. Patch by Chris Eibl.

@zooba zooba Mar 17, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Add optimizing flag ``WITH_COMPUTED_GOTOS`` to support such builds using
clang-cl on Windows. Patch by Chris Eibl.
Add optimizing flag ``WITH_COMPUTED_GOTOS`` to Windows builds for when
using a compiler that supports it (currently clang-cl). Patch by Chris Eibl.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.14.rst Outdated
with :c:expr:`Py_NO_LINK_LIB`. (Contributed by Jean-Christophe
Fillion-Robin in :gh:`82909`.)

* building with clang-cl on Windows now supports PGO (profile guided

@zooba zooba Mar 17, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
* building with clang-cl on Windows now supports PGO (profile guided
* clang-cl builds on Windows now work with ``--pgo`` (profile guided

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.14.rst Outdated
Fillion-Robin in :gh:`82909`.)

* building with clang-cl on Windows now supports PGO (profile guided
optimization), uses ``-flto=thin`` and can be configured to use

@zooba zooba Mar 17, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
optimization), uses ``-flto=thin`` and can be configured to use
optimization), and can be configured to use

Is using -flto=thin important to call out? It shouldn't change the ABI of the build output at all, and it's not configurable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zooba

zooba commented Mar 17, 2025

Copy link
Copy Markdown
Member

This is still true, we do not have a "clang" switch for build.bat, yet.

(Seen after submitting my review.) Oh don't we? Okay, yeah, let's treat all clang-cl specific changes as undocumented then. The day it gets an option is when we'd start putting notes in the Build section of NEWS, and give the option a brief mention in What's New.

chris-eibl reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chris-eibl added 2 commits March 17, 2025 18:52
@chris-eibl
Revert "add whats new"
905d2e4
This reverts commit 1f5b55f.
@chris-eibl
apply Steve's suggestion to blurb
fd3cb86
@chris-eibl
fix missing newline in blurb
59dac20
@zooba
zooba merged commit 468a7aa into python:main Mar 17, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Mar 17, 2025
@chris-eibl
chris-eibl deleted the param_cg branch March 18, 2025 05:25
colesbury pushed a commit to colesbury/cpython that referenced this pull request Mar 20, 2025
@chris-eibl @colesbury
pythonGH-131278: Add option to build with computed gotos on Windows w…
ca39b4f
…ith clang-cl (pythonGH-131279)
@chris-eibl chris-eibl mentioned this pull request Aug 23, 2025
GH-131033: Enable the optimizing macros UNLIKELY and LIKELY for clang-cl on Windows #131019
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@zooba zooba zooba left review comments
@picnixz picnixz picnixz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@chris-eibl @Fidget-Spinner @picnixz @zooba
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.