Skip to content

Commit aabdeb7

Browse files
David Carlierencukou
authored andcommitted
bpo-38960: DTrace build fix for FreeBSD. (GH-17451)
DTrace build fix for FreeBSD. - allowing passing an extra flag as it need to define the arch size. - casting some probe's arguments.
1 parent 2cca8ef commit aabdeb7

6 files changed

Lines changed: 9 additions & 10 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix DTrace build issues on FreeBSD. Patch by David Carlier.

Python/ceval.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5447,7 +5447,7 @@ dtrace_function_entry(PyFrameObject *f)
54475447
funcname = PyUnicode_AsUTF8(f->f_code->co_name);
54485448
lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
54495449

5450-
PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);
5450+
PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
54515451
}
54525452

54535453
static void
@@ -5461,7 +5461,7 @@ dtrace_function_return(PyFrameObject *f)
54615461
funcname = PyUnicode_AsUTF8(f->f_code->co_name);
54625462
lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
54635463

5464-
PyDTrace_FUNCTION_RETURN(filename, funcname, lineno);
5464+
PyDTrace_FUNCTION_RETURN((char *)filename, (char *)funcname, lineno);
54655465
}
54665466

54675467
/* DTrace equivalent of maybe_call_line_trace. */
@@ -5493,7 +5493,7 @@ maybe_dtrace_line(PyFrameObject *frame,
54935493
co_name = PyUnicode_AsUTF8(frame->f_code->co_name);
54945494
if (!co_name)
54955495
co_name = "?";
5496-
PyDTrace_LINE(co_filename, co_name, line);
5496+
PyDTrace_LINE((char *)co_filename, (char *)co_name, line);
54975497
}
54985498
*instr_prev = frame->f_lasti;
54995499
}

Python/import.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,14 +1762,14 @@ import_find_and_load(PyThreadState *tstate, PyObject *abs_name)
17621762
}
17631763

17641764
if (PyDTrace_IMPORT_FIND_LOAD_START_ENABLED())
1765-
PyDTrace_IMPORT_FIND_LOAD_START(PyUnicode_AsUTF8(abs_name));
1765+
PyDTrace_IMPORT_FIND_LOAD_START((char *)PyUnicode_AsUTF8(abs_name));
17661766

17671767
mod = _PyObject_CallMethodIdObjArgs(interp->importlib,
17681768
&PyId__find_and_load, abs_name,
17691769
interp->import_func, NULL);
17701770

17711771
if (PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED())
1772-
PyDTrace_IMPORT_FIND_LOAD_DONE(PyUnicode_AsUTF8(abs_name),
1772+
PyDTrace_IMPORT_FIND_LOAD_DONE((char *)PyUnicode_AsUTF8(abs_name),
17731773
mod != NULL);
17741774

17751775
if (import_time) {

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ PySys_Audit(const char *event, const char *argFormat, ...)
204204

205205
/* Dtrace USDT point */
206206
if (dtrace) {
207-
PyDTrace_AUDIT(event, (void *)eventArgs);
207+
PyDTrace_AUDIT((char *)event, (void *)eventArgs);
208208
}
209209

210210
/* Call interpreter hooks */

configure

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11386,7 +11386,6 @@ $as_echo "$with_dtrace" >&6; }
1138611386

1138711387

1138811388
DTRACE=
11389-
DFLAGS=
1139011389
DTRACE_HEADERS=
1139111390
DTRACE_OBJS=
1139211391

@@ -11452,7 +11451,7 @@ if ${ac_cv_dtrace_link+:} false; then :
1145211451
else
1145311452
ac_cv_dtrace_link=no
1145411453
echo 'BEGIN{}' > conftest.d
11455-
"$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
11454+
"$DTRACE" "$DFLAGS" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
1145611455
ac_cv_dtrace_link=yes
1145711456

1145811457
fi

configure.ac

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,7 +3500,6 @@ AC_SUBST(DFLAGS)
35003500
AC_SUBST(DTRACE_HEADERS)
35013501
AC_SUBST(DTRACE_OBJS)
35023502
DTRACE=
3503-
DFLAGS=
35043503
DTRACE_HEADERS=
35053504
DTRACE_OBJS=
35063505

@@ -3521,7 +3520,7 @@ then
35213520
[ac_cv_dtrace_link], [dnl
35223521
ac_cv_dtrace_link=no
35233522
echo 'BEGIN{}' > conftest.d
3524-
"$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
3523+
"$DTRACE" "$DFLAGS" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
35253524
ac_cv_dtrace_link=yes
35263525
])
35273526
if test "$ac_cv_dtrace_link" = "yes"; then

0 commit comments

Comments
 (0)