File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ macro(cage_build_configuration)
7575 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP" )
7676 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP" )
7777 else ()
78+ # make runtime loader look for local symbols first
79+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Bsymbolic" )
80+
7881 # link time optimizations
7982 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto" )
8083 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto" )
Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ if(MSVC)
2929 target_compile_definitions (cage-core PUBLIC "CAGE_API_IMPORT=__declspec(dllimport)" )
3030 target_compile_definitions (cage-core PUBLIC "CAGE_FORCE_INLINE=__forceinline" )
3131else ()
32- target_compile_definitions (cage-core PUBLIC "CAGE_API_EXPORT=[[gnu::visibility(\" default\" )]]" )
33- target_compile_definitions (cage-core PUBLIC "CAGE_API_IMPORT=[[gnu::visibility(\" default\" )]]" )
32+ # protected, unlike default, prevents interposition
33+ target_compile_definitions (cage-core PUBLIC "CAGE_API_EXPORT=[[gnu::visibility(\" protected\" )]]" )
34+ target_compile_definitions (cage-core PUBLIC "CAGE_API_IMPORT=[[gnu::visibility(\" protected\" )]]" )
3435 target_compile_definitions (cage-core PUBLIC "CAGE_FORCE_INLINE=[[gnu::always_inline]]inline" )
3536endif ()
3637if (WIN32 )
You can’t perform that action at this time.
0 commit comments