10000 [3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap… · python/cpython@b87ea7d · GitHub
[go: up one dir, main page]

Skip to content

Commit b87ea7d

Browse files
[3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap 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 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>
1 parent 5d4e891 commit b87ea7d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Makefile.pre.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
15741574
# an include guard, so we can't use a pipeline to transform its output.
15751575
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
15761576
$(MKDIR_P) Include
1577-
$(DTRACE) $(DFLAGS) -o $@ -h -s $<
1577+
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
15781578
: sed in-place edit with POSIX-only tools
15791579
sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
15801580
mv $@.tmp $@
@@ -1584,7 +1584,7 @@ Python/import.o: $(srcdir)/Include/pydtrace.h
15841584
Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h
15851585

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

15891589
Objects/typeobject.o: Objects/typeslots.inc
15901590

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The DTrace build now properly passes the ``CC`` and ``CFLAGS`` variables
2+
to the ``dtrace`` command when utilizing SystemTap on Linux.

0 commit comments

Comments
 (0)
0