Skip to content

Commit 0a04127

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 545690d commit 0a04127

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
@@ -1453,7 +1453,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
14531453
# an include guard, so we can't use a pipeline to transform its output.
14541454
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
14551455
$(MKDIR_P) Include
1456-
$(DTRACE) $(DFLAGS) -o $@ -h -s $<
1456+
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
14571457
: sed in-place edit with POSIX-only tools
14581458
sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
14591459
mv $@.tmp $@
@@ -1463,7 +1463,7 @@ Python/import.o: $(srcdir)/Include/pydtrace.h
14631463
Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h
14641464

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

14681468
Objects/typeobject.o: Objects/typeslots.inc
14691469

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)