Skip to content

Commit

Permalink
build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanF committed Jan 9, 2023
1 parent 8502406 commit a4ee746
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/coreclr/nativeaot/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<PropertyGroup>
<ILLinkTrimAssembly>false</ILLinkTrimAssembly>
</PropertyGroup>
<!--Temporary workaround to control EventPipe in AOT-->
<PropertyGroup>
<FeaturePerfTracing>true</FeaturePerfTracing>
</PropertyGroup>

<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
Expand Down Expand Up @@ -39,6 +43,7 @@

<!-- Ignore all previous constants since we are sensitive to what is defined and the Sdk adds some by default -->
<DefineConstants>NATIVEAOT;NETCOREAPP</DefineConstants>
<DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>

<DisableImplicitConfigurationDefines>true</DisableImplicitConfigurationDefines>

Expand Down
142 changes: 142 additions & 0 deletions src/coreclr/nativeaot/Runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,143 @@
# These need to happen before the VM and debug-pal includes.
set(EP_GENERATED_HEADER_PATH "${GENERATED_INCLUDE_DIR}")
include (${CLR_SRC_NATIVE_DIR}/eventpipe/configure.cmake)
include_directories(${EP_GENERATED_HEADER_PATH})

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(AOT_EVENTPIPE_SHIM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/eventpipe")

set (SHARED_EVENTPIPE_SOURCE_DIR "${CLR_SRC_NATIVE_DIR}/eventpipe")
include_directories(${SHARED_EVENTPIPE_SOURCE_DIR})

set (AOT_EVENTPIPE_SHIM_SOURCES "")
set (AOT_EVENTPIPE_SHIM_HEADERS "")
set (AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES "")
set (SHARED_EVENTPIPE_SOURCES "")
set (SHARED_EVENTPIPE_HEADERS "")
set (SHARED_DIAGNOSTIC_SERVER_SOURCES "")
set (SHARED_DIAGNOSTIC_SERVER_HEADERS "")
set (AOT_EVENTPIPE_DISABLED_SOURCES "")

list(APPEND SHARED_EVENTPIPE_SOURCES
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-sources.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-block.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-buffer.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-buffer-manager.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-config.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event-instance.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event-payload.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event-source.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-file.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-json-file.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-metadata-generator.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-provider.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-sample-profiler.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-session.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-session-provider.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-stack-contents.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-stream.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-thread.c
)

list(APPEND SHARED_EVENTPIPE_HEADERS
${SHARED_EVENTPIPE_SOURCE_DIR}/ep.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-block.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-buffer.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-buffer-manager.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-config.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-config-internals.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event-instance.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event-payload.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-event-source.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-file.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-getter-setter.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-ipc-pal-types.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-ipc-pal-types-forward.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-ipc-stream.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-json-file.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-metadata-generator.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-provider.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-provider-internals.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-rt.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-rt-config.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-rt-types.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-sample-profiler.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-session.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-session-provider.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-stack-contents.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-stream.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-thread.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-types.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ep-types-forward.h
)

list(APPEND SHARED_DIAGNOSTIC_SERVER_SOURCES
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-sources.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-dump-protocol.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-eventpipe-protocol.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-ipc-pal-namedpipe.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-ipc.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-process-protocol.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-profiler-protocol.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-protocol.c
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-server.c
)

list(APPEND SHARED_DIAGNOSTIC_SERVER_HEADERS
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-dump-protocol.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-eventpipe-protocol.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-getter-setter.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-ipc.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-ipc-pal.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-ipc-pal-types.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-ipc-pal-namedpipe.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-process-protocol.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-profiler-protocol.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-protocol.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-rt.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-rt-config.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-rt-types.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-server.h
${SHARED_EVENTPIPE_SOURCE_DIR}/ds-types.h
)

list(APPEND AOT_EVENTPIPE_SHIM_SOURCES
${AOT_EVENTPIPE_SHIM_DIR}/ep-rt-aot.cpp
)

list(APPEND AOT_EVENTPIPE_SHIM_HEADERS
${AOT_EVENTPIPE_SHIM_DIR}/ds-rt-aot.h
${AOT_EVENTPIPE_SHIM_DIR}/ds-rt-types-aot.h
${AOT_EVENTPIPE_SHIM_DIR}/ep-rt-aot.h
${AOT_EVENTPIPE_SHIM_DIR}/ep-rt-config-aot.h
${AOT_EVENTPIPE_SHIM_DIR}/ep-rt-types-aot.h
)

list(APPEND AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/eventpipeinternal.cpp
${CMAKE_CURRENT_SOURCE_DIR}/eventpipeadapter.h
${CMAKE_CURRENT_SOURCE_DIR}/diagnosticserveradapter.h
${CMAKE_CURRENT_SOURCE_DIR}/AotEnabledEventPipeInterface.cpp
)

list(APPEND EVENTPIPE_SOURCES
${AOT_EVENTPIPE_SHIM_SOURCES}
${AOT_EVENTPIPE_SHIM_HEADERS}
${AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES}
${SHARED_EVENTPIPE_SOURCES}
${SHARED_EVENTPIPE_HEADERS}
${SHARED_DIAGNOSTIC_SERVER_SOURCES}
${SHARED_DIAGNOSTIC_SERVER_HEADERS}
${SHARED_EVENTPIPE_CONFIG_HEADERS}
)

list(APPEND AOT_EVENTPIPE_DISABLED_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/AotDisabledEventPipeInterface.cpp
)

set(GC_DIR ../../gc)

set(COMMON_RUNTIME_SOURCES
Expand Down Expand Up @@ -37,6 +177,8 @@ set(COMMON_RUNTIME_SOURCES
UniversalTransitionHelpers.cpp
yieldprocessornormalized.cpp

EventPipeInterface.h

${GC_DIR}/gceventstatus.cpp
${GC_DIR}/gcload.cpp
${GC_DIR}/gcconfig.cpp
Expand Down
22 changes: 22 additions & 0 deletions src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ add_library(Runtime.WorkstationGC STATIC ${COMMON_RUNTIME_SOURCES} ${FULL_RUNTIM

add_library(Runtime.ServerGC STATIC ${COMMON_RUNTIME_SOURCES} ${FULL_RUNTIME_SOURCES} ${RUNTIME_SOURCES_ARCH_ASM} ${SERVER_GC_SOURCES} ${RUNTIME_ARCH_ASM_OBJECTS})

add_library(Aot.EventPipe STATIC ${EVENTPIPE_SOURCES})
add_library(Aot.Disabled.EventPipe STATIC ${AOT_EVENTPIPE_DISABLED_SOURCES})

target_compile_definitions(Runtime.ServerGC PRIVATE -DFEATURE_SVR_GC)

if (CLR_CMAKE_TARGET_WIN32)
Expand Down Expand Up @@ -63,6 +66,23 @@ add_custom_command(

set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.inc" PROPERTIES GENERATED TRUE)

set_source_files_properties(${SHARED_EVENTPIPE_SOURCES} PROPERTIES LANGUAGE CXX)
set_source_files_properties(${SHARED_DIAGNOSTIC_SERVER_SOURCES} PROPERTIES LANGUAGE CXX)

if(CLR_CMAKE_HOST_UNIX)
if (CMAKE_VERSION VERSION_GREATER 3.11 OR CMAKE_VERSION VERSION_EQUAL 3.11)
set_source_files_properties(${SHARED_EVENTPIPE_SOURCES} PROPERTIES COMPILE_OPTIONS -xc++)
set_source_files_properties(${SHARED_DIAGNOSTIC_SERVER_SOURCES} PROPERTIES COMPILE_OPTIONS -xc++)
endif()
endif(CLR_CMAKE_HOST_UNIX)

add_definitions(-DFEATURE_PERFTRACING)

if (WIN32)
set_source_files_properties(${SHARED_EVENTPIPE_SOURCES} PROPERTIES COMPILE_FLAGS "/FI\"${RUNTIME_DIR}/eventpipe/NativeaotEventPipeSupport.h\"")
set_source_files_properties(${SHARED_DIAGNOSTIC_SERVER_SOURCES} PROPERTIES COMPILE_FLAGS "/FI\"${RUNTIME_DIR}/eventpipe/NativeaotEventPipeSupport.h\"")
endif()

# Runtime.WorkstationGC and Runtime.ServerGC share AsmOffsets.inc and assembler helpers (for Windows ARM/ARM64).
# Avoid a race condition by adding this target as a dependency for both libraries.
add_custom_target(
Expand All @@ -78,6 +98,8 @@ endif (CLR_CMAKE_TARGET_WIN32)

install_static_library(Runtime.WorkstationGC aotsdk nativeaot)
install_static_library(Runtime.ServerGC aotsdk nativeaot)
install_static_library(Aot.EventPipe aotsdk nativeaot)
install_static_library(Aot.Disabled.EventPipe aotsdk nativeaot)
if (CLR_CMAKE_TARGET_WIN32)
install_static_library(Runtime.ServerGC.GuardCF aotsdk nativeaot)
endif (CLR_CMAKE_TARGET_WIN32)

0 comments on commit a4ee746

Please sign in to comment.