Skip to content

Commit

Permalink
v8 preview.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sec committed Feb 25, 2023
1 parent 49d3305 commit ff75ae8
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build .NET Core 7 under FreeBSD
# Build .NET Core 8 (preview atm) under FreeBSD

- Just a collection of script and patches put up into one place, to help getting automated builds.
- For other versions, check proper tag with that name.
Expand Down
17 changes: 12 additions & 5 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ if [ ! -d runtime ]; then

runtime/.dotnet/dotnet nuget add source 'https://sec.github.io/dotnet-freebsd-nuget-feed/v3/index.json' --name ghsec --configfile runtime/NuGet.config

patch -d runtime < patches/runtime_versions.patch
patch -d runtime < patches/runtime_crossgen2.patch
patch -d runtime < patches/runtime_mono_configure.patch
if [ `uname -m` = 'arm64' ]; then
#git -C runtime cherry-pick -n 8582762f5d19d88ee12ef9d61e3a3af3e1a44185
#git -C runtime cherry-pick -n e2a706e206ba620bffa94cc1c4959cfb82cb3638
#git -C runtime cherry-pick -n b02f85fae696d3205277640c50b3c71257dcc951
fi

patch -d runtime < patches8/runtime_preview1.patch
fi

if [ ! -d aspnetcore ]; then
Expand All @@ -44,7 +48,7 @@ if [ ! -d aspnetcore ]; then
aspnetcore/.dotnet/dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping/ --name local --configfile aspnetcore/NuGet.config
runtime/.dotnet/dotnet nuget add source 'https://sec.github.io/dotnet-freebsd-nuget-feed/v3/index.json' --name ghsec --configfile aspnetcore/NuGet.config

patch -d aspnetcore < patches/aspnetcore.patch
patch -d aspnetcore < patches8/aspnetcore_preview1.patch

cp patches/aspnet.editorconfig aspnetcore/src/.editorconfig
fi
Expand All @@ -58,9 +62,12 @@ if [ ! -d installer ]; then
installer/.dotnet/dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping/ --name local1 --configfile installer/NuGet.config
installer/.dotnet/dotnet nuget add source ../aspnetcore/artifacts/packages/Release/Shipping/ --name local2 --configfile installer/NuGet.config

patch -d installer < patches/installer.patch
patch -d installer < patches8/installer_preview1.patch
fi

# let MS build SDK :)
exit 0

if [ ! -d sdk ]; then
git clone https://github.com/dotnet/sdk
git -C sdk checkout $SDKTAG
Expand Down
88 changes: 88 additions & 0 deletions patches8/aspnetcore_preview1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
diff --git a/eng/Dependencies.props b/eng/Dependencies.props
index 663aca404a..1a20e61821 100644
--- a/eng/Dependencies.props
+++ b/eng/Dependencies.props
@@ -107,6 +107,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-musl-arm" />
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-musl-arm64" />
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-x64" />
+ <LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-arm64" />
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.$(TargetRuntimeIdentifier)" Condition=" '$(PortableBuild)' == 'false' " />

<!-- Crossgen2 compiler -->
@@ -123,6 +124,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.win-arm" />
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.win-arm64" />
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.freebsd-x64" />
+ <LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.freebsd-arm64" />
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.$(TargetRuntimeIdentifier)" Condition=" '$(PortableBuild)' == 'false' " />
</ItemGroup>

diff --git a/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.csproj b/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.csproj
index 2db57db253..88306bafd0 100644
--- a/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.csproj
+++ b/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.csproj
@@ -3,7 +3,7 @@

<PropertyGroup>
<!-- Included primarily to ensure dotnet-getdocument and GetDocument.Insider can be referenced. -->
- <TargetFrameworks>netcoreapp2.1;$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
+ <TargetFrameworks>net6.0;$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>

<Description>MSBuild tasks and targets for build-time Swagger and OpenApi document generation</Description>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
diff --git a/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.nuspec b/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.nuspec
index be5d875fb7..3ad680b220 100644
--- a/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.nuspec
+++ b/src/Tools/Extensions.ApiDescription.Server/src/Microsoft.Extensions.ApiDescription.Server.nuspec
@@ -8,10 +8,10 @@
$CommonFileElements$
<file src="build\*" target="build" />
<file src="buildMultiTargeting\*" target="buildMultiTargeting" />
- <file src="$artifactsBinDir$\dotnet-getdocument\$configuration$\netcoreapp2.1\publish\*.*" target="tools" />
+ <file src="$artifactsBinDir$\dotnet-getdocument\$configuration$\net6.0\*.*" target="tools" />
<file src="$artifactsBinDir$\GetDocument.Insider\$configuration$\net462\*.*" target="tools\net462" />
<file src="$artifactsBinDir$\GetDocument.Insider\x86\$configuration$\net462\*.*" target="tools\net462-x86" />
- <file src="$artifactsBinDir$\GetDocument.Insider\$configuration$\netcoreapp2.1\publish\*.*" target="tools\netcoreapp2.1" />
+ <file src="$artifactsBinDir$\GetDocument.Insider\$configuration$\net6.0\*.*" target="tools\netcoreapp2.1" />
<file src="$artifactsBinDir$\GetDocument.Insider\$configuration$\net8.0\publish\*.*" target="tools\net8.0" />
</files>
</package>
diff --git a/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs b/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs
index 81159c11d8..2ffbad4eaa 100644
--- a/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs
+++ b/src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommand.cs
@@ -115,7 +115,6 @@ internal sealed class GetDocumentCommand : ProjectCommandBase
return Assembly.LoadFile(assemblyPath);
};
#else
-#error Target frameworks need to be updated.
#endif

// Now safe to reference the application's code.
diff --git a/src/Tools/GetDocumentInsider/src/GetDocument.Insider.csproj b/src/Tools/GetDocumentInsider/src/GetDocument.Insider.csproj
index 70b25e6830..118600c880 100644
--- a/src/Tools/GetDocumentInsider/src/GetDocument.Insider.csproj
+++ b/src/Tools/GetDocumentInsider/src/GetDocument.Insider.csproj
@@ -5,7 +5,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.Extensions.ApiDescription.Tool</RootNamespace>
- <TargetFrameworks>netcoreapp2.1;$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
+ <TargetFrameworks>net6.0;$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework)</TargetFrameworks>
<IsShippingPackage>false</IsShippingPackage>
<NoWarn>$(NoWarn);nullable</NoWarn>
</PropertyGroup>
diff --git a/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj b/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj
index 3b37a5ea78..c2a00a9ece 100644
--- a/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj
+++ b/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj
@@ -5,7 +5,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.Extensions.ApiDescription.Tool</RootNamespace>
- <TargetFrameworks>netcoreapp2.1;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+ <TargetFrameworks>net6.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<UseAppHost>false</UseAppHost>
<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>
45 changes: 45 additions & 0 deletions patches8/installer_preview1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/src/redist/targets/GenerateBundledVersions.targets b/src/redist/targets/GenerateBundledVersions.targets
index 8836f85c9..dba2db932 100644
--- a/src/redist/targets/GenerateBundledVersions.targets
+++ b/src/redist/targets/GenerateBundledVersions.targets
@@ -147,6 +147,7 @@
win-arm64;
win-x64;
win-x86;
+ freebsd-arm64;
" />

<NetCore31RuntimePackRids Include="@(NetCore30RuntimePackRids)"/>
@@ -248,9 +249,10 @@
linux-x64;
linux-arm;
linux-arm64;
+ freebsd-arm64;
" />

- <Net50Crossgen2SupportedRids Include="linux-musl-x64;linux-x64;win-x64" />
+ <Net50Crossgen2SupportedRids Include="linux-musl-x64;linux-x64;win-x64;freebsd-arm64;" />

<Net60Crossgen2SupportedRids Include="
@(Net50Crossgen2SupportedRids);
@@ -263,6 +265,7 @@
win-arm;
win-arm64;
win-x86;
+ freebsd-arm64;
" />

<Crossgen2SupportedRids Include="@(Net60Crossgen2SupportedRids)" />
diff --git a/src/redist/targets/GetRuntimeInformation.targets b/src/redist/targets/GetRuntimeInformation.targets
index 6d216ff20..e4494395b 100644
--- a/src/redist/targets/GetRuntimeInformation.targets
+++ b/src/redist/targets/GetRuntimeInformation.targets
@@ -4,7 +4,7 @@
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</HostRid>
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</HostRid>

- <IsLinux Condition = " $([MSBuild]::IsOSPlatform('LINUX')) ">True</IsLinux>
+ <IsLinux Condition = " $([MSBuild]::IsOSPlatform('LINUX')) AND ('$(OSName)' == '' OR '$(OSName)' == 'linux') ">True</IsLinux>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('WINDOWS')) ">win</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('OSX')) ">osx</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD')) ">freebsd</HostOSName>
138 changes: 138 additions & 0 deletions patches8/runtime_preview1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
diff --git a/eng/Versions.props b/eng/Versions.props
index 2abb1a3788e..a045e560e71 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -113,6 +113,7 @@
<runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.23073.1</runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.23073.1</runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.23073.1</runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion>
+ <runtimefreebsdarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.23073.1</runtimefreebsdarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<!-- Libraries dependencies -->
<MicrosoftBclAsyncInterfacesVersion>6.0.0</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclHashCodeVersion>1.1.1</MicrosoftBclHashCodeVersion>
diff --git a/eng/restore/docs.targets b/eng/restore/docs.targets
index 764bc5bbefb..de02f7d4a7b 100644
--- a/eng/restore/docs.targets
+++ b/eng/restore/docs.targets
@@ -39,8 +39,7 @@
<Copy SourceFiles="@(DocFile)"
DestinationFiles="$(XmlDocDir)\%(SubFolder)%(FileName)%(Extension)"
SkipUnchangedFiles="true"
- UseHardlinksIfPossible="true" />
-
+ UseHardlinksIfPossible="false" />
</Target>

</Project>
diff --git a/eng/restore/optimizationData.targets b/eng/restore/optimizationData.targets
index 207992d2e89..230b552915d 100644
--- a/eng/restore/optimizationData.targets
+++ b/eng/restore/optimizationData.targets
@@ -43,7 +43,7 @@
<Copy SourceFiles="@(_optimizationMibcFile)"
DestinationFiles="@(_optimizationMibcFile->'$(MibcOptimizationDataDir)%(SubdirectoryName)/%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
- UseHardlinksIfPossible="true" />
+ UseHardlinksIfPossible="false" />

</Target>
</Project>
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
index eb9f33319f0..74d2fc1c4d1 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
@@ -21,6 +21,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<CppLibCreator>ar</CppLibCreator>
<DsymUtilOptions Condition="'$(TargetOS)' == 'osx'">--flat</DsymUtilOptions>
<_SymbolPrefix Condition="'$(TargetOS)' == 'osx'">_</_SymbolPrefix>
+ <UseLLVMLinker Condition="'$(UseLLVMLinker)' == '' and '$(TargetOS)' == 'freebsd'">true</UseLLVMLinker>
</PropertyGroup>

<Target Name="SetupOSSpecificProps" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
diff --git a/src/coreclr/nativeaot/Runtime/unix/UnixContext.cpp b/src/coreclr/nativeaot/Runtime/unix/UnixContext.cpp
index d18b2edad59..47d03673efa 100644
--- a/src/coreclr/nativeaot/Runtime/unix/UnixContext.cpp
+++ b/src/coreclr/nativeaot/Runtime/unix/UnixContext.cpp
@@ -183,7 +183,43 @@ int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*)

#ifdef HOST_64BIT

-#if defined(HOST_ARM64)
+#if defined(HOST_ARM64) && defined(TARGET_FREEBSD)
+
+#define MCREG_X0(mc) (mc.mc_gpregs.gp_x[0])
+#define MCREG_X1(mc) (mc.mc_gpregs.gp_x[1])
+#define MCREG_X2(mc) (mc.mc_gpregs.gp_x[2])
+#define MCREG_X3(mc) (mc.mc_gpregs.gp_x[3])
+#define MCREG_X4(mc) (mc.mc_gpregs.gp_x[4])
+#define MCREG_X5(mc) (mc.mc_gpregs.gp_x[5])
+#define MCREG_X6(mc) (mc.mc_gpregs.gp_x[6])
+#define MCREG_X7(mc) (mc.mc_gpregs.gp_x[7])
+#define MCREG_X8(mc) (mc.mc_gpregs.gp_x[8])
+#define MCREG_X9(mc) (mc.mc_gpregs.gp_x[9])
+#define MCREG_X10(mc) (mc.mc_gpregs.gp_x[10])
+#define MCREG_X11(mc) (mc.mc_gpregs.gp_x[11])
+#define MCREG_X12(mc) (mc.mc_gpregs.gp_x[12])
+#define MCREG_X13(mc) (mc.mc_gpregs.gp_x[13])
+#define MCREG_X14(mc) (mc.mc_gpregs.gp_x[14])
+#define MCREG_X15(mc) (mc.mc_gpregs.gp_x[15])
+#define MCREG_X16(mc) (mc.mc_gpregs.gp_x[16])
+#define MCREG_X17(mc) (mc.mc_gpregs.gp_x[17])
+#define MCREG_X18(mc) (mc.mc_gpregs.gp_x[18])
+#define MCREG_X19(mc) (mc.mc_gpregs.gp_x[19])
+#define MCREG_X20(mc) (mc.mc_gpregs.gp_x[20])
+#define MCREG_X21(mc) (mc.mc_gpregs.gp_x[21])
+#define MCREG_X22(mc) (mc.mc_gpregs.gp_x[22])
+#define MCREG_X23(mc) (mc.mc_gpregs.gp_x[23])
+#define MCREG_X24(mc) (mc.mc_gpregs.gp_x[24])
+#define MCREG_X25(mc) (mc.mc_gpregs.gp_x[25])
+#define MCREG_X26(mc) (mc.mc_gpregs.gp_x[26])
+#define MCREG_X27(mc) (mc.mc_gpregs.gp_x[27])
+#define MCREG_X28(mc) (mc.mc_gpregs.gp_x[28])
+#define MCREG_Lr(mc) (mc.mc_gpregs.gp_lr)
+#define MCREG_Sp(mc) (mc.mc_gpregs.gp_sp)
+#define MCREG_Pc(mc) (mc.mc_gpregs.gp_elr)
+#define MCREG_Fp(mc) (mc.mc_gpregs.gp_x[29])
+
+#elif defined(HOST_ARM64)

#define MCREG_X0(mc) ((mc).regs[0])
#define MCREG_X1(mc) ((mc).regs[1])
diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props
index 347ead37e8b..da209483089 100644
--- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props
+++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props
@@ -46,6 +46,7 @@
<ObjWriterVersion Condition="'$(ObjWriterVersion)' == '' and '$(ObjWriterRid)' == 'osx.11.0-arm64'">$(runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion)</ObjWriterVersion>
<ObjWriterVersion Condition="'$(ObjWriterVersion)' == '' and '$(ObjWriterRid)' == 'osx.10.12-x64'">$(runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion)</ObjWriterVersion>
<ObjWriterVersion Condition="'$(ObjWriterVersion)' == '' and '$(ObjWriterRid)' == 'freebsd-x64'">$(runtimefreebsdx64MicrosoftNETCoreRuntimeObjWriterVersion)</ObjWriterVersion>
+ <ObjWriterVersion Condition="'$(ObjWriterVersion)' == '' and '$(ObjWriterRid)' == 'freebsd-arm64'">$(runtimefreebsdarm64MicrosoftNETCoreRuntimeObjWriterVersion)</ObjWriterVersion>

<!-- CoreDisTools are used in debugging visualizers. -->
<IncludeCoreDisTools Condition="'$(Configuration)' != 'Release' and '$(CrossHostArch)' == ''">true</IncludeCoreDisTools>
diff --git a/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj b/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
index f2d7f5c109a..3ca226d94ea 100644
--- a/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
+++ b/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
@@ -6,7 +6,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
- <RuntimeIdentifiers>linux-x64;win-x64;osx-x64;freebsd-x64</RuntimeIdentifiers>
+ <RuntimeIdentifiers>linux-x64;win-x64;osx-x64;freebsd-x64;freebsd-arm64</RuntimeIdentifiers>
<Configurations>Debug;Release;Checked</Configurations>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
diff --git a/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/ILCompilerRIDs.props b/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/ILCompilerRIDs.props
index 8cd82c085c1..bab4b4c356b 100644
--- a/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/ILCompilerRIDs.props
+++ b/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/ILCompilerRIDs.props
@@ -9,6 +9,7 @@
<OfficialBuildRID Include="osx-x64" Platform="x64" />
<OfficialBuildRID Include="win-arm64" Platform="arm64" />
<OfficialBuildRID Include="win-x64" Platform="x64" />
- <OfficialBUildRID Include="freebsd-x64" Platform="x64" />
+ <OfficialBuildRID Include="freebsd-x64" Platform="x64" />
+ <OfficialBuildRID Include="freebsd-arm64" Platform="arm64" />
</ItemGroup>
</Project>

0 comments on commit ff75ae8

Please sign in to comment.