Skip to content

gh-136677: Introduce executable specific linker flags to configure#137296

Merged
FFY00 merged 7 commits intopython:mainfrom
rueteh:136677-exe-ldflags
Feb 24, 2026
Merged

gh-136677: Introduce executable specific linker flags to configure#137296
FFY00 merged 7 commits intopython:mainfrom
rueteh:136677-exe-ldflags

Conversation

@rueteh
Copy link
Contributor

@rueteh rueteh commented Aug 1, 2025

Introduce two new flags EXE_LDFLAGS and PY_CORE_EXE_LDFLAGS to contain executable target specific linker options for building the python interpreter as well as other executables.

Notes

If provided, this effectively means that PY_CORE_LDFLAGS (as well as the chain of flags used by this variable) is exclusively used to build shared libraries / bundles. In addition, any common linker flags applicable to both types of targets would also need to be supplied to EXE_LDFLAGS and LDFLAGS.


📚 Documentation preview 📚: https://cpython-previews--137296.org.readthedocs.build/

rueteh added 3 commits July 20, 2025 23:33
Add PY_CORE_EXE_LDFLAGS and EXE_LDFLAGS which stores executable specific
LDFLAGS, replacing PY_CORE_LDFLAGS for building
executable targets.

If PY_CORE_EXE_LDFLAGS / EXE_LDFLAGS is not provided, then it defaults
to the value of PY_CORE_LDFLAGS which is the existing behaviour.

If both flags are supplied, and there is a need
to distinguish between executable and shared specific LDFLAGS,
in particular, PY_CORE_LDFLAGS should contain the shared specific LDFLAGS.
@python-cla-bot
Copy link

python-cla-bot bot commented Aug 1, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@rueteh rueteh marked this pull request as ready for review August 1, 2025 07:18
Copy link
Member

@FFY00 FFY00 left a comment

Choose a reason for hiding this comment

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

@rueteh thanks for the PR!

It looks alright to me, but perhaps @vstinner could have an extra look before merging 😊

Co-authored-by: Victor Stinner <vstinner@python.org>
@FFY00 FFY00 enabled auto-merge (squash) February 24, 2026 21:34
This reverts commit 8638770.

Signed-off-by: Filipe Laíns <lains@riseup.net>
@FFY00 FFY00 merged commit 4e45c9c into python:main Feb 24, 2026
50 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 FreeBSD Refleaks 3.x (tier-3) has failed when building commit 4e45c9c.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1613/builds/2905) and take a look at the build logs.
  4. Check if the failure is related to this commit (4e45c9c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1613/builds/2905

Test leaking resources:

  • test_events: references
  • test_events: memory blocks

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/test/support/__init__.py", line 947, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=10, family=2, type=1, proto=6, laddr=('127.0.0.1', 25902), raddr=('127.0.0.1', 25903)>
Task was destroyed but it is pending!
task: <Task pending name='Task-3624' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py:217> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x8455fcb90>:
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py", line 873, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=10>
k


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/test/support/__init__.py", line 947, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('127.0.0.1', 39196), raddr=('127.0.0.1', 39197)>
Task was destroyed but it is pending!
task: <Task pending name='Task-2445' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py:217> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x840397650>:
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py", line 873, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=9>
k

@FFY00
Copy link
Member

FFY00 commented Feb 25, 2026

It seems like test_regrtest is failing on the buildbot with ENV_CHANGED. I don't think is related to this, but let's keep an eye on main.

@FFY00
Copy link
Member

FFY00 commented Feb 25, 2026

Seems to be fine.

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.

4 participants