Skip to content

gh-131093: Enforce -std=c11 for gcc at configure time rather than make time - #133608

Closed
CS-cwhite wants to merge 1 commit into
python:mainfrom
CS-cwhite:bugfix/SDX-12236-configure-std-c11
Closed

CS-cwhite wants to merge 1 commit into
python:mainfrom
CS-cwhite:bugfix/SDX-12236-configure-std-c11

Conversation

@CS-cwhite

@CS-cwhite CS-cwhite commented May 7, 2025 •

Copy link
Copy Markdown

When compiling under gcc, configure.ac currently assumes -std=c11 rather than checking it. This causes configure to succeed but make to fail on old compilers. Fix this by adding a check for -std=c11 in configure.ac.

The changes to configure are the result of running Tools/build/regen-configure.sh.

Manual test on gcc 4.4.7:

Before:

$ ./configure
... (after it builds for a while)
gcc -std=gnu99 -pthread -c -fno-strict-overflow -Wsign-compare ...  -DPy_BUILD_CORE -o Parser/lexer/buffer.o Parser/lexer/buffer.c
cc1: error: unrecognized command line option "-std=c11"cc1: error: unrecognized command line option "-std=c11"

After:

$ ./configure
...
checking whether C compiler accepts -std=c11... no
configure: error: Python requires -std=c11 on gcc

Fixes #131093.

@python-cla-bot

python-cla-bot Bot commented May 7, 2025

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA signed

@CS-cwhite

CS-cwhite commented May 7, 2025 •

Copy link
Copy Markdown
Author

I previously signed the CLA on behalf of my organization, at the direction of the organization's legal department. Is there a way to tell CLA-bot to recognize that?

@AA-Turner

AA-Turner commented May 8, 2025 •

Copy link
Copy Markdown
Member

cc @ambv re CLA

@AA-Turner AA-Turner added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 8, 2025
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @AA-Turner for commit b4fbd36 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133608%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 8, 2025
@CS-cwhite

Copy link
Copy Markdown
Author

This is my first cpython PR, so I don't know --- do I have any action items from the build failures? E.g., Check if generated files are up to date appears to be checking C code, and this PR doesn't touch any C code. The failures don't appear to be related to this PR's changes, but I'm happy to work on fixes if they are!

@AA-Turner

Copy link
Copy Markdown
Member

We had some teething issues with the bump to 3.15, so I've updated the branch to check the failures aren't related. In general, you may find the Python Developer's Guide useful.

A

@ZeroIntensity ZeroIntensity added the build The build process and cross-build label May 11, 2025
@ZeroIntensity

Copy link
Copy Markdown
Member

I previously signed the CLA on behalf of my organization, at the direction of the organization's legal department.

I think redoing the commits with whatever email you signed with and then force-pushing should work.

…an make time

When compiling under gcc, configure.ac currently assumes -std=c11 rather
than checking it.  This causes configure to succeed but make to fail on
old compilers.  Fix this by adding a check for -std=c11 in configure.ac.
@CS-cwhite
CS-cwhite force-pushed the bugfix/SDX-12236-configure-std-c11 branch from f14b4f8 to bc5c9ed Compare May 12, 2025 15:26
@CS-cwhite

Copy link
Copy Markdown
Author

@ZeroIntensity Thanks! I checked, and the email is the same. However, the author name was different (it was "Chris White" in the commit but "Christopher White" on the CLA). I amended the commit to show the same name as the CLA in case that made a difference.

@AA-Turner

Copy link
Copy Markdown
Member

I've asked internally for advice.

A

@AA-Turner

AA-Turner commented May 12, 2025 •

Copy link
Copy Markdown
Member

@CS-cwhite, the advice I've had is that you should click the button to sign the CLA again. Sorry for the delay and the trouble this has caused. There's some more background/colour in #120171 (comment)

A

@@ -0,0 +1,3 @@
On GCC-compatible compilers, check at configure time that ``-std=c11``
works. This way you don't hit an "invalid option" error at make time on old

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.

Suggested change
works. This way you don't hit an "invalid option" error at make time on old
works. This way you don't hit an "invalid option" error at build time on old

@CS-cwhite

Copy link
Copy Markdown
Author

@AA-Turner Unfortunately, corporate legal says I am not permitted to sign the individual CLA, and that the organizational CLA must control my contributions.

@AA-Turner

Copy link
Copy Markdown
Member

I'll ask for advice.

@CS-cwhite

Copy link
Copy Markdown
Author

@AA-Turner Wondering if you've heard anything back. Thanks!

@AA-Turner

Copy link
Copy Markdown
Member

Yes, sorry; the best person to help/contact is Łukasz Langa (@ambv).

A

@CS-cwhite

Copy link
Copy Markdown
Author

@ambv Any thoughts? Thanks!

@CS-cwhite

Copy link
Copy Markdown
Author

@ambv @AA-Turner bump! Any word on getting the signed organizational CLA to cover this PR? Thanks for your help with this!

@AA-Turner

Copy link
Copy Markdown
Member

From this webpage, the relevant email appears to be legal@python.org, perhaps it might be worth trying that? I haven't personally heard any more updates since my last comment, though, sorry.

A

@CS-cwhite

Copy link
Copy Markdown
Author

I have emailed that address. Fingers crossed!

@CS-cwhite

Copy link
Copy Markdown
Author

@ambv Would you be willing to ask someone on the Legal mailing list if they received my email of 2025-06-17? I haven't heard back, but it's possible someone responded and the email got caught in a spam filter. Thanks for considering this request!

@CS-cwhite

Copy link
Copy Markdown
Author

I just sent another note to legal@ 🤞

@CS-cwhite

Copy link
Copy Markdown
Author

@ambv could you ask the PSF legal folks if they ever received my request for approval of this PR under the organizational CLA? I still haven't heard back, but I don't know if my messages to legal@ even made it through. Thanks!

@CS-cwhite

Copy link
Copy Markdown
Author

Any news? Thanks!

@ZeroIntensity

Copy link
Copy Markdown
Member

According to the comment that Adam linked (#120171 (comment)), we basically cannot accept a CLA without an individual signature. If CrowdStrike has an issue with you doing that, is it possible for you to open a new PR (possibly under a new GitHub account) with an email completely dissociated from CrowdStrike?

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 24, 2026
@CS-cwhite

Copy link
Copy Markdown
Author

Having not heard anything, I'm going to close this PR.

@CS-cwhite CS-cwhite closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review build The build process and cross-build stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure.ac assumes -std=c11 rather than checking it, which causes make failures on old compilers

5 participants