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)
22302230# an include guard, so we can't use a pipeline to transform its output.
22312231Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
22322232 $(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
22342234 : sed in-place edit with POSIX-only tools
22352235 sed 's/PYTHON_/PyDTrace_/' $@ >
[email protected] 22362236@@ -2240,7 +2240,7 @@ Python/gc.o: $(srcdir)/Include/pydtrace.h
22402240Python/import.o: $(srcdir)/Include/pydtrace.h
22412241
22422242Python/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)
22442244
22452245Objects/typeobject.o: Objects/typeslots.inc
22462246
Original file line number Diff line number Diff line change @@ -5113,16 +5113,33 @@ then
51135113 # linked into the binary. Correspondingly, dtrace(1) is missing the ELF
51145114 # generation flag '-G'. We check for presence of this flag, rather than
51155115 # hardcoding support by OS, in the interest of robustness.
5116+ #
5117+ # NetBSD DTrace requires the -x nolibs flag to avoid system library conflicts
5118+ # and uses header generation for testing instead of object generation.
51165119 AC_CACHE_CHECK ( [ whether DTrace probes require linking] ,
5117- [ ac_cv_dtrace_link] , [ dnl
5120+ [ ac_cv_dtrace_link] , [
51185121 ac_cv_dtrace_link=no
51195122 echo 'BEGIN{}' > conftest.d
5120- "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
5123+ case $host in
5124+ *netbsd*)
5125+ DTRACE_TEST_FLAGS="-x nolibs -h"
5126+ ;;
5127+ *)
5128+ DTRACE_TEST_FLAGS="-G"
5129+ ;;
5130+ esac
5131+ "$DTRACE" $DFLAGS $DTRACE_TEST_FLAGS -s conftest.d -o conftest.o > /dev/null 2>&1 && \
51215132 ac_cv_dtrace_link=yes
51225133 ] )
51235134 if test "$ac_cv_dtrace_link" = "yes"; then
51245135 DTRACE_OBJS="Python/pydtrace.o"
51255136 fi
5137+ # Set NetBSD-specific DTrace flags in DFLAGS
5138+ case $host in
5139+ *netbsd*)
5140+ DFLAGS="$DFLAGS -x nolibs"
5141+ ;;
5142+ esac
51265143fi
51275144
51285145dnl Platform-specific C and header files.
You can’t perform that action at this time.
0 commit comments