blob: 5e49efd8f5fa0786e26db07f0056d10c05aad6bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
set(GC_DIR ../../gc)
set(COMMON_RUNTIME_SOURCES
allocheap.cpp
rhassert.cpp
CachedInterfaceDispatch.cpp
Crst.cpp
DebugHeader.cpp
MethodTable.cpp
EHHelpers.cpp
event.cpp
FinalizerHelpers.cpp
GCHelpers.cpp
gctoclreventsink.cpp
gcheaputilities.cpp
GCMemoryHelpers.cpp
gcrhenv.cpp
gcrhscan.cpp
GcStressControl.cpp
HandleTableHelpers.cpp
MathHelpers.cpp
MiscHelpers.cpp
TypeManager.cpp
ObjectLayout.cpp
portable.cpp
profheapwalkhelper.cpp
RestrictedCallouts.cpp
RhConfig.cpp
RuntimeInstance.cpp
RWLock.cpp
StackFrameIterator.cpp
startup.cpp
stressLog.cpp
SyncClean.cpp
thread.cpp
threadstore.cpp
UniversalTransitionHelpers.cpp
yieldprocessornormalized.cpp
${GC_DIR}/gceventstatus.cpp
${GC_DIR}/gcload.cpp
${GC_DIR}/gcconfig.cpp
${GC_DIR}/gchandletable.cpp
${GC_DIR}/gccommon.cpp
${GC_DIR}/gceewks.cpp
${GC_DIR}/gcwks.cpp
${GC_DIR}/gcscan.cpp
${GC_DIR}/handletable.cpp
${GC_DIR}/handletablecache.cpp
${GC_DIR}/handletablecore.cpp
${GC_DIR}/handletablescan.cpp
${GC_DIR}/objecthandle.cpp
${GC_DIR}/softwarewritewatch.cpp
)
set(SERVER_GC_SOURCES
${GC_DIR}/gceesvr.cpp
${GC_DIR}/gcsvr.cpp
)
set(FULL_RUNTIME_SOURCES
AsmOffsetsVerify.cpp
ThunksMapping.cpp
)
include_directories(inc)
include_directories(.)
include_directories(${GC_DIR})
include_directories(${GC_DIR}/env)
if (WIN32)
set(GC_HEADERS
${GC_DIR}/env/common.h
${GC_DIR}/env/etmdummy.h
${GC_DIR}/env/gcenv.base.h
${GC_DIR}/env/gcenv.ee.h
${GC_DIR}/env/gcenv.h
${GC_DIR}/env/gcenv.interlocked.h
${GC_DIR}/env/gcenv.interlocked.inl
${GC_DIR}/env/gcenv.object.h
${GC_DIR}/env/gcenv.os.h
${GC_DIR}/env/gcenv.structs.h
${GC_DIR}/env/gcenv.sync.h
${GC_DIR}/env/gcenv.windows.inl
${GC_DIR}/env/volatile.h
${GC_DIR}/gc.h
${GC_DIR}/gcconfig.h
${GC_DIR}/gcdesc.h
${GC_DIR}/gcenv.ee.standalone.inl
${GC_DIR}/gcenv.inl
${GC_DIR}/gcevent_serializers.h
${GC_DIR}/gcevents.h
${GC_DIR}/gceventstatus.h
${GC_DIR}/gchandletableimpl.h
${GC_DIR}/gcimpl.h
${GC_DIR}/gcinterface.dac.h
${GC_DIR}/gcinterface.ee.h
${GC_DIR}/gcinterface.h
${GC_DIR}/gcpriv.h
${GC_DIR}/gcrecord.h
${GC_DIR}/gcscan.h
${GC_DIR}/handletable.h
${GC_DIR}/handletable.inl
${GC_DIR}/handletablepriv.h
${GC_DIR}/objecthandle.h
${GC_DIR}/softwarewritewatch.h)
include_directories(windows)
list(APPEND COMMON_RUNTIME_SOURCES
windows/PalRedhawkCommon.cpp
windows/PalRedhawkMinWin.cpp
${GC_DIR}/windows/gcenv.windows.cpp
eventtrace.cpp
rheventtrace.cpp
)
list(APPEND FULL_RUNTIME_SOURCES windows/CoffNativeCodeManager.cpp)
set(ASM_SUFFIX asm)
if (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_AMD64)
set(RUNTIME_SOURCES_ARCH_ASM ${ARCH_SOURCES_DIR}/GC.${ASM_SUFFIX})
endif()
else()
include_directories(unix)
# sal.h, pshpack/poppack.h
add_definitions(-DPAL_STDCPP_COMPAT)
include_directories(../../pal/inc/rt)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(${GC_DIR}/unix/configure.cmake)
if(CLR_CMAKE_TARGET_ARCH_WASM)
include_directories($ENV{EMSCRIPTEN/system/lib/libcxxabi/include})
endif()
# Disable building _Unwind_XXX style APIs of libunwind, since we don't use them.
add_definitions(-D_LIBUNWIND_DISABLE_ZERO_COST_APIS=1)
# Compile unwinding only for the current compilation target architecture
add_definitions(-D_LIBUNWIND_IS_NATIVE_ONLY)
list(APPEND COMMON_RUNTIME_SOURCES
unix/PalRedhawkUnix.cpp
${GC_DIR}/unix/gcenv.unix.cpp
${GC_DIR}/unix/events.cpp
${GC_DIR}/unix/cgroup.cpp
)
list(APPEND FULL_RUNTIME_SOURCES
unix/cgroup.cpp
unix/HardwareExceptions.cpp
unix/UnixContext.cpp
unix/UnixSignals.cpp
unix/UnwindHelpers.cpp
unix/UnixNativeCodeManager.cpp
)
include(${CLR_SRC_NATIVE_DIR}/external/llvm-libunwind.cmake)
list(APPEND FULL_RUNTIME_SOURCES ${LLVM_LIBUNWIND_SOURCES})
set(RUNTIME_SOURCES_ARCH_ASM ${LLVM_LIBUNWIND_ASM_SOURCES})
set(ASM_SUFFIX S)
endif()
if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
list(APPEND COMMON_RUNTIME_SOURCES
${GC_DIR}/vxsort/isa_detection.cpp
${GC_DIR}/vxsort/do_vxsort_avx2.cpp
${GC_DIR}/vxsort/do_vxsort_avx512.cpp
${GC_DIR}/vxsort/machine_traits.avx2.cpp
${GC_DIR}/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
${GC_DIR}/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
${GC_DIR}/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
${GC_DIR}/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
${GC_DIR}/vxsort/smallsort/avx2_load_mask_tables.cpp
)
endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
list(APPEND RUNTIME_SOURCES_ARCH_ASM
${ARCH_SOURCES_DIR}/AllocFast.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/CallDescrWorker.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/ExceptionHandling.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/GcProbe.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/Interlocked.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/MiscStubs.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/PInvoke.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/InteropThunksHelpers.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/StubDispatch.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/UniversalTransition.${ASM_SUFFIX}
${ARCH_SOURCES_DIR}/WriteBarriers.${ASM_SUFFIX}
)
# Add architecture specific folder for looking up headers.
convert_to_absolute_path(ARCH_SOURCES_DIR ${ARCH_SOURCES_DIR})
include_directories(${ARCH_SOURCES_DIR})
add_definitions(-DFEATURE_BASICFREEZE)
add_definitions(-DFEATURE_CONSERVATIVE_GC)
add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES)
add_definitions(-DFEATURE_CUSTOM_IMPORTS)
add_definitions(-DFEATURE_DYNAMIC_CODE)
add_compile_definitions($<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:FEATURE_GC_STRESS>)
add_definitions(-DFEATURE_NATIVEAOT)
add_definitions(-DVERIFY_HEAP)
add_definitions(-DNATIVEAOT)
add_definitions(-DFEATURE_CACHED_INTERFACE_DISPATCH)
add_definitions(-D_LIB)
# there is a problem with undefined symbols when this is set
# add_definitions(-DSTRESS_HEAP)
if(WIN32)
add_definitions(-DFEATURE_ETW)
add_definitions(-DFEATURE_EVENT_TRACE)
add_definitions(-DFEATURE_SUSPEND_REDIRECTION)
else()
add_definitions(-DFEATURE_READONLY_GS_COOKIE)
add_definitions(-DNO_UI_ASSERT)
include(unix/configure.cmake)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
if (CLR_CMAKE_TARGET_UNIX)
if (CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DUNIX_AMD64_ABI)
elseif (CLR_CMAKE_TARGET_ARCH_ARM)
add_definitions(-DUNIX_ARM_ABI)
elseif (CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DUNIX_X86_ABI)
endif()
endif(CLR_CMAKE_TARGET_UNIX)
set(RUNTIME_DIR ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND COMMON_RUNTIME_SOURCES ${GC_HEADERS})
convert_to_absolute_path(COMMON_RUNTIME_SOURCES ${COMMON_RUNTIME_SOURCES})
convert_to_absolute_path(FULL_RUNTIME_SOURCES ${FULL_RUNTIME_SOURCES})
convert_to_absolute_path(SERVER_GC_SOURCES ${SERVER_GC_SOURCES})
convert_to_absolute_path(RUNTIME_SOURCES_ARCH_ASM ${RUNTIME_SOURCES_ARCH_ASM})
if(NOT CLR_CMAKE_TARGET_ARCH_WASM)
add_subdirectory(Full)
else()
add_subdirectory(Portable)
endif()
|