diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-09-19 15:19:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 15:19:22 +0300 |
commit | efd29b5cf854679349066e22ef9038b8cfe76d94 (patch) | |
tree | 2de750c1ac8a487d7f6d149592a6362ade6a5a77 /src/BuildIntegration | |
parent | f9124d69e41d42196510dd7234b2d53fed48ad4c (diff) | |
parent | 49f9ed0e66fc2d4cd682821396c6af5e80182048 (diff) |
Merge pull request #25 from ntherning/bump-corert
Bump to latest upstream
Diffstat (limited to 'src/BuildIntegration')
4 files changed, 76 insertions, 27 deletions
diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index 5a801d765..bf6c643da 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -53,6 +53,10 @@ <!-- Fail with descriptive error message for common mistake. --> <Error Condition="'$(RuntimeIdentifier)' == ''" Text="RuntimeIdentifier is required for native compilation. Try running dotnet publish with the -r option value specified." /> + <!-- Fail with descriptive error message for common unsupported case. --> + <Error Condition="'$(OS)' == 'Windows_NT' and !$(RuntimeIdentifier.StartsWith('win'))" Text="Cross-compilation is not supported yet. https://github.com/dotnet/corert/issues/5458" /> + <Error Condition="'$(OS)' != 'Windows_NT' and $(RuntimeIdentifier.StartsWith('win'))" Text="Cross-compilation is not supported yet. https://github.com/dotnet/corert/issues/5458" /> + <!-- CoreRT SDK and Framework Assemblies need to be defined to avoid CoreCLR implementations being set as compiler inputs --> <Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" /> <Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" /> @@ -66,4 +70,10 @@ </Target> + <Target Name="CopyNativePdb" Condition="'$(DebugType)' != 'None' and '$(TargetOS)' == 'Windows_NT'" AfterTargets="Publish"> + <!-- dotnet CLI produces managed debug symbols - substitute with those we generated during native compilation --> + <Delete Files="$(PublishDir)\$(TargetName).pdb"/> + <Copy SourceFiles="$(NativeOutputPath)$(TargetName).pdb" DestinationFolder="$(PublishDir)" /> + </Target> + </Project> diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props b/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props index 441f4754c..a8c8bafdb 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props +++ b/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props @@ -36,6 +36,8 @@ See the LICENSE file in the project root for more information. <PropertyGroup> <NativeLibraryExtension Condition="'$(NativeCodeGen)' != 'wasm'">.a</NativeLibraryExtension> <NativeLibraryExtension Condition="'$(NativeCodeGen)' == 'wasm'">.bc</NativeLibraryExtension> + <FullRuntimeName>libRuntime</FullRuntimeName> + <FullRuntimeName Condition="'$(ServerGarbageCollection)' != ''">libRuntime.ServerGC</FullRuntimeName> </PropertyGroup> <ItemGroup> @@ -50,7 +52,7 @@ See the LICENSE file in the project root for more information. <NativeLibrary Condition="'$(IlcMultiModule)' == 'true' and $(NativeCodeGen) == ''" Include="$(SharedLibrary)" /> <NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) == ''" Include="$(IlcPath)/sdk/libbootstrapper.a" /> <NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) != ''" Include="$(IlcPath)/sdk/libbootstrapperdll.a" /> - <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/libRuntime.a" /> + <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/$(FullRuntimeName).a" /> <NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)/sdk/libbootstrappercpp.a" /> <NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)/sdk/libPortableRuntime.a" /> <NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)/sdk/libbootstrappercpp.bc" /> @@ -59,6 +61,7 @@ See the LICENSE file in the project root for more information. <ItemGroup> <NativeLibrary Include="$(IlcPath)/sdk/libSystem.Private.CoreLib.Native$(NativeLibraryExtension)" /> + <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/libSystem.Private.TypeLoader.Native$(NativeLibraryExtension)" /> <NativeLibrary Include="$(IlcPath)/framework/System.Native$(NativeLibraryExtension)" /> <NativeLibrary Include="$(IlcPath)/framework/System.Globalization.Native$(NativeLibraryExtension)" /> <NativeLibrary Include="$(IlcPath)/framework/System.IO.Compression.Native$(NativeLibraryExtension)" /> @@ -71,26 +74,28 @@ See the LICENSE file in the project root for more information. <ItemGroup Condition="'$(TargetOS)' == 'OSX'"> <NativeFramework Include="CoreFoundation" /> <NativeFramework Include="Security" /> + <NativeFramework Include="GSS" /> </ItemGroup> <ItemGroup> <LinkerArg Include="@(NativeLibrary)" /> <LinkerArg Include="-g" /> <LinkerArg Include="-Wl,-rpath,'$ORIGIN'" /> + <LinkerArg Include="-Wl,--as-needed" Condition="'$(TargetOS)' != 'OSX'" /> <LinkerArg Include="-pthread" /> <LinkerArg Include="-lstdc++" /> <LinkerArg Include="-ldl" /> <LinkerArg Include="-lm" /> <LinkerArg Include="-lcurl" /> <LinkerArg Include="-lz" /> - <LinkerArg Include="-luuid" Condition="'$(TargetOS)' != 'OSX'" /> + <LinkerArg Include="-lgssapi_krb5" Condition="'$(TargetOS)' != 'OSX'" /> <LinkerArg Include="-lrt" Condition="'$(TargetOS)' != 'OSX'" /> <LinkerArg Include="-licucore" Condition="'$(TargetOS)' == 'OSX'" /> <LinkerArg Include="-dynamiclib" Condition="'$(TargetOS)' == 'OSX' and '$(NativeLib)' == 'Shared'" /> <LinkerArg Include="-shared" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == 'Shared'" /> <LinkerArg Include="@(NativeFramework->'-framework %(Identity)')" Condition="'$(TargetOS)' == 'OSX'" /> </ItemGroup> - + <Exec Command="command -v $(CppLinker)" IgnoreExitCode="true"> <Output TaskParameter="ExitCode" PropertyName="_WhereLinker"/> </Exec> diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props b/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props index eadca8826..b06165b8a 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props +++ b/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props @@ -18,6 +18,8 @@ See the LICENSE file in the project root for more information. <CppCompiler>cl</CppCompiler> <CppLinker>link</CppLinker> <CppLibCreator>lib</CppLibCreator> + <FullRuntimeName>Runtime</FullRuntimeName> + <FullRuntimeName Condition="'$(ServerGarbageCollection)' != ''">Runtime.ServerGC</FullRuntimeName> </PropertyGroup> <!-- Part of workaround for lack of secondary build artifact import - https://github.com/Microsoft/msbuild/issues/2807 --> @@ -36,7 +38,9 @@ See the LICENSE file in the project root for more information. <ItemGroup> <NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) == ''" Include="$(IlcPath)\sdk\bootstrapper.lib" /> <NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) != ''" Include="$(IlcPath)\sdk\bootstrapperdll.lib" /> - <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\Runtime.lib" /> + <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\$(FullRuntimeName).lib" /> + <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\System.Private.TypeLoader.Native.lib" /> + <NativeLibrary Condition="$(NativeCodeGen) == '' and '$(ExperimentalJitSupport)' == 'true'" Include="$(IlcPath)\sdk\System.Private.Jit.Native.lib" /> <NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)\sdk\bootstrappercpp.lib" /> <NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)\sdk\PortableRuntime.lib" /> <NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)\sdk\bootstrappercpp.lib" /> @@ -61,10 +65,11 @@ See the LICENSE file in the project root for more information. <ItemGroup> <LinkerArg Condition="$(NativeLib) == 'Shared'" Include="/DLL" /> - <LinkerArg Include="@(NativeLibrary)" /> + <LinkerArg Include="@(NativeLibrary->'"%(Identity)"')" /> <LinkerArg Include="/NOLOGO /DEBUG /MANIFEST:NO" /> <!-- The runtime is not compatible with jump stubs inserted by incremental linking. --> <LinkerArg Include="/INCREMENTAL:NO" /> + <LinkerArg Condition="'$(OutputType)' == 'WinExe'" Include="/SUBSYSTEM:WINDOWS /ENTRY:wmainCRTStartup" /> </ItemGroup> <ItemGroup> diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.targets b/src/BuildIntegration/Microsoft.NETCore.Native.targets index 23b817c7a..e5d806dce 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/BuildIntegration/Microsoft.NETCore.Native.targets @@ -39,14 +39,15 @@ See the LICENSE file in the project root for more information. <IlcOutputFileExt Condition="$(NativeCodeGen) == 'cpp'">.cpp</IlcOutputFileExt> <IlcOutputFileExt Condition="'$(NativeCodeGen)' == 'wasm'">.bc</IlcOutputFileExt> - - <NativeBinaryExt Condition="'$(OutputType)' == 'Exe' and '$(TargetOS)' == 'Windows_NT'">.exe</NativeBinaryExt> - <NativeBinaryExt Condition="'$(OutputType)' == 'Exe' and '$(TargetOS)' != 'Windows_NT'"></NativeBinaryExt> - <NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Shared'">.dll</NativeBinaryExt> - <NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'OSX' and $(NativeLib) == 'Shared'">.dylib</NativeBinaryExt> - <NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' != 'Windows_NT' and '$(TargetOS)' != 'OSX' and $(NativeLib) == 'Shared'">.so</NativeBinaryExt> - <NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Static'">.lib</NativeBinaryExt> - <NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' != 'Windows_NT' and $(NativeLib) == 'Static'">.a</NativeBinaryExt> + <IsNativeExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true</IsNativeExecutable> + + <NativeBinaryExt Condition="'$(IsNativeExecutable)' == 'true' and '$(TargetOS)' == 'Windows_NT'">.exe</NativeBinaryExt> + <NativeBinaryExt Condition="'$(IsNativeExecutable)' == 'true' and '$(TargetOS)' != 'Windows_NT'"></NativeBinaryExt> + <NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Shared'">.dll</NativeBinaryExt> + <NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'OSX' and $(NativeLib) == 'Shared'">.dylib</NativeBinaryExt> + <NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' != 'Windows_NT' and '$(TargetOS)' != 'OSX' and $(NativeLib) == 'Shared'">.so</NativeBinaryExt> + <NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Static'">.lib</NativeBinaryExt> + <NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' != 'Windows_NT' and $(NativeLib) == 'Static'">.a</NativeBinaryExt> <NativeBinaryExt Condition="'$(NativeCodeGen)' == 'wasm'">.html</NativeBinaryExt> <ExportsFileExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT' and '$(NativeLib)' == 'Shared'">.def</ExportsFileExt> @@ -66,6 +67,8 @@ See the LICENSE file in the project root for more information. <FrameworkLibPath Condition="'$(FrameworkLibPath)' == ''">$(NativeOutputPath)</FrameworkLibPath> <FrameworkObjPath Condition="'$(FrameworkObjPath)' == ''">$(NativeIntermediateOutputPath)</FrameworkObjPath> + <ExperimentalDynamicCodeSupport Condition="'$(ExperimentalInterpreterSupport)' == 'true' or '$(ExperimentalJitSupport)' == 'true'">true</ExperimentalDynamicCodeSupport> + <SharedLibrary Condition="'$(OS)' == 'Windows_NT'">$(FrameworkLibPath)\Framework$(LibFileExt)</SharedLibrary> <SharedLibrary Condition="'$(OS)' != 'Windows_NT'">$(FrameworkLibPath)\libframework$(LibFileExt)</SharedLibrary> <IlcDynamicBuildPropertyDependencies Condition="'$(IlcCalledViaPackage)' == 'true'">SetupProperties</IlcDynamicBuildPropertyDependencies> @@ -78,10 +81,32 @@ See the LICENSE file in the project root for more information. </PropertyGroup> <ItemGroup> + <AutoInitializedAssemblies Include="System.Private.CoreLib" /> + <AutoInitializedAssemblies Include="System.Private.DeveloperExperience.Console" /> + <AutoInitializedAssemblies Condition="'$(ExperimentalInterpreterSupport)' == 'true'" Include="System.Private.Interpreter" /> + <AutoInitializedAssemblies Condition="'$(ExperimentalJitSupport)' == 'true'" Include="System.Private.Jit" /> + </ItemGroup> + + <ItemGroup Condition="'$(ExperimentalDynamicCodeSupport)' != 'true'"> + <AutoInitializedAssemblies Include="System.Private.StackTraceMetadata" /> + <AutoInitializedAssemblies Include="System.Private.TypeLoader" /> + <AutoInitializedAssemblies Include="System.Private.Reflection.Execution" /> + <AutoInitializedAssemblies Include="System.Private.Interop" /> + </ItemGroup> + + <ItemGroup Condition="'$(ExperimentalDynamicCodeSupport)' == 'true'"> + <AutoInitializedAssemblies Include="System.Private.StackTraceMetadata.Experimental" /> + <AutoInitializedAssemblies Include="System.Private.TypeLoader.Experimental" /> + <AutoInitializedAssemblies Include="System.Private.Reflection.Execution.Experimental" /> + <AutoInitializedAssemblies Include="System.Private.Interop.Experimental" /> + </ItemGroup> + + <ItemGroup> <PrivateSdkAssemblies Include="$(IlcPath)\sdk\*.dll" /> </ItemGroup> <ItemGroup> - <FrameworkAssemblies Include="$(IlcPath)\framework\*.dll" /> + <!-- Exclude clrcompression.dll for now https://github.com/dotnet/corert/issues/5496 --> + <FrameworkAssemblies Include="$(IlcPath)\framework\*.dll" Exclude="$(IlcPath)\framework\clrcompression.dll" /> </ItemGroup> <ItemGroup> @@ -159,6 +184,10 @@ See the LICENSE file in the project root for more information. <IlcArg Condition="$(OutputType) == 'Library' and $(NativeLib) != ''" Include="--nativelib" /> <IlcArg Condition="$(ExportsFile) != ''" Include="--exportsfile:$(ExportsFile)" /> <ILcArg Condition="'$(Platform)' == 'wasm'" Include="--wasm" /> + <ILcArg Condition="'$(ExperimentalDynamicCodeSupport)' == 'true'" Include="--nometadatablocking" /> + <IlcArg Include="@(AutoInitializedAssemblies->'--initassembly:%(Identity)')" /> + <IlcArg Include="@(AppContextSwitchOverrides->'--appcontextswitch:%(Identity)')" /> + <IlcArg Condition="$(ServerGarbageCollection) != ''" Include="--runtimeopt:RH_UseServerGC=1" /> </ItemGroup> <MakeDir Directories="$(NativeIntermediateOutputPath)" /> @@ -180,9 +209,9 @@ See the LICENSE file in the project root for more information. DependsOnTargets="IlcCompile"> <ItemGroup> - <CompilerArg Include="$(IlcCompileOutput)" /> - <CompilerArg Include="/Fo$(NativeObject)" Condition="'$(OS)' == 'Windows_NT'" /> - <CompilerArg Include="-o $(NativeObject)" Condition="'$(OS)' != 'Windows_NT'" /> + <CompilerArg Include=""$(IlcCompileOutput)"" /> + <CompilerArg Include="/Fo"$(NativeObject)"" Condition="'$(OS)' == 'Windows_NT'" /> + <CompilerArg Include="-o "$(NativeObject)"" Condition="'$(OS)' != 'Windows_NT'" /> <CompilerArg Include="@(CppCompilerAndLinkerArg)" /> </ItemGroup> @@ -198,19 +227,19 @@ See the LICENSE file in the project root for more information. DependsOnTargets="$(LinkNativeDependsOn)"> <ItemGroup> - <CustomLinkerArg Include="$(NativeObject)" /> - <CustomLinkerArg Include="-o $(NativeBinary)" Condition="'$(OS)' != 'Windows_NT'" /> - <CustomLinkerArg Include="/OUT:$(NativeBinary)" Condition="'$(OS)' == 'Windows_NT'" /> - <CustomLinkerArg Include="/DEF:$(ExportsFile)" Condition="'$(OS)' == 'Windows_NT' and $(ExportsFile) != ''" /> + <CustomLinkerArg Include=""$(NativeObject)"" /> + <CustomLinkerArg Include="-o "$(NativeBinary)"" Condition="'$(OS)' != 'Windows_NT'" /> + <CustomLinkerArg Include="/OUT:"$(NativeBinary)"" Condition="'$(OS)' == 'Windows_NT'" /> + <CustomLinkerArg Include="/DEF:"$(ExportsFile)"" Condition="'$(OS)' == 'Windows_NT' and $(ExportsFile) != ''" /> <CustomLinkerArg Include="/LIBPATH:"%(AdditionalNativeLibraryDirectories.Identity)"" Condition="'$(OS)' == 'Windows_NT' and '@(AdditionalNativeLibraryDirectories->Count())' > 0" /> - <CustomLinkerArg Include="-exported_symbols_list $(ExportsFile)" Condition="'$(OS)' != 'Windows_NT' and $(ExportsFile) != ''" /> + <CustomLinkerArg Include="-exported_symbols_list "$(ExportsFile)"" Condition="'$(OS)' != 'Windows_NT' and $(ExportsFile) != ''" /> <CustomLinkerArg Include="@(LinkerArg)" /> </ItemGroup> <ItemGroup> - <CustomLibArg Include="-crs $(NativeBinary)" Condition="'$(OS)' != 'Windows_NT'" /> - <CustomLibArg Include="/OUT:$(NativeBinary)" Condition="'$(OS)' == 'Windows_NT'" /> - <CustomLibArg Include="$(NativeObject)" /> + <CustomLibArg Include="-crs "$(NativeBinary)"" Condition="'$(OS)' != 'Windows_NT'" /> + <CustomLibArg Include="/OUT:"$(NativeBinary)"" Condition="'$(OS)' == 'Windows_NT'" /> + <CustomLibArg Include=""$(NativeObject)"" /> </ItemGroup> <MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(NativeBinary)))" /> @@ -224,8 +253,8 @@ See the LICENSE file in the project root for more information. <Exec Command="$(CppLibCreator) @"$(NativeIntermediateOutputPath)lib.rsp"" Condition="'$(OS)' == 'Windows_NT' and '$(NativeLib)' == 'Static' and '$(NativeCodeGen)' != 'wasm'" /> <PropertyGroup> - <EmccArgs>"$(NativeObject)" -o "$(NativeBinary)" -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 </EmccArgs> - <EmccArgs Condition="'$(Platform)'=='wasm'">$(EmccArgs) "$(IlcPath)/sdk/libPortableRuntime.bc" "$(IlcPath)/sdk/libbootstrappercpp.bc" </EmccArgs> + <EmccArgs>"$(NativeObject)" -o "$(NativeBinary)" -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 --emrun </EmccArgs> + <EmccArgs Condition="'$(Platform)'=='wasm'">$(EmccArgs) "$(IlcPath)/sdk/libPortableRuntime.bc" "$(IlcPath)/sdk/libbootstrappercpp.bc" "$(IlcPath)/sdk/libSystem.Private.CoreLib.Native.bc" </EmccArgs> <EmccArgs Condition="'$(Configuration)'=='Release'">$(EmccArgs) -O2 --llvm-lto 2</EmccArgs> <EmccArgs Condition="'$(Configuration)'=='Debug'">$(EmccArgs) -g3</EmccArgs> </PropertyGroup> |