@@ -608,23 +608,6 @@ def get_exts_for(name):
608
608
609
609
extra_libraries = []
610
610
if not IS_PYSTON :
611
- # To make it easier to mix C and C++ for the memalloc extension,
612
- # we build the C++ part as a separate static library and link it into the extension.
613
- if CURRENT_OS != "Windows" :
614
- # Shot in the dark, but try setting the archiver explicitly
615
- # here so that it can be resolved via the PATH at runtime?
616
- # Just in case the sysconfig for the Python interpreter points
617
- # to a weird archiver installation...
618
- os .environ ["AR" ] = "ar"
619
- memalloc_map_lib = (
620
- "memalloc_map" ,
621
- {
622
- "sources" : ["ddtrace/profiling/collector/_memalloc_heap_map.cpp" ],
623
- "include_dirs" : [get_python_inc ()],
624
- "cflags" : (debug_compile_args + (["-std=c++17" ] if CURRENT_OS != "Windows" else ["/std:c++17" ])),
625
- },
626
- )
627
- extra_libraries .append (memalloc_map_lib )
628
611
ext_modules = [
629
612
Extension (
630
613
"ddtrace.profiling.collector._memalloc" ,
@@ -633,17 +616,17 @@ def get_exts_for(name):
633
616
"ddtrace/profiling/collector/_memalloc_tb.c" ,
634
617
"ddtrace/profiling/collector/_memalloc_heap.c" ,
635
618
"ddtrace/profiling/collector/_memalloc_reentrant.c" ,
619
+ "ddtrace/profiling/collector/_memalloc_heap_map.cpp" ,
636
620
],
637
621
depends = ["ddtrace/profiling/collector/_memalloc_heap_map.h" ],
638
- libraries = ["memalloc_map" ] + (["stdc++" ] if CURRENT_OS != "Windows" else [])
639
622
extra_compile_args = (
640
623
debug_compile_args
641
624
# If NDEBUG is set, assert statements are compiled out. Make
642
625
# sure we explicitly set this for normal builds, and explicitly
643
626
# _unset_ it for debug builds in case the CFLAGS from sysconfig
644
627
# include -DNDEBUG
645
628
+ (["-DNDEBUG" ] if not debug_compile_args else ["-UNDEBUG" ])
646
- + ["-D_POSIX_C_SOURCE=200809L" , "-std=c11" ]
629
+ + ["-D_POSIX_C_SOURCE=200809L" ]
647
630
+ fast_build_args
648
631
if CURRENT_OS != "Windows"
649
632
else ["/std:c11" ]
0 commit comments