Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29b958a

Browse files
[3.13] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap 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 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 <[email protected]>
1 parent d52371c commit 29b958a

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
@@ -1998,7 +1998,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
19981998
# an include guard, so we can't use a pipeline to transform its output.
19991999
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
20002000
$(MKDIR_P) Include
2001-
$(DTRACE) $(DFLAGS) -o $@ -h -s $<
2001+
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
20022002
: sed in-place edit with POSIX-only tools
20032003
sed 's/PYTHON_/PyDTrace_/' $@ > [email protected]
20042004
@@ -2008,7 +2008,7 @@ Python/gc.o: $(srcdir)/Include/pydtrace.h
20082008
Python/import.o: $(srcdir)/Include/pydtrace.h
20092009

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

20132013
Objects/typeobject.o: Objects/typeslots.inc
20142014

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)