Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds#131866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…buildsWhen using --with-dtrace the resulting object file could be missingspecific CFLAGS exported by the build system due to the systemtapscript using specific defaults.Exporting the CC and CFLAGS variables before the dtrace invocationallows us to properly apply CFLAGS exported by the build systemeven when cross-compiling.The fix does not affect the dtrace invocation on Solaris/Oracle/MacOS
stratakis commentedMar 29, 2025
Unfortunately there are no buildbots testing --with-dtrace and dtrace itself is in a sort of half broken state as far as its functionality is concerned. However it is still an issue whenever someone uses --with-dtrace. I have verified through the Fedora build infrastructure that the fix works. Also this should not affect the dtrace builds when the actual dtrace tool is used in Solaris/Oracle/MacOS. A news entry is not required here I believe. |
vstinner left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
LGTM. The change works as expected.
Without this PR,make Include/pydtrace_probes.h SHELL="bash -x" prints:
+ /usr/bin/mkdir -p Include+ /usr/bin/dtrace -o Include/pydtrace_probes.h -h -s Include/pydtrace.dWith this PR, it prints:
+ /usr/bin/mkdir -p Include+ CC=gcc+ CFLAGS=+ /usr/bin/dtrace -o Include/pydtrace_probes.h -h -s Include/pydtrace.dCFLAGS is passed as expected. Example:
$ CFLAGS="-O2" make Include/pydtrace_probes.h SHELL="bash -x"(...)/usr/bin/mkdir -p IncludeCC="gcc" CFLAGS="-O2" /usr/bin/dtrace -o Include/pydtrace_probes.h -h -s Include/pydtrace.d(...)+ /usr/bin/mkdir -p Include+ CC=gcc+ CFLAGS=-O2+ /usr/bin/dtrace -o Include/pydtrace_probes.h -h -s Include/pydtrace.dNote: tests done with./configure --with-pydebug --with-dtrace.
vstinner commentedMar 31, 2025
It might be interesting to add a NEWS entry. |
vstinner commentedMar 31, 2025
For example, add a NEWS entry in the "Build" category: "DTrace build now pass properly CC and CFLAGS variables to the dtrace command." You can use the blurb tool for that. |
stratakis commentedMar 31, 2025
Added a NEWS entry |
Misc/NEWS.d/next/Build/2025-03-31-19-22-41.gh-issue-131865.PIJy7X.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
0cd4bef intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@stratakis for the PR, and@vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…builds (pythonGH-131866)When using --with-dtrace the resulting object file could be missingspecific CFLAGS exported by the build system due to the systemtapscript using specific defaults.Exporting the CC and CFLAGS variables before the dtrace invocationallows us to properly apply CFLAGS exported by the build systemeven when cross-compiling.The fix does not affect the dtrace invocation on Solaris/macOS.(cherry picked from commit0cd4bef)Co-authored-by: stratakis <cstratak@redhat.com>
GH-131950 is a backport of this pull request to the3.13 branch. |
stratakis commentedMar 31, 2025
Would it be possible to backport it on 3.12 as well? |
… builds (GH-131866) (#131950)gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866)When using --with-dtrace the resulting object file could be missingspecific CFLAGS exported by the build system due to the systemtapscript using specific defaults.Exporting the CC and CFLAGS variables before the dtrace invocationallows us to properly apply CFLAGS exported by the build systemeven when cross-compiling.The fix does not affect the dtrace invocation on Solaris/macOS.(cherry picked from commit0cd4bef)Co-authored-by: stratakis <cstratak@redhat.com>
Thanks@stratakis for the PR, and@vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
…builds (pythonGH-131866)When using --with-dtrace the resulting object file could be missingspecific CFLAGS exported by the build system due to the systemtapscript using specific defaults.Exporting the CC and CFLAGS variables before the dtrace invocationallows us to properly apply CFLAGS exported by the build systemeven when cross-compiling.The fix does not affect the dtrace invocation on Solaris/macOS.(cherry picked from commit0cd4bef)Co-authored-by: stratakis <cstratak@redhat.com>
GH-131951 is a backport of this pull request to the3.12 branch. |
vstinner commentedMar 31, 2025
Merged, thank you for your fix.
Done. I was awaiting to see if the 3.13 backport goes well first. |
… builds (GH-131866) (#131951)gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866)When using --with-dtrace the resulting object file could be missingspecific CFLAGS exported by the build system due to the systemtapscript using specific defaults.Exporting the CC and CFLAGS variables before the dtrace invocationallows us to properly apply CFLAGS exported by the build systemeven when cross-compiling.The fix does not affect the dtrace invocation on Solaris/macOS.(cherry picked from commit0cd4bef)Co-authored-by: stratakis <cstratak@redhat.com>
stratakis commentedMar 31, 2025
Thanks for merging! |
Uh oh!
There was an error while loading.Please reload this page.
When using --with-dtrace the resulting object file could be missing specific CFLAGS exported by the build system due to the systemtap script using specific defaults.
Exporting the CC and CFLAGS variables before the dtrace invocation allows us to properly apply CFLAGS exported by the build system even when cross-compiling.
The fix does not affect dtrace invocation on Solaris/Oracle/MacOS