Skip to content

Commit 23b4030

Browse files
authored
Enable riscv64 R2R in installer (#96941)
1 parent 51e70cb commit 23b4030

File tree

8 files changed

+19
-7
lines changed

8 files changed

+19
-7
lines changed

eng/targetingpacks.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
LatestRuntimeFrameworkVersion="$(ProductVersion)"
4444
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
4545
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**"
46-
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"
46+
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"
4747
TargetFramework="$(NetCoreAppCurrent)"
4848
TargetingPackName="$(LocalFrameworkOverrideName).Ref"
4949
TargetingPackVersion="$(ProductVersion)"
@@ -53,7 +53,7 @@
5353
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
5454
LatestRuntimeFrameworkVersion="$(ProductVersion)"
5555
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
56-
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"
56+
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"
5757
RuntimePackLabels="Mono"
5858
Condition="'$(UseLocalTargetingRuntimePack)' == 'true' and ('@(KnownRuntimePack)' == '' or @(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('RuntimePackLabels', 'Mono')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)')) == '')" />
5959
<!-- always add wasi-wasm as it is never added by the sdk -->
@@ -78,7 +78,7 @@
7878
TargetFramework="$(NetCoreAppCurrent)"
7979
Crossgen2PackNamePattern="$(LocalFrameworkOverrideName).Crossgen2.**RID**"
8080
Crossgen2PackVersion="$(ProductVersion)"
81-
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"
81+
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"
8282
Condition="'$(UseLocalCrossgen2Pack)' == 'true' and '@(KnownCrossgen2Pack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))' != 'true'" />
8383
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
8484
ExcludedRuntimeIdentifiers="android"

src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static string GetHardwareIntrinsicId(TargetArchitecture architecture, Typ
105105
}
106106
else
107107
{
108-
throw new InternalCompilerErrorException("Unknown architecture");
108+
throw new InternalCompilerErrorException($"Unknown architecture '{architecture}'");
109109
}
110110

111111
return potentialType.Name;

src/coreclr/tools/aot/ILCompiler.Diagnostics/PerfMapWriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ private static PerfmapTokensForTarget TranslateTargetDetailsToPerfmapConstants(T
135135
TargetArchitecture.ARM64 => PerfMapArchitectureToken.ARM64,
136136
TargetArchitecture.X64 => PerfMapArchitectureToken.X64,
137137
TargetArchitecture.X86 => PerfMapArchitectureToken.X86,
138+
TargetArchitecture.RiscV64 => PerfMapArchitectureToken.RiscV64,
138139
_ => throw new NotImplementedException(details.Architecture.ToString())
139140
};
140141

src/coreclr/tools/aot/ILCompiler.Diagnostics/ReadyToRunDiagnosticsConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public enum PerfMapArchitectureToken : uint
1919
ARM64 = 2,
2020
X64 = 3,
2121
X86 = 4,
22+
RiscV64 = 5,
2223
}
2324

2425
public enum PerfMapOSToken : uint

src/installer/pkg/projects/netcoreappRIDs.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,11 @@
6969
<UnofficialBuildRID Include="linux-musl-ppc64le">
7070
<Platform>ppc64le</Platform>
7171
</UnofficialBuildRID>
72+
<UnofficialBuildRID Include="linux-riscv64">
73+
<Platform>riscv64</Platform>
74+
</UnofficialBuildRID>
75+
<UnofficialBuildRID Include="linux-musl-riscv64">
76+
<Platform>riscv64</Platform>
77+
</UnofficialBuildRID>
7278
</ItemGroup>
7379
</Project>

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
<SharedFrameworkHostFileNameOverride>crossgen2</SharedFrameworkHostFileNameOverride>
1313
<!-- Build this pack for any RID if building from source. Otherwise, only build select RIDs. -->
1414
<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>
15-
<!-- FreeBSD runtime/apphost packs aren't built in the official build so only reference the RIDs when targetting FreeBSD -->
15+
<!-- 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. -->
1616
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetOS)' == 'freebsd'">$(RuntimeIdentifiers);freebsd-x64;freebsd-arm64</RuntimeIdentifiers>
17+
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetsLinuxMusl)' == 'true' and '$(TargetArchitecture)' == 'riscv64'">$(RuntimeIdentifiers);linux-musl-riscv64</RuntimeIdentifiers>
18+
<RuntimeIdentifiers Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetsLinux)' == 'true' and '$(TargetsLinuxMusl)' != 'true' and '$(TargetArchitecture)' == 'riscv64'">$(RuntimeIdentifiers);linux-riscv64</RuntimeIdentifiers>
1719
<GenerateInstallers>false</GenerateInstallers>
1820
<HostJsonTargetPath>tools/</HostJsonTargetPath>
1921
<PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<PublishReadyToRun Condition="'$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'solaris' or '$(TargetOS)' == 'haiku'">false</PublishReadyToRun>
1212
<!-- Disable crossgen on FreeBSD when cross building from Linux. -->
1313
<PublishReadyToRun Condition="'$(TargetOS)'=='freebsd' and '$(CrossBuild)'=='true'">false</PublishReadyToRun>
14-
<!-- Disable crossgen on riscv64. -->
15-
<PublishReadyToRun Condition="'$(TargetArchitecture)'=='riscv64'">false</PublishReadyToRun>
1614
<!-- These components are installed by the root shared framework, but not others. -->
1715
<IncludeWerRelatedKeys>true</IncludeWerRelatedKeys>
1816
<IncludeBreadcrumbStoreFolder>true</IncludeBreadcrumbStoreFolder>

src/tasks/Crossgen2Tasks/ResolveReadyToRunCompilers.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ private static bool ExtractTargetPlatformAndArchitecture(string runtimeIdentifie
230230
case "x86":
231231
architecture = Architecture.X86;
232232
break;
233+
case "riscv64":
234+
architecture = Architecture.RiscV64;
235+
break;
233236
default:
234237
return false;
235238
}
@@ -387,6 +390,7 @@ private static string ArchitectureToString(Architecture architecture)
387390
Architecture.X64 => "x64",
388391
Architecture.Arm => "arm",
389392
Architecture.Arm64 => "arm64",
393+
Architecture.RiscV64 => "riscv64",
390394
_ => null
391395
};
392396
}

0 commit comments

Comments
 (0)