Skip to content

Commit

Permalink
Enable riscv64 R2R in installer (#96941)
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 authored Mar 4, 2024
1 parent 51e70cb commit 23b4030
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions eng/targetingpacks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;linux-s390x;linux-bionic-arm;linux-bionic-arm64;linux-bionic-x64;linux-bionic-x86;freebsd-x64;freebsd-arm64;linux-ppc64le"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;linux-s390x;linux-bionic-arm;linux-bionic-arm64;linux-bionic-x64;linux-bionic-x86;freebsd-x64;freebsd-arm64;linux-ppc64le;linux-riscv64;linux-musl-riscv64"
TargetFramework="$(NetCoreAppCurrent)"
TargetingPackName="$(LocalFrameworkOverrideName).Ref"
TargetingPackVersion="$(ProductVersion)"
Expand All @@ -53,7 +53,7 @@
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;linux-s390x;linux-bionic-arm;linux-bionic-arm64;linux-bionic-x64;linux-bionic-x86;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;maccatalyst-x64;maccatalyst-arm64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;linux-riscv64;linux-musl-riscv64;rhel.6-x64;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;linux-s390x;linux-bionic-arm;linux-bionic-arm64;linux-bionic-x64;linux-bionic-x86;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;maccatalyst-x64;maccatalyst-arm64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackLabels="Mono"
Condition="'$(UseLocalTargetingRuntimePack)' == 'true' and ('@(KnownRuntimePack)' == '' or @(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('RuntimePackLabels', 'Mono')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)')) == '')" />
<!-- always add wasi-wasm as it is never added by the sdk -->
Expand All @@ -78,7 +78,7 @@
TargetFramework="$(NetCoreAppCurrent)"
Crossgen2PackNamePattern="$(LocalFrameworkOverrideName).Crossgen2.**RID**"
Crossgen2PackVersion="$(ProductVersion)"
Crossgen2RuntimeIdentifiers="linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm64;win-x86"
Crossgen2RuntimeIdentifiers="linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm64;win-x86;linux-riscv64;linux-musl-riscv64"
Condition="'$(UseLocalCrossgen2Pack)' == 'true' and '@(KnownCrossgen2Pack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))' != 'true'" />
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
ExcludedRuntimeIdentifiers="android"
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static string GetHardwareIntrinsicId(TargetArchitecture architecture, Typ
}
else
{
throw new InternalCompilerErrorException("Unknown architecture");
throw new InternalCompilerErrorException($"Unknown architecture '{architecture}'");
}

return potentialType.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ private static PerfmapTokensForTarget TranslateTargetDetailsToPerfmapConstants(T
TargetArchitecture.ARM64 => PerfMapArchitectureToken.ARM64,
TargetArchitecture.X64 => PerfMapArchitectureToken.X64,
TargetArchitecture.X86 => PerfMapArchitectureToken.X86,
TargetArchitecture.RiscV64 => PerfMapArchitectureToken.RiscV64,
_ => throw new NotImplementedException(details.Architecture.ToString())
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum PerfMapArchitectureToken : uint
ARM64 = 2,
X64 = 3,
X86 = 4,
RiscV64 = 5,
}

public enum PerfMapOSToken : uint
Expand Down
6 changes: 6 additions & 0 deletions src/installer/pkg/projects/netcoreappRIDs.props
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,11 @@
<UnofficialBuildRID Include="linux-musl-ppc64le">
<Platform>ppc64le</Platform>
</UnofficialBuildRID>
<UnofficialBuildRID Include="linux-riscv64">
<Platform>riscv64</Platform>
</UnofficialBuildRID>
<UnofficialBuildRID Include="linux-musl-riscv64">
<Platform>riscv64</Platform>
</UnofficialBuildRID>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
<SharedFrameworkHostFileNameOverride>crossgen2</SharedFrameworkHostFileNameOverride>
<!-- Build this pack for any RID if building from source. Otherwise, only build select RIDs. -->
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<!-- FreeBSD runtime/apphost packs aren't built in the official build so only reference the RIDs when targetting FreeBSD -->
<!-- runtime/apphost packs of these platforms aren't built in the official build, so only reference the RIDs when we are targetting the community-supported platforms. -->
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetOS)' == 'freebsd'">$(RuntimeIdentifiers);freebsd-x64;freebsd-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetsLinuxMusl)' == 'true' and '$(TargetArchitecture)' == 'riscv64'">$(RuntimeIdentifiers);linux-musl-riscv64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetsLinux)' == 'true' and '$(TargetsLinuxMusl)' != 'true' and '$(TargetArchitecture)' == 'riscv64'">$(RuntimeIdentifiers);linux-riscv64</RuntimeIdentifiers>
<GenerateInstallers>false</GenerateInstallers>
<HostJsonTargetPath>tools/</HostJsonTargetPath>
<PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<PublishReadyToRun Condition="'$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'solaris' or '$(TargetOS)' == 'haiku'">false</PublishReadyToRun>
<!-- Disable crossgen on FreeBSD when cross building from Linux. -->
<PublishReadyToRun Condition="'$(TargetOS)'=='freebsd' and '$(CrossBuild)'=='true'">false</PublishReadyToRun>
<!-- Disable crossgen on riscv64. -->
<PublishReadyToRun Condition="'$(TargetArchitecture)'=='riscv64'">false</PublishReadyToRun>
<!-- These components are installed by the root shared framework, but not others. -->
<IncludeWerRelatedKeys>true</IncludeWerRelatedKeys>
<IncludeBreadcrumbStoreFolder>true</IncludeBreadcrumbStoreFolder>
Expand Down
4 changes: 4 additions & 0 deletions src/tasks/Crossgen2Tasks/ResolveReadyToRunCompilers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ private static bool ExtractTargetPlatformAndArchitecture(string runtimeIdentifie
case "x86":
architecture = Architecture.X86;
break;
case "riscv64":
architecture = Architecture.RiscV64;
break;
default:
return false;
}
Expand Down Expand Up @@ -387,6 +390,7 @@ private static string ArchitectureToString(Architecture architecture)
Architecture.X64 => "x64",
Architecture.Arm => "arm",
Architecture.Arm64 => "arm64",
Architecture.RiscV64 => "riscv64",
_ => null
};
}
Expand Down

0 comments on commit 23b4030

Please sign in to comment.