FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-127604: ensure `-ldl` is passed to the linker when `dladdr1` is found by picnixz · Pull Request #133040 · python/cpython · GitHub

/ cpython Public

gh-127604: ensure -ldl is passed to the linker when dladdr1 is found - #133040

Merged
picnixz merged 7 commits into
python:mainfrom
picnixz:fix/configure/backtrace-ldflags-127604
Apr 27, 2025
Merged

gh-127604: ensure -ldl is passed to the linker when dladdr1 is found#133040
picnixz merged 7 commits into
python:mainfrom
picnixz:fix/configure/backtrace-ldflags-127604

Conversation

picnixz commented Apr 27, 2025
edited
Loading

Copy link
Copy Markdown
Member

picnixz changed the title gh-127605: ensure -ldl is passed to the linker when dladdr1 is found gh-127604: ensure -ldl is passed to the linker when dladdr1 is found Apr 27, 2025
picnixz requested a review from ZeroIntensity April 27, 2025 10:13

ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, but let's run buildbots to make sure we didn't break anything.

ZeroIntensity added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 27, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit 3d22310 🤖

Results will be shown at:

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

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

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 27, 2025
Comment thread configure.ac Outdated
Comment thread Doc/library/faulthandler.rst Outdated
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
picnixz merged commit 2443662 into python:main Apr 27, 2025
picnixz deleted the fix/configure/backtrace-ldflags-127604 branch April 27, 2025 22:28

Copy link
Copy Markdown
Contributor

@picnixz This seems to have resulted in the -ldl argument being included twice on macOS and iOS builds. It's not causing an error, but it is raising a lot of compiler warnings

Copy link
Copy Markdown
Contributor

Looks like it's not just macOS and iOS; Ubuntu builds now include compilation statements like gcc -shared -ldl -ldl -ldl -ldl -ldl -ldl .... It doesn't look like GCC is complaining... but I think dl might be linked. 🤣

picnixz commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

Aaaaaah I don't understand:( Why would it include it twice I'll investigate

picnixz commented Apr 28, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

Instead of adding it to all LDLFLAGS, I'll only add it the LDLFLAGS for faulthandler

Mmh, it's actually in Python/traceback.c. A bit more annoying.

picnixz commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

Hum. I also forgot removing defined(HAVE_BACKTRACE_SYMBOLS) after Victor told me that backtrace_symbols wasn't used.

Copy link
Copy Markdown
Member

faulthandler is built as a built-in module, since Py_FatalError() uses it (dump the backtrace and than turns off faulthandler).

picnixz commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

I found the issue. Because of AC_CHECK_HEADERS + AC_CHECK_FUNCS, we actually expand LDFLAGS 2x3=6 times, hence the 6 -ldl -ldl -ldl -ldl -ldl -ldl.

picnixz commented Apr 28, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

PR is ready: #133071.

It doesn't look like GCC is complaining... but I think dl might be linked. 🤣

And yes, that's why I didn't see the warnings. I use gcc and not clang

Copy link
Copy Markdown
Member

I was wondering if autoreconf was smart enough to deal with the extra flags. Buildbots passed so I figured it was ok :(.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL