Skip to content

Commit cce59ac

Browse files
committed
Resolve Python runtime symbols.
1 parent 213f81c commit cce59ac

File tree

2 files changed

+77
-4
lines changed

2 files changed

+77
-4
lines changed

ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if(LIB_INSTALL_DIR)
8181
endif()
8282

8383
# Crashtracker receiver binary
84-
add_executable(crashtracker_exe src/crashtracker.cpp)
84+
add_executable(crashtracker_exe src/crashtracker.cpp python_runtime_stub.c)
8585
target_include_directories(crashtracker_exe PRIVATE .. ${Datadog_INCLUDE_DIRS})
8686

8787
# The CRASHTRACKER_EXE_TARGET_NAME should have been set by dd_wrapper
@@ -100,9 +100,6 @@ elseif(UNIX)
100100
set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
101101
endif()
102102

103-
target_link_options(crashtracker_exe PRIVATE -Wl,--no-as-needed)
104-
target_link_libraries(crashtracker_exe PRIVATE ${Python3_LIBRARIES})
105-
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
106103
target_link_libraries(crashtracker_exe PRIVATE dd_wrapper)
107104

108105
# See the dd_wrapper CMakeLists.txt for a more detailed explanation of why we do what we do.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
__attribute__((weak)) void* PyObject_Repr = 0;
2+
__attribute__((weak)) void* PyExc_ValueError = 0;
3+
__attribute__((weak)) void* PyErr_GetRaisedException = 0;
4+
__attribute__((weak)) void* PyLong_FromSsize_t = 0;
5+
__attribute__((weak)) void* PyObject_GenericGetDict = 0;
6+
__attribute__((weak)) void* PyType_GetName = 0;
7+
__attribute__((weak)) void* PyBool_Type = 0;
8+
__attribute__((weak)) void* PyObject_GetAttr = 0;
9+
__attribute__((weak)) void* _Py_TrueStruct = 0;
10+
__attribute__((weak)) void* PyObject_Str = 0;
11+
__attribute__((weak)) void* PyType_FromSpec = 0;
12+
__attribute__((weak)) void* PyType_IsSubtype = 0;
13+
__attribute__((weak)) void* PyDict_SetItem = 0;
14+
__attribute__((weak)) void* PyTuple_New = 0;
15+
__attribute__((weak)) void* PyObject_SetAttr = 0;
16+
__attribute__((weak)) void* PyEval_RestoreThread = 0;
17+
__attribute__((weak)) void* _Py_NoneStruct = 0;
18+
__attribute__((weak)) void* PyExc_AttributeError = 0;
19+
__attribute__((weak)) void* PyException_SetTraceback = 0;
20+
__attribute__((weak)) void* PyList_Append = 0;
21+
__attribute__((weak)) void* PyInterpreterState_GetID = 0;
22+
__attribute__((weak)) void* PyBytes_FromStringAndSize = 0;
23+
__attribute__((weak)) void* PyUnicode_EqualToUTF8AndSize = 0;
24+
__attribute__((weak)) void* PyDict_Next = 0;
25+
__attribute__((weak)) void* PyException_GetTraceback = 0;
26+
__attribute__((weak)) void* PyErr_SetObject = 0;
27+
__attribute__((weak)) void* PyType_GenericAlloc = 0;
28+
__attribute__((weak)) void* PyType_GetModuleName = 0;
29+
__attribute__((weak)) void* PyFloat_FromDouble = 0;
30+
__attribute__((weak)) void* PyFloat_AsDouble = 0;
31+
__attribute__((weak)) void* _Py_Dealloc = 0;
32+
__attribute__((weak)) void* PyList_New = 0;
33+
__attribute__((weak)) void* PyType_GetQualName = 0;
34+
__attribute__((weak)) void* PyBytes_Size = 0;
35+
__attribute__((weak)) void* PyObject_DelItem = 0;
36+
__attribute__((weak)) void* PyErr_PrintEx = 0;
37+
__attribute__((weak)) void* PyDict_New = 0;
38+
__attribute__((weak)) void* PyErr_SetString = 0;
39+
__attribute__((weak)) void* PyExc_Exception = 0;
40+
__attribute__((weak)) void* PyObject_SetItem = 0;
41+
__attribute__((weak)) void* PyUnicode_InternInPlace = 0;
42+
__attribute__((weak)) void* PyErr_SetRaisedException = 0;
43+
__attribute__((weak)) void* PyObject_SetAttrString = 0;
44+
__attribute__((weak)) void* PyGILState_Release = 0;
45+
__attribute__((weak)) void* PyExc_RuntimeError = 0;
46+
__attribute__((weak)) void* PyExc_BaseException = 0;
47+
__attribute__((weak)) void* PyBytes_AsString = 0;
48+
__attribute__((weak)) void* PyObject_GenericSetDict = 0;
49+
__attribute__((weak)) void* PyBaseObject_Type = 0;
50+
__attribute__((weak)) void* PyObject_GetItem = 0;
51+
__attribute__((weak)) void* PyExc_TypeError = 0;
52+
__attribute__((weak)) void* PyEval_SaveThread = 0;
53+
__attribute__((weak)) void* PyObject_GC_UnTrack = 0;
54+
__attribute__((weak)) void* PyErr_WriteUnraisable = 0;
55+
__attribute__((weak)) void* PyModule_Create2 = 0;
56+
__attribute__((weak)) void* PyTraceBack_Print = 0;
57+
__attribute__((weak)) void* PyUnicode_AsEncodedString = 0;
58+
__attribute__((weak)) void* PyErr_NewExceptionWithDoc = 0;
59+
__attribute__((weak)) void* PyFloat_Type = 0;
60+
__attribute__((weak)) void* PyObject_CallNoArgs = 0;
61+
__attribute__((weak)) void* PyExc_SystemError = 0;
62+
__attribute__((weak)) void* PyExc_ImportError = 0;
63+
__attribute__((weak)) void* PyInterpreterState_Get = 0;
64+
__attribute__((weak)) void* PyUnicode_AsUTF8AndSize = 0;
65+
__attribute__((weak)) void* PyGILState_Ensure = 0;
66+
__attribute__((weak)) void* PyException_GetCause = 0;
67+
__attribute__((weak)) void* PyCMethod_New = 0;
68+
__attribute__((weak)) void* PyErr_Print = 0;
69+
__attribute__((weak)) void* PyImport_Import = 0;
70+
__attribute__((weak)) void* PyException_SetCause = 0;
71+
__attribute__((weak)) void* PyErr_GivenExceptionMatches = 0;
72+
__attribute__((weak)) void* Py_IsInitialized = 0;
73+
__attribute__((weak)) void* PyUnicode_FromStringAndSize = 0;
74+
__attribute__((weak)) void* PyErr_NormalizeException = 0;
75+
__attribute__((weak)) void* PyErr_Restore = 0;
76+
__attribute__((weak)) void* PyErr_Fetch = 0;

0 commit comments

Comments
 (0)