Skip to content

Commit

Permalink
Delete support for non-RyuJIT based codegens (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Nov 10, 2020
1 parent 7a701b5 commit 01d1c51
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 511 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,4 @@
<Copy SourceFiles="$(NativeOutputPath)$(TargetName).pdb" DestinationFolder="$(PublishDir)" />
</Target>

<Target Name="CopyJitLibrary" Condition="'$(ExperimentalJitSupport)' == 'true'" AfterTargets="Publish">
<ItemGroup>
<ClrJitIlc Include="$(IlcPath)\tools\clrjitilc.*" />
</ItemGroup>
<Copy SourceFiles="@(ClrJitIlc)" DestinationFolder="$(PublishDir)" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,16 @@ The .NET Foundation licenses this file to you under the MIT license.
<Target Name="SetupOSSpecificProps" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">

<PropertyGroup>
<NativeLibraryExtension Condition="'$(NativeCodeGen)' != 'wasm'">.a</NativeLibraryExtension>
<NativeLibraryExtension Condition="'$(NativeCodeGen)' == 'wasm'">.bc</NativeLibraryExtension>
<NativeLibraryExtension>.a</NativeLibraryExtension>
<FullRuntimeName>libRuntime</FullRuntimeName>
<FullRuntimeName Condition="'$(ServerGarbageCollection)' != ''">libRuntime.ServerGC</FullRuntimeName>
</PropertyGroup>

<ItemGroup>
<CppCompilerAndLinkerArg Include="-I $(IlcPath)/inc" />
<CppCompilerAndLinkerArg Condition="'$(Configuration)' == 'Debug'" Include="-g -O0" />
<CppCompilerAndLinkerArg Condition="'$(Configuration)' != 'Debug'" Include="-O2" />
<CppCompilerAndLinkerArg Include="-c -Wno-invalid-offsetof" />
<CppCompilerAndLinkerArg Include="$(AdditionalCppCompilerFlags)" />
</ItemGroup>

<ItemGroup>
<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/$(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" />
<NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)/sdk/libPortableRuntime.bc" />
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
<NativeLibrary Condition="$(NativeLib) == ''" Include="$(IlcPath)/sdk/libbootstrapper.a" />
<NativeLibrary Condition="$(NativeLib) != ''" Include="$(IlcPath)/sdk/libbootstrapperdll.a" />
<NativeLibrary Include="$(IlcPath)/sdk/$(FullRuntimeName).a" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,12 @@ The .NET Foundation licenses this file to you under the MIT license.
<!-- Part of workaround for lack of secondary build artifact import - https://github.com/Microsoft/msbuild/issues/2807 -->
<!-- Ensure that runtime-specific paths have already been set -->
<Target Name="SetupOSSpecificProps" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
<ItemGroup>
<CppCompilerAndLinkerArg Include="/I$(IlcPath)\inc" />
<CppCompilerAndLinkerArg Condition="'$(Configuration)' == 'Debug'" Include="/Od" />
<CppCompilerAndLinkerArg Condition="'$(Configuration)' != 'Debug'" Include="/O2" />
<CppCompilerAndLinkerArg Include="/c /nologo /W3 /GS /DCPPCODEGEN /EHs /Zi /bigobj" />
<CppCompilerAndLinkerArg Condition="'$(UseDebugCrt)' == 'true'" Include="/MTd" />
<CppCompilerAndLinkerArg Condition="'$(UseDebugCrt)' != 'true'" Include="/MT" />
<CppCompilerAndLinkerArg Include="$(AdditionalCppCompilerFlags)" />
</ItemGroup>

<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\$(FullRuntimeName).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" />
<NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)\sdk\PortableRuntime.lib" />
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true' and $(NativeCodeGen) == ''" Include="$(SharedLibrary)" />
<NativeLibrary Condition="$(NativeLib) == ''" Include="$(IlcPath)\sdk\bootstrapper.lib" />
<NativeLibrary Condition="$(NativeLib) != ''" Include="$(IlcPath)\sdk\bootstrapperdll.lib" />
<NativeLibrary Include="$(IlcPath)\sdk\$(FullRuntimeName).lib" />
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,12 @@ The .NET Foundation licenses this file to you under the MIT license.

<PropertyGroup>
<NativeObjectExt Condition="'$(TargetOS)' == 'windows'">.obj</NativeObjectExt>
<NativeObjectExt Condition="'$(TargetOS)' != 'windows' or '$(NativeCodeGen)' == 'wasm'">.o</NativeObjectExt>
<LlvmObjectExt Condition="'$(NativeCodeGen)' == 'wasm'">.bc</LlvmObjectExt>
<NativeObjectExt Condition="'$(TargetOS)' != 'windows'">.o</NativeObjectExt>

<LibFileExt Condition="'$(TargetOS)' == 'windows'">.lib</LibFileExt>
<LibFileExt Condition="'$(TargetOS)' != 'windows'">.a</LibFileExt>

<IlcOutputFileExt Condition="$(IlcOutputFileExt) == ''">$(NativeObjectExt)</IlcOutputFileExt>
<IlcOutputFileExt Condition="$(NativeCodeGen) == 'cpp'">.cpp</IlcOutputFileExt>
<IlcOutputFileExt Condition="'$(NativeCodeGen)' == 'wasm'">.bc</IlcOutputFileExt>

<IsNativeExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true</IsNativeExecutable>

Expand All @@ -57,28 +54,21 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' != 'windows' and '$(TargetOS)' != 'OSX' and $(NativeLib) == 'Shared'">.so</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'windows' and $(NativeLib) == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' != 'windows' and $(NativeLib) == 'Static'">.a</NativeBinaryExt>
<NativeBinaryExt Condition="'$(NativeCodeGen)' == 'wasm'">.html</NativeBinaryExt>

<ExportsFileExt Condition="'$(TargetOS)' == 'windows'">.def</ExportsFileExt>
<ExportsFileExt Condition="'$(TargetOS)' != 'windows'">.exports</ExportsFileExt>

<LlvmObject Condition="'$(NativeCodeGen)' == 'wasm'">$(NativeIntermediateOutputPath)$(TargetName)$(LlvmObjectExt)</LlvmObject>
<NativeObject>$(NativeIntermediateOutputPath)$(TargetName)$(NativeObjectExt)</NativeObject>
<NativeBinary>$(NativeOutputPath)$(TargetName)$(NativeBinaryExt)</NativeBinary>
<ExportsFile Condition="$(NativeLib) == 'Shared' and $(ExportsFile) == ''">$(NativeIntermediateOutputPath)$(TargetName)$(ExportsFileExt)</ExportsFile>

<IlcCompileOutput Condition="$(NativeCodeGen) == ''">$(NativeObject)</IlcCompileOutput>
<IlcCompileOutput Condition="$(NativeCodeGen) == 'cpp'">$(NativeIntermediateOutputPath)$(TargetName).cpp</IlcCompileOutput>
<IlcCompileOutput>$(NativeObject)</IlcCompileOutput>

<LinkNativeDependsOn Condition="$(NativeCodeGen) == ''">IlcCompile</LinkNativeDependsOn>
<LinkNativeDependsOn Condition="$(NativeCodeGen) == 'cpp'">CppCompile</LinkNativeDependsOn>
<LinkNativeDependsOn Condition="$(NativeCodeGen) == 'wasm'">WasmObject</LinkNativeDependsOn>
<LinkNativeDependsOn>IlcCompile</LinkNativeDependsOn>

<FrameworkLibPath Condition="'$(FrameworkLibPath)' == ''">$(NativeOutputPath)</FrameworkLibPath>
<FrameworkObjPath Condition="'$(FrameworkObjPath)' == ''">$(NativeIntermediateOutputPath)</FrameworkObjPath>

<ExperimentalDynamicCodeSupport Condition="'$(ExperimentalInterpreterSupport)' == 'true' or '$(ExperimentalJitSupport)' == 'true'">true</ExperimentalDynamicCodeSupport>

<SharedLibrary Condition="'$(TargetOS)' == 'windows'">$(FrameworkLibPath)\Framework$(LibFileExt)</SharedLibrary>
<SharedLibrary Condition="'$(TargetOS)' != 'windows'">$(FrameworkLibPath)\libframework$(LibFileExt)</SharedLibrary>
<IlcDynamicBuildPropertyDependencies Condition="'$(IlcCalledViaPackage)' == 'true'">SetupProperties</IlcDynamicBuildPropertyDependencies>
Expand All @@ -92,25 +82,16 @@ The .NET Foundation licenses this file to you under the MIT license.

<ItemGroup Condition="$(IlcSystemModule) == ''">
<AutoInitializedAssemblies Include="System.Private.CoreLib" />
<AutoInitializedAssemblies Condition="'$(ExperimentalInterpreterSupport)' == 'true'" Include="System.Private.Interpreter" />
<AutoInitializedAssemblies Condition="'$(ExperimentalJitSupport)' == 'true'" Include="System.Private.Jit" />
</ItemGroup>

<ItemGroup Condition="$(IlcSystemModule) == '' and '$(ExperimentalDynamicCodeSupport)' != 'true'">
<ItemGroup Condition="$(IlcSystemModule) == ''">
<AutoInitializedAssemblies Include="System.Private.StackTraceMetadata" Condition="$(IlcDisableReflection) != 'true' or $(IlcGenerateStackTraceData) == 'true'"/>
<AutoInitializedAssemblies Include="System.Private.TypeLoader" />
<AutoInitializedAssemblies Include="System.Private.Reflection.Execution" Condition="$(IlcDisableReflection) != 'true'" />
<AutoInitializedAssemblies Include="System.Private.DisabledReflection" Condition="$(IlcDisableReflection) == 'true'" />
<AutoInitializedAssemblies Include="System.Private.Interop" />
</ItemGroup>

<ItemGroup Condition="$(IlcSystemModule) == '' and '$(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 Condition="$(IlcSystemModule) == ''">
<AutoInitializedAssemblies Include="System.Private.DeveloperExperience.Console" Condition="$(IlcDisableUnhandledExceptionExperience) != 'true'" />
</ItemGroup>
Expand Down Expand Up @@ -189,7 +170,6 @@ The .NET Foundation licenses this file to you under the MIT license.
<IlcArg Include="-o:$(NativeIntermediateOutputPath)%(ManagedBinary.Filename)$(IlcOutputFileExt)" />
<IlcArg Include="@(IlcReference->'-r:%(Identity)')" />
<IlcArg Condition="$(IlcGenerateMetadataLog) == 'true'" Include="--metadatalog:$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).metadata.csv" />
<IlcArg Condition="$(NativeCodeGen) != ''" Include="--$(NativeCodeGen)" />
<IlcArg Condition="$(IlcMultiModule) == 'true'" Include="--multifile" />
<IlcArg Condition="$(Optimize) == 'true'" Include="-O" />
<IlcArg Condition="$(NativeDebugSymbols) == 'true'" Include="-g" />
Expand All @@ -199,8 +179,6 @@ The .NET Foundation licenses this file to you under the MIT license.
<IlcArg Include="@(RdXmlFile->'--rdxml:%(Identity)')" />
<IlcArg Condition="$(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" />
Expand Down Expand Up @@ -238,24 +216,6 @@ The .NET Foundation licenses this file to you under the MIT license.
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NETCore.Native.Windows.props" Condition="'$(TargetOS)' == 'windows'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NETCore.Native.Unix.props" Condition="'$(TargetOS)' != 'windows'" />

<Target Name="CppCompile"
Inputs="$(IlcCompileOutput)"
Outputs="$(NativeObject)"
DependsOnTargets="IlcCompile">

<ItemGroup>
<CompilerArg Include="&quot;$(IlcCompileOutput)&quot;" />
<CompilerArg Include="/Fo&quot;$(NativeObject)&quot;" Condition="'$(TargetOS)' == 'windows'" />
<CompilerArg Include="-o &quot;$(NativeObject)&quot;" Condition="'$(TargetOS)' != 'windows'" />
<CompilerArg Include="@(CppCompilerAndLinkerArg)" />
</ItemGroup>

<MakeDir Directories="$(NativeIntermediateOutputPath)" />
<Exec Command="$(CppCompiler) @(CompilerArg, ' ')" Condition="'$(TargetOS)' != 'windows'" />
<WriteLinesToFile File="$(NativeIntermediateOutputPath)cl.rsp" Lines="@(CompilerArg)" Overwrite="true" Condition="'$(TargetOS)' == 'windows'"/>
<Exec Command="$(CppCompiler) @&quot;$(NativeIntermediateOutputPath)cl.rsp&quot;" Condition="'$(TargetOS)' == 'windows'" />
</Target>

<Target Name="MultiFileCopyNative"
Inputs="@(NativeObjects)"
Outputs="$(NativeOutputPath)"
Expand All @@ -280,26 +240,6 @@ The .NET Foundation licenses this file to you under the MIT license.

</Target>

<Target Name="WasmObject"
Inputs="$(LlvmObject)"
Outputs="$(NativeObject)"
DependsOnTargets="IlcCompile;GenerateResFile"
Condition="'$(NativeCodeGen)' == 'wasm'">

<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(NativeBinary)))" />

<PropertyGroup>
<EmccArgs>&quot;$(LlvmObject)&quot; -c -o &quot;$(NativeObject)&quot; -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s DISABLE_EXCEPTION_CATCHING=0</EmccArgs>
<EmccArgs Condition="'$(Configuration)'=='Release'">$(EmccArgs) -O2</EmccArgs>
<EmccArgs Condition="'$(Configuration)'=='Debug'">$(EmccArgs) -g3</EmccArgs>
</PropertyGroup>

<Exec Command="&quot;$(EMSDK)/upstream/emscripten/emcc.bat&quot; $(EmccArgs)" Condition="'$(EMSDK)' != '' and '$(TargetOS)' == 'windows'" />
<Exec Command="&quot;$(EMSDK)/upstream/emscripten/emcc&quot; $(EmccArgs)" Condition="'$(EMSDK)' != '' and '$(TargetOS)' != 'windows'" />
<Message Text="Emscripten not found, not linking WebAssembly. To enable WebAssembly linking, install Emscripten and ensure the EMSDK environment variable points to the directory containing upstream/emscripten/emcc.bat"
Condition="'$(EMSDK)' == ''" />
</Target>

<Target Name="LinkNative"
Inputs="$(NativeObject);@(NativeLibrary)"
Outputs="$(NativeBinary)"
Expand All @@ -317,9 +257,9 @@ The .NET Foundation licenses this file to you under the MIT license.
<CustomLinkerArg Include="@(LinkerArg)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetOS)' != 'windows' and '$(TargetOS)' != 'OSX'">
<CustomLinkerArg Include="-Wl,--discard-all" />
<CustomLinkerArg Include="-Wl,--gc-sections" />
</ItemGroup>
<CustomLinkerArg Include="-Wl,--discard-all" />
<CustomLinkerArg Include="-Wl,--gc-sections" />
</ItemGroup>
<ItemGroup>
<CustomLibArg Include="-crs &quot;$(NativeBinary)&quot;" Condition="'$(TargetOS)' != 'windows'" />
<CustomLibArg Include="/OUT:&quot;$(NativeBinary)&quot;" Condition="'$(TargetOS)' == 'windows'" />
Expand All @@ -328,25 +268,13 @@ The .NET Foundation licenses this file to you under the MIT license.

<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(NativeBinary)))" />

<Exec Command="$(CppLinker) @(CustomLinkerArg, ' ')" Condition="'$(TargetOS)' != 'windows' and '$(NativeLib)' != 'Static' and '$(NativeCodeGen)' != 'wasm'" />
<Exec Command="$(CppLibCreator) @(CustomLibArg, ' ')" Condition="'$(TargetOS)' != 'windows' and '$(NativeLib)' == 'Static' and '$(NativeCodeGen)' != 'wasm'" />
<Exec Command="$(CppLinker) @(CustomLinkerArg, ' ')" Condition="'$(TargetOS)' != 'windows' and '$(NativeLib)' != 'Static'" />
<Exec Command="$(CppLibCreator) @(CustomLibArg, ' ')" Condition="'$(TargetOS)' != 'windows' and '$(NativeLib)' == 'Static'" />

<WriteLinesToFile File="$(NativeIntermediateOutputPath)link.rsp" Lines="@(CustomLinkerArg)" Overwrite="true" Condition="'$(TargetOS)' == 'windows' and '$(NativeLib)' != 'Static'" />
<Exec Command="$(CppLinker) @&quot;$(NativeIntermediateOutputPath)link.rsp&quot;" Condition="'$(TargetOS)' == 'windows' and '$(NativeLib)' != 'Static' and '$(NativeCodeGen)' != 'wasm'" />
<Exec Command="$(CppLinker) @&quot;$(NativeIntermediateOutputPath)link.rsp&quot;" Condition="'$(TargetOS)' == 'windows' and '$(NativeLib)' != 'Static'" />
<WriteLinesToFile File="$(NativeIntermediateOutputPath)lib.rsp" Lines="@(CustomLibArg)" Overwrite="true" Condition="'$(TargetOS)' == 'windows' and '$(NativeLib)' == 'Static'" />
<Exec Command="$(CppLibCreator) @&quot;$(NativeIntermediateOutputPath)lib.rsp&quot;" Condition="'$(TargetOS)' == 'windows' and '$(NativeLib)' == 'Static' and '$(NativeCodeGen)' != 'wasm'" />

<PropertyGroup>
<EmccArgs>&quot;$(NativeObject)&quot; -o &quot;$(NativeBinary)&quot; -s ALLOW_MEMORY_GROWTH=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s DISABLE_EXCEPTION_CATCHING=0 --emrun </EmccArgs>
<EmccArgs Condition="'$(Platform)'=='wasm'">$(EmccArgs) &quot;$(IlcPath)/sdk/libPortableRuntime.a&quot; &quot;$(IlcPath)/sdk/libbootstrappercpp.a&quot; &quot;$(IlcPath)/sdk/libSystem.Private.CoreLib.Native.a&quot; $(EmccExtraArgs)</EmccArgs>
<EmccArgs Condition="'$(Configuration)'=='Release'">$(EmccArgs) -O2 -flto</EmccArgs>
<EmccArgs Condition="'$(Configuration)'=='Debug'">$(EmccArgs) -g3</EmccArgs>
</PropertyGroup>

<Exec Command="&quot;$(EMSDK)/upstream/emscripten/emcc.bat&quot; $(EmccArgs)" Condition="'$(NativeCodeGen)' == 'wasm' and '$(EMSDK)' != '' and '$(TargetOS)' == 'windows'" />
<Exec Command="&quot;$(EMSDK)/upstream/emscripten/emcc&quot; $(EmccArgs)" Condition="'$(NativeCodeGen)' == 'wasm' and '$(EMSDK)' != '' and '$(TargetOS)' != 'windows'" />
<Message Text="Emscripten not found, not linking WebAssembly. To enable WebAssembly linking, install Emscripten and ensure the EMSDK environment variable points to the directory containing upstream/emscripten/emcc.bat"
Condition="'$(NativeCodeGen)' == 'wasm' and '$(EMSDK)' == ''" />
<Exec Command="$(CppLibCreator) @&quot;$(NativeIntermediateOutputPath)lib.rsp&quot;" Condition="'$(TargetOS)' == 'windows' and '$(NativeLib)' == 'Static'" />
</Target>

<Target Name="CreateLib"
Expand Down
Loading

0 comments on commit 01d1c51

Please sign in to comment.