While working on netcore debugger for mono,the crash was happening.
This crash was due to an invalid pointer to the free(). Valgrind
was showing the traces of mismatch between the new() and delete().
After debugging the issue, even though hidden flag was set on
shared library the objdump on the shared library showed that
the overloaded new() operator was taken from a local scoped library
but overloaded delete() operator was overidden by defaults setting
of underlying system libraries in which delete() was hosted.
Changed the fvisibility flag to ensure that clang picks up the
local new() and delete() overloaded operators.
Co-authored-by: Giridhar Trivedi <giridhar.trivedi@ibm.com>
set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "")
set(CLR_CMAKE_HOST_ARCH ${CMAKE_GENERATOR_PLATFORM})
set(FEATURE_EVENT_TRACE 0)
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ add_definitions(-fvisibility-global-new-delete-hidden)
+endif()
if(HOST_WIN32)
if(HOST_X86)