diff --git a/patches/aspnetcore/0011-Add-FreeBSD.patch b/patches/aspnetcore/0011-Add-FreeBSD.patch new file mode 100644 index 0000000000..1ea2530ab7 --- /dev/null +++ b/patches/aspnetcore/0011-Add-FreeBSD.patch @@ -0,0 +1,32 @@ +From 457e4bcc40228d64bb98c4e35937d31b4cc76599 Mon Sep 17 00:00:00 2001 +From: Tomas Weinfurt +Date: Wed, 13 Nov 2019 22:32:02 -0800 +Subject: [PATCH] Add FreeBSD + +--- + Directory.Build.props | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 80e6bb14f0..76b1b4451b 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -115,6 +115,7 @@ + + win + osx ++ freebsd + linux + x64 + $(TargetOsName)-$(TargetArchitecture) +@@ -125,6 +126,7 @@ + win-x86; + win-arm; + osx-x64; ++ freebsd-x64; + linux-musl-x64; + linux-musl-arm64; + linux-x64; +-- +2.23.0 + diff --git a/patches/core-setup/0005-Add-FreeBSD-support.patch b/patches/core-setup/0005-Add-FreeBSD-support.patch new file mode 100644 index 0000000000..d15b6d64c5 --- /dev/null +++ b/patches/core-setup/0005-Add-FreeBSD-support.patch @@ -0,0 +1,40 @@ +From 9847f667b05b577cf98f92cb32f38beff95ea504 Mon Sep 17 00:00:00 2001 +From: Tomas Weinfurt +Date: Wed, 13 Nov 2019 00:53:31 -0800 +Subject: [PATCH] add freebsd support + +--- + src/Directory.Build.props | 4 ++-- + src/pkg/projects/netcoreappRIDs.props | 1 + + 3 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/Directory.Build.props b/src/Directory.Build.props +index c22e11fa..1fc24b41 100644 +--- a/src/Directory.Build.props ++++ b/src/Directory.Build.props +@@ -12,7 +12,7 @@ + .map + .ni.pdb + +- ++ + + +- +\ No newline at end of file ++ +diff --git a/src/pkg/projects/netcoreappRIDs.props b/src/pkg/projects/netcoreappRIDs.props +index 7483d182..5561842f 100644 +--- a/src/pkg/projects/netcoreappRIDs.props ++++ b/src/pkg/projects/netcoreappRIDs.props +@@ -35,6 +35,7 @@ + ++ + + armel + +-- +2.23.0 + diff --git a/patches/core-setup/0006-Fix-OSGroup-on-FreeBSD.patch b/patches/core-setup/0006-Fix-OSGroup-on-FreeBSD.patch new file mode 100644 index 0000000000..c958081a70 --- /dev/null +++ b/patches/core-setup/0006-Fix-OSGroup-on-FreeBSD.patch @@ -0,0 +1,24 @@ +From 63218afeff61a044c6482c5cd119a17bdb59de09 Mon Sep 17 00:00:00 2001 +From: Tomas Weinfurt +Date: Wed, 13 Nov 2019 14:07:57 -0800 +Subject: [PATCH] Fix OSGroup on FreeBSD + +--- + Directory.Build.props | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 890012bf..a2539d51 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -111,6 +111,7 @@ + --> + + OSX ++ FreeBSD + $(OS) + + +-- +2.23.0 + diff --git a/patches/corefx/0005-Add-FreeBSD-RIDs.patch b/patches/corefx/0005-Add-FreeBSD-RIDs.patch new file mode 100644 index 0000000000..0d3b444248 --- /dev/null +++ b/patches/corefx/0005-Add-FreeBSD-RIDs.patch @@ -0,0 +1,196 @@ +From 32d103eecf9d1e9648e6b1ed063860fed00bcc8f Mon Sep 17 00:00:00 2001 +From: Tomas Weinfurt +Date: Thu, 24 Oct 2019 10:19:39 -0700 +Subject: [PATCH] add entries for new FreeBSD releases (#41794) + +--- + .../runtime.compatibility.json | 81 +++---------------- + pkg/Microsoft.NETCore.Platforms/runtime.json | 38 ++------- + .../runtimeGroups.props | 2 +- + 3 files changed, 22 insertions(+), 99 deletions(-) + +diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json +index 1e5c380a7a6a..2a196ecc9fc7 100644 +--- a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json ++++ b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json +@@ -984,17 +984,17 @@ + "any", + "base" + ], +- "freebsd.11.0": [ +- "freebsd.11.0", ++ "freebsd.12": [ ++ "freebsd.12", + "freebsd.11", + "freebsd", + "unix", + "any", + "base" + ], +- "freebsd.11.0-x64": [ +- "freebsd.11.0-x64", +- "freebsd.11.0", ++ "freebsd.12-x64": [ ++ "freebsd.12-x64", ++ "freebsd.12", + "freebsd.11-x64", + "freebsd.11", + "freebsd-x64", +@@ -1004,75 +1004,20 @@ + "any", + "base" + ], +- "freebsd.11.1": [ +- "freebsd.11.1", +- "freebsd.11.0", ++ "freebsd.13": [ ++ "freebsd.13", ++ "freebsd.12", + "freebsd.11", + "freebsd", + "unix", + "any", + "base" + ], +- "freebsd.11.1-x64": [ +- "freebsd.11.1-x64", +- "freebsd.11.1", +- "freebsd.11.0-x64", +- "freebsd.11.0", +- "freebsd.11-x64", +- "freebsd.11", +- "freebsd-x64", +- "freebsd", +- "unix-x64", +- "unix", +- "any", +- "base" +- ], +- "freebsd.11.2": [ +- "freebsd.11.2", +- "freebsd.11.1", +- "freebsd.11.0", +- "freebsd.11", +- "freebsd", +- "unix", +- "any", +- "base" +- ], +- "freebsd.11.2-x64": [ +- "freebsd.11.2-x64", +- "freebsd.11.2", +- "freebsd.11.1-x64", +- "freebsd.11.1", +- "freebsd.11.0-x64", +- "freebsd.11.0", +- "freebsd.11-x64", +- "freebsd.11", +- "freebsd-x64", +- "freebsd", +- "unix-x64", +- "unix", +- "any", +- "base" +- ], +- "freebsd.11.3": [ +- "freebsd.11.3", +- "freebsd.11.2", +- "freebsd.11.1", +- "freebsd.11.0", +- "freebsd.11", +- "freebsd", +- "unix", +- "any", +- "base" +- ], +- "freebsd.11.3-x64": [ +- "freebsd.11.3-x64", +- "freebsd.11.3", +- "freebsd.11.2-x64", +- "freebsd.11.2", +- "freebsd.11.1-x64", +- "freebsd.11.1", +- "freebsd.11.0-x64", +- "freebsd.11.0", ++ "freebsd.13-x64": [ ++ "freebsd.13-x64", ++ "freebsd.13", ++ "freebsd.12-x64", ++ "freebsd.12", + "freebsd.11-x64", + "freebsd.11", + "freebsd-x64", +diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.json b/pkg/Microsoft.NETCore.Platforms/runtime.json +index b2f286ea2479..e70f2da7e668 100644 +--- a/pkg/Microsoft.NETCore.Platforms/runtime.json ++++ b/pkg/Microsoft.NETCore.Platforms/runtime.json +@@ -510,48 +510,26 @@ + "freebsd-x64" + ] + }, +- "freebsd.11.0": { ++ "freebsd.12": { + "#import": [ + "freebsd.11" + ] + }, +- "freebsd.11.0-x64": { ++ "freebsd.12-x64": { + "#import": [ +- "freebsd.11.0", ++ "freebsd.12", + "freebsd.11-x64" + ] + }, +- "freebsd.11.1": { ++ "freebsd.13": { + "#import": [ +- "freebsd.11.0" ++ "freebsd.12" + ] + }, +- "freebsd.11.1-x64": { ++ "freebsd.13-x64": { + "#import": [ +- "freebsd.11.1", +- "freebsd.11.0-x64" +- ] +- }, +- "freebsd.11.2": { +- "#import": [ +- "freebsd.11.1" +- ] +- }, +- "freebsd.11.2-x64": { +- "#import": [ +- "freebsd.11.2", +- "freebsd.11.1-x64" +- ] +- }, +- "freebsd.11.3": { +- "#import": [ +- "freebsd.11.2" +- ] +- }, +- "freebsd.11.3-x64": { +- "#import": [ +- "freebsd.11.3", +- "freebsd.11.2-x64" ++ "freebsd.13", ++ "freebsd.12-x64" + ] + }, + "gentoo": { +diff --git a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props +index eeb8130b54fb..6c95b67819be 100644 +--- a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props ++++ b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props +@@ -99,7 +99,7 @@ + + unix + x64 +- 11;11.0;11.1;11.2;11.3 ++ 11;12;13 + + + diff --git a/patches/corefx/0006-Do-not-fail-on-test-chmod.patch b/patches/corefx/0006-Do-not-fail-on-test-chmod.patch new file mode 100644 index 0000000000..c165a23f3b --- /dev/null +++ b/patches/corefx/0006-Do-not-fail-on-test-chmod.patch @@ -0,0 +1,25 @@ +From ef90f9473a5b2b24d9c1a523aefa7d6478bd3335 Mon Sep 17 00:00:00 2001 +From: Tomas Weinfurt +Date: Tue, 12 Nov 2019 13:24:37 -0800 +Subject: [PATCH] do not fail on test chmod + +--- + external/runtime/runtime.depproj | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/external/runtime/runtime.depproj b/external/runtime/runtime.depproj +index 3ce0ed89bc..1298019efd 100644 +--- a/external/runtime/runtime.depproj ++++ b/external/runtime/runtime.depproj +@@ -60,7 +60,7 @@ + SkipUnchangedFiles="true" + UseHardlinksIfPossible="$(UseHardlink)" /> + +- ++ + + +Date: Fri, 15 Nov 2019 02:33:07 +0200 +Subject: [PATCH] P/invoke Kernel32.dll only on Windows (#7858) + +--- + src/fsharp/lib.fs | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs +index 6c4599f8a..2cec1e666 100755 +--- a/src/fsharp/lib.fs ++++ b/src/fsharp/lib.fs +@@ -4,6 +4,7 @@ module internal FSharp.Compiler.Lib + + open System.IO + open System.Collections.Generic ++open System.Runtime.InteropServices + open Internal.Utilities + open FSharp.Compiler.AbstractIL + open FSharp.Compiler.AbstractIL.Internal +@@ -515,7 +516,7 @@ module UnmanagedProcessExecutionOptions = + // Translation of C# from http://swikb/v1/DisplayOnlineDoc.aspx?entryID=826 and copy in bug://5018 + [] + let EnableHeapTerminationOnCorruption() = +- if (System.Environment.OSVersion.Version.Major >= 6 && // If OS is Vista or higher ++ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.OSVersion.Version.Major >= 6 && // If OS is Vista or higher + System.Environment.Version.Major < 3) then // and CLR not 3.0 or higher + // "The flag HeapSetInformation sets is available in Windows XP SP3 and later. + // The data structure used for heap information is available on earlier versions of Windows. +@@ -544,4 +545,4 @@ module StackGuard = + + let EnsureSufficientExecutionStack recursionDepth = + if recursionDepth > MaxUncheckedRecursionDepth then +- RuntimeHelpers.EnsureSufficientExecutionStack () +\ No newline at end of file ++ RuntimeHelpers.EnsureSufficientExecutionStack () +-- +2.23.0 + diff --git a/repos/aspnetcore.proj b/repos/aspnetcore.proj index 998a24f032..97dd5ab45e 100644 --- a/repos/aspnetcore.proj +++ b/repos/aspnetcore.proj @@ -7,12 +7,15 @@ + $(TargetRid) + freebsd-x64 + $(BuildCommandArgs) --restore --build --pack $(BuildCommandArgs) --configuration $(Configuration) $(BuildCommandArgs) --ci $(BuildCommandArgs) -bl $(BuildCommandArgs) /p:BuildNodeJs=false - $(BuildCommandArgs) /p:SourceBuildRuntimeIdentifier=$(TargetRid) + $(BuildCommandArgs) /p:SourceBuildRuntimeIdentifier=$(OverrideTargetRid) $(BuildCommandArgs) /p:UseAppHost=false $(BuildCommandArgs) /p:CrossgenOutput=false diff --git a/repos/core-sdk.proj b/repos/core-sdk.proj index c3b8f22631..eb716bf220 100644 --- a/repos/core-sdk.proj +++ b/repos/core-sdk.proj @@ -8,7 +8,8 @@ $(BuildCommandArgs) /p:Rid=$(TargetRid) $(BuildCommandArgs) /p:AspNetCoreSharedFxInstallerRid=linux-x64 $(BuildCommandArgs) /p:OSName=$(OSNameOverride) - + + $(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true $(BuildCommandArgs) /p:CoreSetupRid=osx-x64 $(BuildCommandArgs) /p:CoreSetupRid=$(TargetRid) $(BuildCommandArgs) -c $(Configuration) @@ -39,6 +40,7 @@ win-x64 osx-x64 + freebsd-x64 $(TargetRid) $(ProjectDirectory)artifacts/packages/$(Configuration)/Shipping/ $(PackagesOutput) diff --git a/repos/core-setup.proj b/repos/core-setup.proj index c09c9bd193..79526d143b 100644 --- a/repos/core-setup.proj +++ b/repos/core-setup.proj @@ -3,11 +3,12 @@ - + $(TargetRid) osx-x64 + freebsd-x64 $(PortableBuild) - true + true $(FlagParameterPrefix)restore $(FlagParameterPrefix)build $(BuildArguments) $(FlagParameterPrefix)configuration $(Configuration) diff --git a/repos/coreclr.proj b/repos/coreclr.proj index 775a0c034f..6fb737af92 100644 --- a/repos/coreclr.proj +++ b/repos/coreclr.proj @@ -11,6 +11,7 @@ $(BuildArguments) msbuildonunsupportedplatform $(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE $(BuildArguments) skipnuget cross -skiprestore cmakeargs -DFEATURE_GDBJIT=TRUE + $(BuildArguments) -clang6.0 /p:PortableBuild=true @@ -61,6 +62,7 @@ $(ToolPackageExtractDir)coreclr-tools so + so dylib please define AssemblyExtension for $(TargetOS) diff --git a/repos/corefx.proj b/repos/corefx.proj index 8a1cddf876..9984a33449 100644 --- a/repos/corefx.proj +++ b/repos/corefx.proj @@ -10,6 +10,7 @@ true $(TargetRid) osx-x64 + freebsd-x64 win-x64 $(FlagParameterPrefix)configuration $(Configuration) diff --git a/repos/toolset.proj b/repos/toolset.proj index 33619490f2..780e8913a5 100644 --- a/repos/toolset.proj +++ b/repos/toolset.proj @@ -26,6 +26,7 @@ win-x64 osx-x64 + freebsd-x64 $(TargetRid) $(ProjectDirectory)artifacts/packages/Release/NonShipping/ diff --git a/repos/vstest.proj b/repos/vstest.proj index e77b92bd18..0f8fb96fe1 100644 --- a/repos/vstest.proj +++ b/repos/vstest.proj @@ -3,10 +3,13 @@ + $(TargetRid) + freebsd-x64 + -DotNetBuildFromSource $(BuildCommandArgs) -DotNetCoreSdkDir $(DotNetCliToolDir) $(BuildCommandArgs) -c $(Configuration) - $(BuildCommandArgs) -r $(TargetRid) + $(BuildCommandArgs) -r $(OverrideTargetRid) $(BuildCommandArgs) -v $(OutputPackageVersion) $(ProjectDirectory)/build$(ShellExtension) $(BuildCommandArgs) diff --git a/tools-local/init-build.proj b/tools-local/init-build.proj index d20e6b1ecc..71f88fd79b 100644 --- a/tools-local/init-build.proj +++ b/tools-local/init-build.proj @@ -118,6 +118,7 @@ + freebsd-$(Platform) osx-$(Platform) linux-$(Platform) win-$(Platform)