Skip to content

Commit 70461ee

Browse files
miss-islingtonstratakis
authored andcommitted
00452: Properly apply exported CFLAGS for dtrace/systemtap builds
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. Co-authored-by: stratakis <cstratak@redhat.com>
1 parent a29ee24 commit 70461ee

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
@@ -989,7 +989,7 @@ Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_externa
989989
# an include guard, so we can't use a pipeline to transform its output.
990990
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
991991
$(MKDIR_P) Include
992-
$(DTRACE) $(DFLAGS) -o $@ -h -s $<
992+
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
993993
: sed in-place edit with POSIX-only tools
994994
sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
995995
mv $@.tmp $@
@@ -999,7 +999,7 @@ Python/import.o: $(srcdir)/Include/pydtrace.h
999999
Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h
10001000

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

10041004
Objects/typeobject.o: Objects/typeslots.inc
10051005

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)