Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 5bb7eb6

Browse files
am11janvorli
authored andcommitted
Set visibility option to hidden (#21924)
1 parent 8e79024 commit 5bb7eb6

File tree

51 files changed

+217
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+217
-156
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
3737
OPTION(CLR_CMAKE_WARNINGS_ARE_ERRORS "Warnings are errors" ON)
3838

3939
# Ensure that python is present
40-
find_program(PYTHON NAMES python3 python2 python)
40+
find_program(PYTHON NAMES python3 python2 python py)
4141
if (PYTHON STREQUAL "PYTHON-NOTFOUND")
4242
message(FATAL_ERROR "PYTHON not found: Please install Python 2.7.9 or later from https://www.python.org/downloads/")
4343
endif()

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export ghprbCommentBody=
77

88
# resolve python-version to use
99
if [ "$PYTHON" == "" ] ; then
10-
if ! PYTHON=$(command -v python3 || command -v python2 || command -v python)
10+
if ! PYTHON=$(command -v python3 || command -v python2 || command -v python || command -v py)
1111
then
1212
echo "Unable to locate build-dependency python!" 1>&2
1313
exit 1

configurecompiler.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ if (CLR_CMAKE_PLATFORM_UNIX)
482482
# as x64 does. It has been causing issues in ARM (https://github.com/dotnet/coreclr/issues/4746)
483483
add_compile_options(-fsigned-char)
484484

485+
# We mark the function which needs exporting with DLLEXPORT
486+
add_compile_options(-fvisibility=hidden)
487+
485488
# Specify the minimum supported version of macOS
486489
if(CLR_CMAKE_PLATFORM_DARWIN)
487490
set(MACOS_VERSION_MIN_FLAGS "-mmacosx-version-min=10.12")

src/ToolBox/SOS/Strike/exts.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,16 @@ inline BOOL IsInterrupt()
182182
//
183183
#undef DECLARE_API
184184

185+
#ifndef DLLEXPORT
186+
#ifdef _MSC_VER
187+
#define DLLEXPORT __declspec(dllexport)
188+
#else
189+
#define DLLEXPORT __attribute__ ((visibility ("default")))
190+
#endif // _MSC_VER
191+
#endif // DLLEXPORT
192+
185193
#define DECLARE_API(extension) \
186-
CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT client, PCSTR args)
194+
CPPMOD DLLEXPORT HRESULT CALLBACK extension(PDEBUG_CLIENT client, PCSTR args)
187195

188196
class __ExtensionCleanUp
189197
{

src/ToolBox/SOS/Strike/sos_stacktrace.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct StackTrace_SimpleContext
9595
extern "C" {
9696
#endif // __cplusplus
9797

98-
HRESULT CALLBACK _EFN_StackTrace(
98+
DLLEXPORT HRESULT CALLBACK _EFN_StackTrace(
9999
PDEBUG_CLIENT client,
100100
__out_ecount(*puiTextLength) WCHAR wszTextOut[],
101101
size_t *puiTextLength,
@@ -119,7 +119,7 @@ HRESULT CALLBACK _EFN_StackTrace(
119119
// cbString - number of characters available in the string buffer.
120120
//
121121
// The output will be truncated of cbString is not long enough for the full stack trace.
122-
HRESULT CALLBACK _EFN_GetManagedExcepStack(
122+
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedExcepStack(
123123
PDEBUG_CLIENT client,
124124
ULONG64 StackObjAddr,
125125
__out_ecount(cbString) PSTR szStackString,
@@ -128,7 +128,7 @@ HRESULT CALLBACK _EFN_GetManagedExcepStack(
128128

129129
// _EFN_GetManagedExcepStackW - same as _EFN_GetManagedExcepStack, but returns
130130
// the stack as a wide string.
131-
HRESULT CALLBACK _EFN_GetManagedExcepStackW(
131+
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedExcepStackW(
132132
PDEBUG_CLIENT client,
133133
ULONG64 StackObjAddr,
134134
__out_ecount(cchString) PWSTR wszStackString,
@@ -141,7 +141,7 @@ HRESULT CALLBACK _EFN_GetManagedExcepStackW(
141141
// szName - a buffer to be filled with the full type name
142142
// cbName - the number of characters available in the buffer
143143
//
144-
HRESULT CALLBACK _EFN_GetManagedObjectName(
144+
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedObjectName(
145145
PDEBUG_CLIENT client,
146146
ULONG64 objAddr,
147147
__out_ecount(cbName) PSTR szName,
@@ -158,7 +158,7 @@ HRESULT CALLBACK _EFN_GetManagedObjectName(
158158
// pOffset - the offset from objAddr to the field. This parameter can be NULL.
159159
//
160160
// At least one of pValue and pOffset must be non-NULL.
161-
HRESULT CALLBACK _EFN_GetManagedObjectFieldInfo(
161+
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedObjectFieldInfo(
162162
PDEBUG_CLIENT client,
163163
ULONG64 objAddr,
164164
__out_ecount (mdNameLen) PSTR szFieldName,

src/ToolBox/SOS/Strike/strike.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15149,7 +15149,7 @@ DECLARE_API(ExposeDML)
1514915149
// According to kksharma the Windows debuggers always sign-extend
1515015150
// arguments when calling externally, therefore StackObjAddr
1515115151
// conforms to CLRDATA_ADDRESS contract.
15152-
HRESULT CALLBACK
15152+
HRESULT CALLBACK
1515315153
_EFN_GetManagedExcepStack(
1515415154
PDEBUG_CLIENT client,
1515515155
ULONG64 StackObjAddr,
@@ -15196,7 +15196,7 @@ _EFN_GetManagedExcepStackW(
1519615196
// According to kksharma the Windows debuggers always sign-extend
1519715197
// arguments when calling externally, therefore objAddr
1519815198
// conforms to CLRDATA_ADDRESS contract.
15199-
HRESULT CALLBACK
15199+
HRESULT CALLBACK
1520015200
_EFN_GetManagedObjectName(
1520115201
PDEBUG_CLIENT client,
1520215202
ULONG64 objAddr,
@@ -15224,7 +15224,7 @@ _EFN_GetManagedObjectName(
1522415224
// According to kksharma the Windows debuggers always sign-extend
1522515225
// arguments when calling externally, therefore objAddr
1522615226
// conforms to CLRDATA_ADDRESS contract.
15227-
HRESULT CALLBACK
15227+
HRESULT CALLBACK
1522815228
_EFN_GetManagedObjectFieldInfo(
1522915229
PDEBUG_CLIENT client,
1523015230
ULONG64 objAddr,

src/ToolBox/SOS/lldbplugin/sosplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "sosplugin.h"
66

77
namespace lldb {
8-
bool PluginInitialize (lldb::SBDebugger debugger);
8+
DLLEXPORT bool PluginInitialize (lldb::SBDebugger debugger);
99
}
1010

1111
bool

src/corefx/System.Globalization.Native/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ add_definitions(-DBIT64=1)
77

88
set(ICU_HOMEBREW_INC_PATH "/usr/local/opt/icu4c/include")
99

10-
# We mark the function which needs exporting with DLLEXPORT
11-
add_compile_options(-fvisibility=hidden)
12-
1310
find_path(UTYPES_H "unicode/utypes.h" PATHS ${ICU_HOMEBREW_INC_PATH})
1411
if(UTYPES_H STREQUAL UTYPES_H-NOTFOUND)
1512
message(FATAL_ERROR "Cannot find utypes.h, try installing libicu-dev (or the appropriate package for your platform)")

src/debug/daccess/daccess.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ HINSTANCE g_thisModule;
4040

4141
extern VOID STDMETHODCALLTYPE TLS_FreeMasterSlotIndex();
4242

43+
DLLEXPORT
4344
EXTERN_C BOOL WINAPI
4445
DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
4546
{

src/debug/daccess/dacdbiimpl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
// Prototype for creation function
1616
STDAPI
17+
DLLEXPORT
1718
DacDbiInterfaceInstance(
1819
ICorDebugDataTarget * pTarget,
1920
CORDB_ADDRESS baseAddress,

0 commit comments

Comments
 (0)