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 @@ -2230,7 +2230,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
2230
2230
# an include guard, so we can't use a pipeline to transform its output.
2231
2231
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
2232
2232
$(MKDIR_P) Include
2233
- CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
2233
+ CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $(srcdir)/Include/pydtrace.d
2234
2234
: sed in-place edit with POSIX-only tools
2235
2235
sed 's/PYTHON_/PyDTrace_/' $@ >
[email protected]
2236
2236
@@ -2240,7 +2240,7 @@ Python/gc.o: $(srcdir)/Include/pydtrace.h
2240
2240
Python/import.o: $(srcdir)/Include/pydtrace.h
2241
2241
2242
2242
Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
2243
- CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
2243
+ CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -G -s $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
2244
2244
2245
2245
Objects/typeobject.o: Objects/typeslots.inc
2246
2246
Original file line number Diff line number Diff line change @@ -5104,16 +5104,33 @@ then
5104
5104
# linked into the binary. Correspondingly, dtrace(1) is missing the ELF
5105
5105
# generation flag '-G'. We check for presence of this flag, rather than
5106
5106
# hardcoding support by OS, in the interest of robustness.
5107
+ #
5108
+ # NetBSD DTrace requires the -x nolibs flag to avoid system library conflicts
5109
+ # and uses header generation for testing instead of object generation.
5107
5110
AC_CACHE_CHECK ( [ whether DTrace probes require linking] ,
5108
- [ ac_cv_dtrace_link] , [ dnl
5111
+ [ ac_cv_dtrace_link] , [
5109
5112
ac_cv_dtrace_link=no
5110
5113
echo 'BEGIN{}' > conftest.d
5111
- "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
5114
+ case $host in
5115
+ *netbsd*)
5116
+ DTRACE_TEST_FLAGS="-x nolibs -h"
5117
+ ;;
5118
+ *)
5119
+ DTRACE_TEST_FLAGS="-G"
5120
+ ;;
5121
+ esac
5122
+ "$DTRACE" $DFLAGS $DTRACE_TEST_FLAGS -s conftest.d -o conftest.o > /dev/null 2>&1 && \
5112
5123
ac_cv_dtrace_link=yes
5113
5124
] )
5114
5125
if test "$ac_cv_dtrace_link" = "yes"; then
5115
5126
DTRACE_OBJS="Python/pydtrace.o"
5116
5127
fi
5128
+ # Set NetBSD-specific DTrace flags in DFLAGS
5129
+ case $host in
5130
+ *netbsd*)
5131
+ DFLAGS="$DFLAGS -x nolibs"
5132
+ ;;
5133
+ esac
5117
5134
fi
5118
5135
5119
5136
dnl Platform-specific C and header files.
You can’t perform that action at this time.
0 commit comments