File tree Expand file tree Collapse file tree 3 files changed +41
-6
lines changed Expand file tree Collapse file tree 3 files changed +41
-6
lines changed Original file line number Diff line number Diff line change @@ -2004,7 +2004,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
2004
2004
# an include guard, so we can't use a pipeline to transform its output.
2005
2005
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
2006
2006
$(MKDIR_P) Include
2007
- CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
2007
+ CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $(srcdir)/Include/pydtrace.d
2008
2008
: sed in-place edit with POSIX-only tools
2009
2009
sed 's/PYTHON_/PyDTrace_/' $@ >
[email protected]
2010
2010
@@ -2014,7 +2014,7 @@ Python/gc.o: $(srcdir)/Include/pydtrace.h
2014
2014
Python/import.o: $(srcdir)/Include/pydtrace.h
2015
2015
2016
2016
Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
2017
- CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
2017
+ CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -G -s $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
2018
2018
2019
2019
Objects/typeobject.o: Objects/typeslots.inc
2020
2020
Original file line number Diff line number Diff line change @@ -5099,16 +5099,33 @@ then
5099
5099
# linked into the binary. Correspondingly, dtrace(1) is missing the ELF
5100
5100
# generation flag '-G'. We check for presence of this flag, rather than
5101
5101
# hardcoding support by OS, in the interest of robustness.
5102
+ #
5103
+ # NetBSD DTrace requires the -x nolibs flag to avoid system library conflicts
5104
+ # and uses header generation for testing instead of object generation.
5102
5105
AC_CACHE_CHECK ( [ whether DTrace probes require linking] ,
5103
- [ ac_cv_dtrace_link] , [ dnl
5106
+ [ ac_cv_dtrace_link] , [
5104
5107
ac_cv_dtrace_link=no
5105
5108
echo 'BEGIN{}' > conftest.d
5106
- "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
5109
+ case $host in
5110
+ *netbsd*)
5111
+ DTRACE_TEST_FLAGS="-x nolibs -h"
5112
+ ;;
5113
+ *)
5114
+ DTRACE_TEST_FLAGS="-G"
5115
+ ;;
5116
+ esac
5117
+ "$DTRACE" $DFLAGS $DTRACE_TEST_FLAGS -s conftest.d -o conftest.o > /dev/null 2>&1 && \
5107
5118
ac_cv_dtrace_link=yes
5108
5119
] )
5109
5120
if test "$ac_cv_dtrace_link" = "yes"; then
5110
5121
DTRACE_OBJS="Python/pydtrace.o"
5111
5122
fi
5123
+ # Set NetBSD-specific DTrace flags in DFLAGS
5124
+ case $host in
5125
+ *netbsd*)
5126
+ DFLAGS="$DFLAGS -x nolibs"
5127
+ ;;
5128
+ esac
5112
5129
fi
5113
5130
5114
5131
dnl Platform-specific C and header files.
You can’t perform that action at this time.
0 commit comments