8000 [3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866) by miss-islington · Pull Request #131951 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866) #131951

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (
…GH-131866)

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 the dtrace invocation on Solaris/macOS.
(cherry picked from commit 0cd4bef)

Co-authored-by: stratakis <cstratak@redhat.com>
  • Loading branch information
stratakis authored and miss-islington committed Mar 31, 2025
commit b82e92c06b8d80cab05523fb823239f6f02391a0
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
# an include guard, so we can't use a pipeline to transform its output.
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
$(MKDIR_P) Include
$(DTRACE) $(DFLAGS) -o $@ -h -s $<
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
: sed in-place edit with POSIX-only tools
sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
mv $@.tmp $@
Expand All @@ -1584,7 +1584,7 @@ Python/import.o: $(srcdir)/Include/pydtrace.h
Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h

Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
$(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)

Objects/typeobject.o: Objects/typeslots.inc

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The DTrace build now properly passes the ``CC`` and ``CFLAGS`` variables
to the ``dtrace`` command when utilizing SystemTap on Linux.
Loading
0