Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/hosts/corerun/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ endif(CLR_CMAKE_HOST_WIN32)
#Required to expose symbols for global symbol discovery.
set(CLR_CMAKE_KEEP_NATIVE_SYMBOLS TRUE)

if (CLR_CMAKE_HOST_APPLE)
# Prevent exporting symbols except for GetCurrentClrDetails from corerun. This is necessary
# to avoid a problem with local typeinfo for standard C++ EH types like std::bad_alloc,
# std::out_of_range etc. being exposed for binding for external shared libraries and causing
# mismatch in catch type matching.
add_link_options(LINKER:-exported_symbol,_GetCurrentClrDetails)
endif()

add_executable_clr(corerun
corerun.cpp
dotenv.cpp
Expand Down
8 changes: 8 additions & 0 deletions src/native/corehost/apphost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.

if (CLR_CMAKE_HOST_APPLE)
# Prevent exporting symbols from apphost. This is necessary to avoid a problem with
# local typeinfo for standard C++ EH types like std::bad_alloc, std::out_of_range etc.
# being exposed for binding for external shared libraries and causing mismatch in
# catch type matching.
add_link_options(LINKER:-no_exported_symbols)
endif()

add_subdirectory(standalone)
8 changes: 8 additions & 0 deletions src/native/corehost/dotnet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.

if (CLR_CMAKE_HOST_APPLE)
# Prevent exporting symbols from dotnet. This is necessary to avoid a problem with
# local typeinfo for standard C++ EH types like std::bad_alloc, std::out_of_range etc.
# being exposed for binding for external shared libraries and causing mismatch in
# catch type matching.
add_link_options(LINKER:-no_exported_symbols)
endif()

if(CLR_CMAKE_TARGET_WIN32)
list(APPEND SOURCES
dotnet.manifest
Expand Down
Loading