jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python37 / patches / 00-dtrace.patch
blobd92b25ccf3fab36340c2dea27ca572af4356c084
1 This patch fixes several issues with dtrace on Solaris.
3 Dtrace is hardcoded into compilers (and therefore works by default) on some
4 platforms and needs additional steps on others. Configure script incorrectly
5 detected this property.
7 Rest of the Makefile wasn't entirely ready for dtrace compilation on Solaris.
9 This patch was offered upstream:
10 https://bugs.python.org/issue35520
12 --- Python-3.7.5/configure
13 +++ Python-3.7.5/configure
14 @@ -11376,7 +11376,7 @@ if ${ac_cv_dtrace_link+:} false; then :
15 $as_echo_n "(cached) " >&6
16 else
17 ac_cv_dtrace_link=no
18 - echo 'BEGIN' > conftest.d
19 + echo 'BEGIN{}' > conftest.d
20 "$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
21 ac_cv_dtrace_link=yes
23 --- Python-3.7.5/configure.ac
24 +++ Python-3.7.5/configure.ac
25 @@ -3490,7 +3490,7 @@ then
26 AC_CACHE_CHECK([whether DTrace probes require linking],
27 [ac_cv_dtrace_link], [dnl
28 ac_cv_dtrace_link=no
29 - echo 'BEGIN' > conftest.d
30 + echo 'BEGIN{}' > conftest.d
31 "$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
32 ac_cv_dtrace_link=yes
34 --- Python-3.7.5/Makefile.pre.in
35 +++ Python-3.7.5/Makefile.pre.in
36 @@ -454,8 +454,7 @@ LIBRARY_OBJS= \
37 # On some systems, object files that reference DTrace probes need to be modified
38 # in-place by dtrace(1).
39 DTRACE_DEPS = \
40 - Python/ceval.o
41 -# XXX: should gcmodule, etc. be here, too?
42 + Python/ceval.o Python/import.o Modules/gcmodule.o
44 #########################################################################
45 # Rules
46 @@ -631,7 +630,7 @@ $(LIBRARY): $(LIBRARY_OBJS)
47 -rm -f $@
48 $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
50 -libpython$(LDVERSION).so: $(LIBRARY_OBJS)
51 +libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
52 if test $(INSTSONAME) != $(LDLIBRARY); then \
53 $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
54 $(LN) -f $(INSTSONAME) $@; \
55 @@ -642,8 +641,8 @@ libpython$(LDVERSION).so: $(LIBRARY_OBJS
56 libpython3.so: libpython$(LDVERSION).so
57 $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
59 -libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
60 - $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
61 +libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) $(DTRACE_OBJS)
62 + $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
65 libpython$(VERSION).sl: $(LIBRARY_OBJS)
66 @@ -759,6 +758,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
67 $(PYTHON_OBJS) \
68 $(MODULE_OBJS) \
69 $(MODOBJS) \
70 + $(DTRACE_OBJS) \
71 $(srcdir)/Modules/getbuildinfo.c
72 $(CC) -c $(PY_CORE_CFLAGS) \
73 -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
74 @@ -929,6 +929,10 @@ Include/pydtrace_probes.h: $(srcdir)/Inc
75 sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
76 mv $@.tmp $@
78 +Python/ceval.o: Include/pydtrace.h
79 +Python/import.o: Include/pydtrace.h
80 +Modules/gcmodule.o: Include/pydtrace.h
82 Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
83 $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)