Skip to content

Commit

Permalink
Add a new target for alljitscommunity
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Dec 5, 2024
1 parent 67965a5 commit 721f53a
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
<!-- Runtime doesn't support Arcade-driven target framework filtering. -->
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>

<NativeBuildPartitionPropertiesToRemove>ClrFullNativeBuild;ClrRuntimeSubset;ClrJitSubset;ClrPalTestsSubset;ClrAllJitsSubset;ClrILToolsSubset;ClrNativeAotSubset;ClrSpmiSubset;ClrCrossComponentsSubset;ClrDebugSubset;HostArchitecture;PgoInstrument;NativeOptimizationDataSupported;CMakeArgs;CxxStandardLibrary;CxxStandardLibraryStatic;CxxAbiLibrary</NativeBuildPartitionPropertiesToRemove>
<NativeBuildPartitionPropertiesToRemove>ClrFullNativeBuild;ClrRuntimeSubset;ClrJitSubset;ClrPalTestsSubset;ClrAllJitsSubset;ClrAllJitsCommunitySubset;ClrILToolsSubset;ClrNativeAotSubset;ClrSpmiSubset;ClrCrossComponentsSubset;ClrDebugSubset;HostArchitecture;PgoInstrument;NativeOptimizationDataSupported;CMakeArgs;CxxStandardLibrary;CxxStandardLibraryStatic;CxxAbiLibrary</NativeBuildPartitionPropertiesToRemove>
<UseSystemZlib Condition="'$(TargetsAppleMobile)' == 'true' or '$(TargetOS)' == 'android' or '$(TargetArchitecture)' == 'armv6'">true</UseSystemZlib>
</PropertyGroup>

Expand Down
5 changes: 5 additions & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
<SubsetName Include="Clr.Hosts" Description="The CoreCLR corerun test host." />
<SubsetName Include="Clr.Jit" Description="The JIT for the CoreCLR .NET runtime." />
<SubsetName Include="Clr.AllJits" Description="All of the cross-targeting JIT compilers for the CoreCLR .NET runtime." />
<SubsetName Include="Clr.AllJitsCommunity" Description="All of the cross-targeting JIT compilers for the CoreCLR .NET runtime, including community targets." />
<SubsetName Include="Clr.Spmi" Description="SuperPMI, a tool for CoreCLR JIT testing." />
<SubsetName Include="Clr.CoreLib" Description="The managed System.Private.CoreLib library for CoreCLR." />
<SubsetName Include="Clr.NativeCoreLib" Description="Run crossgen on System.Private.CoreLib library for CoreCLR." />
Expand Down Expand Up @@ -254,6 +255,10 @@
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrAllJitsSubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>

<PropertyGroup Condition="$(_subset.Contains('+clr.alljitscommunity+'))">
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrAllJitsCommunitySubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>

<PropertyGroup Condition="$(_subset.Contains('+clr.iltools+'))">
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrILToolsSubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function(add_component componentName)
else()
set(componentTargetName "${componentName}")
endif()
if (${ARGC} EQUAL 3 AND "${ARG2}" STREQUAL "EXCLUDE_FROM_ALL")
if (${ARGC} EQUAL 3 AND "${ARGV2}" STREQUAL "EXCLUDE_FROM_ALL")
set(exclude_from_all_flag "EXCLUDE_FROM_ALL")
endif()
get_property(definedComponents GLOBAL PROPERTY CLR_CMAKE_COMPONENTS)
Expand Down
11 changes: 10 additions & 1 deletion src/coreclr/build-runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ if NOT DEFINED PYTHON (
)

set __CMakeTarget=
set __BuildAllJitsCommunity=0
for /f "delims=" %%a in ("-%__RequestedBuildComponents%-") do (
set "string=%%a"
if not "!string:-hosts-=!"=="!string!" (
Expand All @@ -319,6 +320,10 @@ for /f "delims=" %%a in ("-%__RequestedBuildComponents%-") do (
if not "!string:-alljits-=!"=="!string!" (
set __CMakeTarget=!__CMakeTarget! alljits
)
if not "!string:-alljitscommunity-=!"=="!string!" (
set __CMakeTarget=!__CMakeTarget! alljitscommunity
set __BuildAllJitsCommunity=1
)
if not "!string:-runtime-=!"=="!string!" (
set __CMakeTarget=!__CMakeTarget! runtime
)
Expand Down Expand Up @@ -479,7 +484,11 @@ set __TargetArchList=
set /A __TotalSpecifiedTargetArch=__TargetArchX64 + __TargetArchX86 + __TargetArchArm + __TargetArchArm64 + __TargetArchLoongArch64 + __TargetArchRiscV64
if %__TotalSpecifiedTargetArch% EQU 0 (
REM Nothing specified means we want to build all architectures.
set __TargetArchList=x64 x86 arm arm64 loongarch64 riscv64
set __TargetArchList=x64 x86 arm arm64
)

if %__BuildAllJitsCommunity%==1 (
set __TargetArchList=%__TargetArchList% loongarch64 riscv64
)

REM Otherwise, add all the specified architectures to the list.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/build-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export PYTHON
usage_list+=("-pgodatapath: path to profile guided optimization data.")
usage_list+=("-pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.")
usage_list+=("-staticanalyzer: use scan_build static analyzer.")
usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', 'iltools', 'nativeaot', and 'spmi'. Can be specified multiple times.")
usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', 'alljitscommunity', 'iltools', 'nativeaot', and 'spmi'. Can be specified multiple times.")
usage_list+=("-subdir: Append a directory with the provided name to the obj and bin paths.")

setup_dirs_local()
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/components.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Define all the individually buildable components of the CoreCLR build and their respective targets
add_component(jit)
add_component(alljits)
add_component(alljitscommunity)
add_component(hosts)
add_component(runtime)
add_component(paltests paltests_install)
Expand All @@ -15,6 +16,7 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME coreclr_misc)
add_component(coreclr_misc)
add_dependencies(jit coreclr_misc)
add_dependencies(alljits coreclr_misc)
add_dependencies(alljitscommunity coreclr_misc)
add_dependencies(runtime coreclr_misc)

# The runtime build requires the clrjit and iltools builds
Expand Down
16 changes: 12 additions & 4 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function(create_standalone_jit)

set(oneValueArgs TARGET OS ARCH)
set(multiValueArgs DESTINATIONS)
set(JIT_COMMUNITY false)
cmake_parse_arguments(TARGETDETAILS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if(TARGETDETAILS_OS STREQUAL "unix_osx" OR TARGETDETAILS_OS STREQUAL "unix_anyos")
Expand Down Expand Up @@ -51,17 +52,19 @@ function(create_standalone_jit)
elseif(TARGETDETAILS_ARCH STREQUAL "loongarch64")
set(JIT_ARCH_SOURCES ${JIT_LOONGARCH64_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_LOONGARCH64_HEADERS})
set(JIT_COMMUNITY true)
elseif(TARGETDETAILS_ARCH STREQUAL "riscv64")
set(JIT_ARCH_SOURCES ${JIT_RISCV64_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_RISCV64_HEADERS})
set(JIT_COMMUNITY true)
else()
clr_unknown_arch()
endif()

if (TARGETDETAILS_DESTINATIONS STREQUAL "")
add_jit(${TARGETDETAILS_TARGET})
add_jit(${TARGETDETAILS_TARGET} ${JIT_COMMUNITY})
else()
add_jit(${TARGETDETAILS_TARGET} DESTINATIONS "${TARGETDETAILS_DESTINATIONS}")
add_jit(${TARGETDETAILS_TARGET} ${JIT_COMMUNITY} DESTINATIONS "${TARGETDETAILS_DESTINATIONS}")
endif()

set_target_definitions_to_custom_os_and_arch(${ARGN})
Expand Down Expand Up @@ -565,7 +568,7 @@ endif(CLR_CMAKE_HOST_UNIX)

# Shared function for generating JIT
# optional arguments: DESTINATIONS path
function(add_jit jitName)
function(add_jit jitName jitCommunity)

set_source_files_properties(${JIT_EXPORTS_FILE} PROPERTIES GENERATED TRUE)

Expand Down Expand Up @@ -616,7 +619,12 @@ function(add_jit jitName)
endif()

# add the install targets
install_clr(TARGETS ${jitName} ${ARGN} COMPONENT alljits)
if (jitCommunity)
install_clr(TARGETS ${jitName} ${ARGN} COMPONENT alljitscommunity)
else()
install_clr(TARGETS ${jitName} ${ARGN} COMPONENT alljits)
install_clr(TARGETS ${jitName} ${ARGN} COMPONENT alljitscommunity)
endif()
endfunction()

set(JIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<_CoreClrBuildArg Condition="'$(ClrJitSubset)' == 'true'" Include="-component jit" />
<_CoreClrBuildArg Condition="'$(ClrPalTestsSubset)' == 'true'" Include="-component paltests" />
<_CoreClrBuildArg Condition="'$(ClrAllJitsSubset)' == 'true'" Include="-component alljits" />
<_CoreClrBuildArg Condition="'$(ClrAllJitsCommunitySubset)' == 'true'" Include="-component alljitscommunity" />
<_CoreClrBuildArg Condition="'$(ClrILToolsSubset)' == 'true'" Include="-component iltools" />
<_CoreClrBuildArg Condition="'$(ClrNativeAotSubset)' == 'true'" Include="-component nativeaot" />
<_CoreClrBuildArg Condition="'$(ClrSpmiSubset)' == 'true'" Include="-component spmi" />
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/tools/aot/jitinterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ target_link_libraries(jitinterface_${ARCH_HOST_NAME} PRIVATE minipal)

install_clr(TARGETS jitinterface_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit)
install_clr(TARGETS jitinterface_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT alljits)
install_clr(TARGETS jitinterface_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT alljitscommunity)

0 comments on commit 721f53a

Please sign in to comment.