Skip to content

gh-137056: Fix DTrace build support on NetBSD #137057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ Python/frozen.o: $(FROZEN_FILES_OUT)
# an include guard, so we can't use a pipeline to transform its output.
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
$(MKDIR_P) Include
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $<
CC="$(CC)" CFLAGS="$(CFLAGS)" $(DTRACE) $(DFLAGS) -o $@ -h -s $(srcdir)/Include/pydtrace.d
: sed in-place edit with POSIX-only tools
sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
mv $@.tmp $@
Expand All @@ -2259,7 +2259,7 @@ Python/gc.o: $(srcdir)/Include/pydtrace.h
Python/import.o: $(srcdir)/Include/pydtrace.h

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

Objects/typeobject.o: Objects/typeslots.inc

Expand Down
22 changes: 20 additions & 2 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5104,16 +5104,33 @@ then
# linked into the binary. Correspondingly, dtrace(1) is missing the ELF
# generation flag '-G'. We check for presence of this flag, rather than
# hardcoding support by OS, in the interest of robustness.
#
# NetBSD DTrace requires the -x nolibs flag to avoid system library conflicts
# and uses header generation for testing instead of object generation.
AC_CACHE_CHECK([whether DTrace probes require linking],
[ac_cv_dtrace_link], [dnl
[ac_cv_dtrace_link], [
ac_cv_dtrace_link=no
echo 'BEGIN{}' > conftest.d
"$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
case $host in
*netbsd*)
DTRACE_TEST_FLAGS="-x nolibs -h"
;;
*)
DTRACE_TEST_FLAGS="-G"
;;
esac
"$DTRACE" $DFLAGS $DTRACE_TEST_FLAGS -s conftest.d -o conftest.o > /dev/null 2>&1 && \
ac_cv_dtrace_link=yes
])
if test "$ac_cv_dtrace_link" = "yes"; then
DTRACE_OBJS="Python/pydtrace.o"
fi
# Set NetBSD-specific DTrace flags in DFLAGS
case $host in
*netbsd*)
DFLAGS="$DFLAGS -x nolibs"
;;
esac
fi

dnl Platform-specific C and header files.
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy