522 lines
14 KiB
Plaintext
522 lines
14 KiB
Plaintext
|
<!--
|
||
|
|
||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
|
||
|
This targets file allows projects to invoke the Bartok compiler.
|
||
|
Projects can define the following item sets:
|
||
|
|
||
|
* ProjectReference - Projects that should be built, and whose output becomes
|
||
|
a referenced assembly (input to Bartok). This should be the path to
|
||
|
an MSBuild project (.proj, .csproj, etc.).
|
||
|
|
||
|
* Reference - An input assembly, e.g. .exe or .dll.
|
||
|
|
||
|
|
||
|
Projects can define the following properties:
|
||
|
|
||
|
* NativeImageName - The basename to generate, e.g. "kernel".
|
||
|
|
||
|
* OutputPath - The directory in which to generate outputs.
|
||
|
|
||
|
* BartokFlags - Flags that will be passed directly to the compiler.
|
||
|
|
||
|
* Collector - The name of the collector (e.g. AdaptiveCopying, Concurrent, etc.) to use.
|
||
|
If this property is omitted, then no collector is selected (unless one is
|
||
|
specified using the BartokFlags property).
|
||
|
|
||
|
* BartokCompiler - Specify to override the compiler binary to use.
|
||
|
|
||
|
|
||
|
-->
|
||
|
|
||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!-- Provide some defaults. -->
|
||
|
<PropertyGroup>
|
||
|
<!-- hack! -->
|
||
|
<BartokCompiler Condition="'$(BartokCompiler)'==''">cd $(BUILDDIR) && bartok.exe</BartokCompiler>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
|
||
|
<PropertyGroup>
|
||
|
<NativeImagePath>$(OutputPath)\$(NativeImageName).obj</NativeImagePath>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
|
||
|
|
||
|
<!-- Build the command-line parameters for bartok. -->
|
||
|
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>/out: $(NativeImagePath)</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
|
||
|
<Choose>
|
||
|
<When Condition="'$(Collector)'=='AdaptiveCopying'">
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>$(_BartokCmd) /AdaptiveCopying</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
</When>
|
||
|
|
||
|
<When Condition="'$(Collector)'=='Concurrent'">
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>$(_BartokCmd) /ConcurrentMSGC</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
</When>
|
||
|
|
||
|
<When Condition="'$(Collector)'=='MarkSweep'">
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>$(_BartokCmd) /MarkSweepGC</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
</When>
|
||
|
|
||
|
<When Condition="'$(Collector)'=='Semispace'">
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>$(_BartokCmd) /SemispaceGC</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
</When>
|
||
|
|
||
|
<When Condition="'$(Collector)'=='Sliding'">
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>$(_BartokCmd) /SlidingGC</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
</When>
|
||
|
</Choose>
|
||
|
|
||
|
|
||
|
<PropertyGroup>
|
||
|
<_BartokCmd>$(_BartokCmd) /outdir: $(OutputPath) $(BartokFlags) /IrImproveTypes=false</_BartokCmd>
|
||
|
<_BartokCmd Condition="'$(Verbosity)'!=''">$(_BartokCmd) /verbosity:$(Verbosity)</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
|
||
|
<PropertyGroup> <!-- Condition="'$(EnableOutputLog)'=='true'"> -->
|
||
|
<OutputLogPath>$(OutputPath)\$(NativeImageName).log</OutputLogPath>
|
||
|
<_BartokCmd>$(_BartokCmd) >$(OutputLogPath)</_BartokCmd>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
|
||
|
|
||
|
<Target Name="BuildDependentProjects">
|
||
|
<MSBuild Projects="@(ProjectReference)" Targets="Build">
|
||
|
<Output ItemName="__built_projects" TaskParameter="TargetOutputs"/>
|
||
|
</MSBuild>
|
||
|
|
||
|
<!-- <Message Text="__built_projects: %(__built_projects.Identity)" /> -->
|
||
|
<CreateItem Include="@(__built_projects)">
|
||
|
<Output TaskParameter="Include" ItemName="Reference"/>
|
||
|
</CreateItem>
|
||
|
</Target>
|
||
|
|
||
|
|
||
|
<Target Name="BuildNativeImage"
|
||
|
DependsOnTargets="BuildDependentProjects"
|
||
|
Inputs="@(Reference)"
|
||
|
Outputs="$(NativeImagePath)"
|
||
|
>
|
||
|
|
||
|
<Error Condition="'$(NativeImageName)'==''" Text="The 'NativeImageName' property is required."/>
|
||
|
<Error Condition="'$(OutputPath)'==''" Text="The 'OutputPath' property is required."/>
|
||
|
|
||
|
<Message Text="Building native image:"/>
|
||
|
<Message Text=" NativeImagePath: $(NativeImagePath)"/>
|
||
|
<Message Text=" OutputPath: $(OutputPath)"/>
|
||
|
<Message Text=" IL Reference: %(Reference.Identity)"/>
|
||
|
|
||
|
<Exec Command="$(BartokCompiler) $(_BartokCmd) @(Reference,' ') >$(OutputLogPath)"/>
|
||
|
|
||
|
</Target>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Usage:
|
||
|
bartok [options] files
|
||
|
|
||
|
Bartok main options (case insensitive):
|
||
|
/entry: <method1>;<method2>;... specify entry points
|
||
|
/reference: <file1>;<file2>;... reference metadata from assembly files
|
||
|
/r: <file1>;<file2>;... short form of /reference:
|
||
|
/bartoklink: <file1>;<file2>;... reference precompiled object files
|
||
|
/override: <file1>;<file2>;... files overriding /r: metadata
|
||
|
/lib: <dir1>;<dir2>;... additional dirs to search for references
|
||
|
/out: <file> output file name
|
||
|
/outdir: <dir> dir for output .exe, asm, obj, etc.
|
||
|
(defaults to .\\debug)
|
||
|
/skip: <type1>;<type2>;... specify type initializers to disable
|
||
|
if building static ordering
|
||
|
/substitute:<oldname1>=<newname1>, rename TypeRefs before performing lookup
|
||
|
<oldname2>=<newname2>,...
|
||
|
/disable:<phasename> disable a phase
|
||
|
/dynamicload:<typename> make type available for dynamic loading
|
||
|
/features:<???> << TODO >>
|
||
|
/noisymethod:<methname> enable noisy output for meth
|
||
|
/debugmethod:<methname> enable debug+noisy output for meth
|
||
|
/verbosity:<noiselevel> set output level {Silence,PerPhase,
|
||
|
PerClass,PerMethod,PerBlock,
|
||
|
PerInstruction} (defaults to PerPhase)
|
||
|
/marksweepgc compile for mark-sweep collector
|
||
|
/semispacegc compile for semispace collector
|
||
|
/slidinggc compile for sliding collector
|
||
|
/adaptivecopyinggc compile for semispace-sliding hybrid
|
||
|
collector
|
||
|
/referencecountinggc compile for reference counting collector
|
||
|
/deferredreferencecountinggc compile for deferred reference counting collector
|
||
|
/concurrentmsgc compile for concurrent mark-sweep
|
||
|
collector
|
||
|
/nullgc compile for no collector
|
||
|
/minopt disable most optimizations
|
||
|
/nohiropt disable all HIR optimizations
|
||
|
/singularity set default Singularity options
|
||
|
/verbosehelp help message including stage control
|
||
|
options by category
|
||
|
/verbosehelpalpha help message including stage control
|
||
|
options in alphabetical order
|
||
|
/help or /? help message
|
||
|
-->
|
||
|
|
||
|
|
||
|
<!--
|
||
|
|
||
|
Valid options:
|
||
|
|
||
|
/ABCD
|
||
|
/ABCDAddExtraEdges
|
||
|
/AcyclicRefTypesDump
|
||
|
/AggressiveFieldLayout
|
||
|
/Allocator
|
||
|
/AllThreadMixins
|
||
|
/ArrayAddressChecks
|
||
|
/ArrayBoundsChecks
|
||
|
/ArrayStoreChecks
|
||
|
/ArraySupportOptimizePass
|
||
|
/AsmCodeSectionLines
|
||
|
/AsmDataSectionLines
|
||
|
/AtomicAlwaysEnlistForUpdate
|
||
|
/AtomicBitmap
|
||
|
/AtomicExternalBitmap
|
||
|
/AtomicFixStaticsAtCompileTime
|
||
|
/AtomicRemoveReadAfterUpdateAtEnlistment
|
||
|
rUpdateAtGC
|
||
|
/AtomicRemoveReadDuplicatesAtGC
|
||
|
/AtomicSupport
|
||
|
/AtomicSupportUpdateEnlistOpt
|
||
|
/AtomicSupportUpdateEnlistOptFlow
|
||
|
/AtomicTrackTransactionLocals
|
||
|
/BackEndCommentOpts
|
||
|
/BackEndComments
|
||
|
/BackEndGenConditionalMoves
|
||
|
/BackEndPostPrint
|
||
|
/BartokLinkPhase
|
||
|
/BeforeVarargLowering
|
||
|
/BuildC2Mods
|
||
|
/BumpAllocatorClear
|
||
|
/callSiteSetTable
|
||
|
/CfgPrefix
|
||
|
/CheckNoHeapAllocation
|
||
|
/CheckPropertySetMethods
|
||
|
/CheckSsa
|
||
|
/CompileOnly
|
||
|
/ConvertArrayInitialization
|
||
|
/ConvertMagicArrayOperations
|
||
|
/ConvertMethodPostPrint
|
||
|
/ConvertUseJumpTablesForSwitch
|
||
|
/CopyScan
|
||
|
/CountThreadSafeFields
|
||
|
/CustomAllocatorTypes
|
||
|
/DebugInline
|
||
|
/DebugIrTreeShake
|
||
|
/DebugIrTreeShakeVerbose
|
||
|
/DebugMetaDataParsing
|
||
|
/DebugSharedHeap
|
||
|
/DebugVarArrayLength
|
||
|
/DefaultCodeAlignment
|
||
|
/DevirtualizeCall
|
||
|
/DisableIrExposeAllocationCall
|
||
|
/DisablePInvoke
|
||
|
/DisableX64LirOpts
|
||
|
/DumpCfg
|
||
|
/DumpContainers
|
||
|
/DumpInheritance
|
||
|
/DumpInheritanceFile
|
||
|
/DumpMethodSizes
|
||
|
/DumpOverrideStats
|
||
|
/DynamicCountBoundsChecks
|
||
|
/DynamicCountLoads
|
||
|
/DynamicCountNullChecks
|
||
|
/DynamicCountStores
|
||
|
/DynamicCountVirtualCalls
|
||
|
/EnableIceCap
|
||
|
/EnableIrExposeAllocationCall
|
||
|
/ExcludeMscorlibResourceInfo
|
||
|
/ExtendedABCD
|
||
|
/ExtendedThreadEscapeAnalysis
|
||
|
/ExtendParamsABCD
|
||
|
/FailAfterInliner
|
||
|
/FieldsAnalysisDumpReadOnly
|
||
|
/FullSymName
|
||
|
/GCAccurate
|
||
|
/GCCheckInformation
|
||
|
/GCCheckInformationTrace
|
||
|
/GCGenTransitionCode
|
||
|
/GCInlineAllocations
|
||
|
/GCInlineWriteBarrier
|
||
|
/GCLargeObjectSize
|
||
|
/GCTables
|
||
|
/GCTrackUnchangedCalleeSaves
|
||
|
/GCType
|
||
|
/GCWriteBarrierTracksStaticFields
|
||
|
/GenAsmHeader
|
||
|
/GenCoffLineNumber
|
||
|
/GenCppHeader
|
||
|
/GenFPStackChecksAfterCalls
|
||
|
/GenObjFile
|
||
|
/IdentifyAsMethods
|
||
|
/IgnoreThreadMembership
|
||
|
/IncludeStaticFields
|
||
|
/IndexType
|
||
|
/InsertWriteBarrier
|
||
|
/InstrumentAllCalls
|
||
|
/InstrumentCalls
|
||
|
/InstrumentVirtualCalls
|
||
|
/IrArrayBaseLength
|
||
|
/IrArrayLoadStoreOpt
|
||
|
/IrAttributeInliner
|
||
|
/IrCleanup
|
||
|
/IrCleanupStructOperations
|
||
|
/IrCleanupTypecheckResult
|
||
|
/IrCloneLoopHeader
|
||
|
/IrCompareOpt
|
||
|
/IrConvertArrayBounds
|
||
|
/IrConvertArrayOpt
|
||
|
/IrConvertComplexArrayAccess
|
||
|
/IrConvertExpandedArrayAccess
|
||
|
/IrConvertInferface
|
||
|
/IrConvertOpt
|
||
|
/IrConvertSimpleArrayAccess
|
||
|
/IrConvertSizeofPrimitive
|
||
|
/IrConvertTryAll
|
||
|
/IrDeadAssignmentSimple1
|
||
|
/IrDeadAssignmentSimple2
|
||
|
/IrDeadAssignmentSimpleFormals
|
||
|
/IrDeleteCheckCasts
|
||
|
/IrExposeAllocationCall
|
||
|
/IrFindConcrete
|
||
|
/IrImproveTypes
|
||
|
/IrInitStaticField
|
||
|
/IrInitTypeInliner
|
||
|
/IrInlineConstructor
|
||
|
/IrInlinerDoIncreaseSize
|
||
|
/IrJumpElim
|
||
|
/IrKeepManager
|
||
|
/IrLoadStoreOpt
|
||
|
/IrLoadStoreOptThreaded
|
||
|
/IrLSOThreadedStores
|
||
|
/IrMultiConvertOpt
|
||
|
/IrMultiPropSimple
|
||
|
/IrOverrideValueTypeEquals
|
||
|
/IrPeepholeNull
|
||
|
/IrRemoveDoubleCmp
|
||
|
/IrReverseCopyProp
|
||
|
/IrScanCallEffects
|
||
|
/IrShortCircuitBBlocks
|
||
|
/IrSimpleInliner
|
||
|
/IrSimpleInlinerWarnings
|
||
|
/IrSSABoundChecks
|
||
|
/IrSSAStoreChecks
|
||
|
/IrStructVectorOperations
|
||
|
/IrSuppressExnEdges
|
||
|
/IrTreeShake
|
||
|
/IrTreeShakeCreatePointedToStructs
|
||
|
/IrTreeShakeLate
|
||
|
/IrTypeTestElim
|
||
|
/IrTypeTestElimPunt
|
||
|
/LayoutLoopHeaderLast
|
||
|
/LazyTypeInits
|
||
|
/LimitedReflection
|
||
|
/LinkedStacks
|
||
|
/LinkedStacksDumpEntryPointBounds
|
||
|
/LinkedStacksRequireExternalBound
|
||
|
/LinkedStacksTrace
|
||
|
/LinkedStackThreshold
|
||
|
/LirContinueOnException
|
||
|
/LirPrintTypes
|
||
|
/LogIrDeadCode
|
||
|
/LogIrInliner
|
||
|
/LogResourceInfo
|
||
|
/LogSsaDeadCode
|
||
|
/LowerLargeValuesPostPrint
|
||
|
/LowerToTargetPostPrint
|
||
|
/MaxInlineDepth
|
||
|
/MaxInlineeBB
|
||
|
/MaxInlineeInstr
|
||
|
/MyFuncCount
|
||
|
/NameThreadSafeFields
|
||
|
/NullChecks
|
||
|
/NullRuntime
|
||
|
/OmitFramePointer
|
||
|
/OptimisticLocking
|
||
|
/OptimizeLocals
|
||
|
/OptimizeWriteBarrier
|
||
|
/OptLirCompactify
|
||
|
/OptLirCompactifyPostPrint
|
||
|
/OptLirConvertAddToLEA
|
||
|
/OptLirCopyPropAcrossCalls
|
||
|
/OptLirGlobalConstantProp
|
||
|
/OptLirGlobalConstantPropPostPrint
|
||
|
/OptLirGlobalCopyProp
|
||
|
/OptLirGlobalCopyPropPostPrint
|
||
|
/OptLirImproveBranches
|
||
|
/OptLirImproveBranchesPostPrint
|
||
|
/OptLirImproveCC
|
||
|
/OptLirImproveCCPostPrint
|
||
|
/OptLirImproveJumps
|
||
|
/OptLirImproveJumpsPostPrint
|
||
|
/OptLirInlineStructZero
|
||
|
/OptLirInlineStructZeroLimit
|
||
|
/OptLirLocalConstantProp
|
||
|
/OptLirLocalConstantPropPostPrint
|
||
|
/OptLirLocalCopyProp
|
||
|
/OptLirLocalCopyPropPostPrint
|
||
|
/OptLirPeephole
|
||
|
/OptLirPeepholePostPrint
|
||
|
/OptLirReverseCopyProp
|
||
|
/OptLirReverseCopyPropPostPrint
|
||
|
/OptLirReverseCSE
|
||
|
/OptLirReverseCSEPostPrint
|
||
|
/OptLirSuppressExnEdges
|
||
|
/OptLirSuppressJumps
|
||
|
/OptLirSuppressJumpsPostPrint
|
||
|
/OptRuntimeData
|
||
|
/PhaseFunctionNumberPrintLimit
|
||
|
/PhaseFunctionTimePrintLimit
|
||
|
/PhaseTimings
|
||
|
/PhaseTotalTimePrintLimit
|
||
|
/PhoenixArgs
|
||
|
/PhoenixMirOpts
|
||
|
/PostDomHoist
|
||
|
/PreAllocStackForParam
|
||
|
/PreWriteBarrier
|
||
|
/PrintContainers
|
||
|
/PrintVariableTypes
|
||
|
/ProfileLirFunctions
|
||
|
/PtrAnalysis
|
||
|
/PtrAnalysisEarly
|
||
|
/PtrAnalysisLate
|
||
|
/PTType
|
||
|
/RCCollectorExceptionAccurate
|
||
|
/RCCollectorGenerateProfile
|
||
|
/RCCollectorOptAlwaysPLCFreeIncrements
|
||
|
/RCCollectorOptCoalescingUpdates
|
||
|
/RCCollectorOptImmortals
|
||
|
/RCCollectorOptInlineRCUpdates
|
||
|
/RCCollectorOptNonNullRCUpdates
|
||
|
/RCCollectorOptORoots
|
||
|
/RCCollectorOptRCSubsumedByActual
|
||
|
/RCCollectorOptRCSubsumedByCurrentThread
|
||
|
/RCCollectorOptRCSubsumedByROFields
|
||
|
/RCCollectorOptRCSubsumedByTSFields
|
||
|
/RCCollectorOptRCSubsumedI
|
||
|
/RCCollectorOptRuntimeAcyclicRefTypeUpdates
|
||
|
/RCCollectorOptStaticAcyclicRefTypeUpdates
|
||
|
/RCCollectorOptThreadLocalAnalysis
|
||
|
/RCCollectorRCUpdateReplacement
|
||
|
/RCCollectorShowStatistics
|
||
|
/RCCollectorVerifyLeakedCycles
|
||
|
/RCCollectorVerifyRefCounts
|
||
|
/RedoIrInliner
|
||
|
/RefAnyValueChecks
|
||
|
/RegAllocCloseSpillLoads
|
||
|
/RegAllocCoalesce
|
||
|
/RegAllocCoalesceDebug
|
||
|
/RegAllocColorSpillSlots
|
||
|
/RegAllocDebug
|
||
|
/RegAllocGenGCTransitionCode
|
||
|
/RegAllocMethodNoise
|
||
|
/RegAllocPostPrint
|
||
|
/RegAllocSpill
|
||
|
/RegAllocX86CalleeSavedOnly
|
||
|
/RuntimeMods
|
||
|
/ShareExceptionRecordsAcrossFunctions
|
||
|
/SimpleThreadEscapeDump
|
||
|
/SingSharpTemplateRemover
|
||
|
/sparseCallTableSpacing
|
||
|
/sparseSegmentSize
|
||
|
/SsaArraySimple
|
||
|
/SsaDeadCode
|
||
|
/SsaLoopInv
|
||
|
/SsaNullCheck
|
||
|
/SsaNullCheckGlobal
|
||
|
/SsaNullCheckGlobalThreaded
|
||
|
/SsaOpts
|
||
|
/SsaStrengthReduce
|
||
|
/Ssb
|
||
|
/StackOverflowChecks
|
||
|
/StrictEcma
|
||
|
/StructInheritance
|
||
|
/SurrogateBoxing
|
||
|
/SymbolicDebug
|
||
|
/SymbolicIR
|
||
|
/Target64Bit
|
||
|
/TargetArch
|
||
|
/ThrowOnInternalError
|
||
|
/TimeStampMessages
|
||
|
/TodoWarnings
|
||
|
/ToLirDebug
|
||
|
/ToLirDebugFields
|
||
|
/ToLirDebugMethods
|
||
|
/ToLirUnresolvedOK
|
||
|
/TryAllCheckMask
|
||
|
/TryAllDecomposeOpt
|
||
|
/TryAllDecomposeOptFlow
|
||
|
/TryAllDisableAfterFiltering
|
||
|
/TryAllDisableAllLogging
|
||
|
/TryAllDisableBeforeFiltering
|
||
|
/TryAllDisableBeforeWritingLog
|
||
|
/TryAllDisableHousekeeping
|
||
|
/TryAllDisableOnMethodEntry
|
||
|
/TryAllEnableProfiling
|
||
|
/TryAllPerCallSiteProfiling
|
||
|
/TryAllSupport
|
||
|
/TryAllSupportDebug
|
||
|
/TryAllSupportEnlistmentLogChunkSize
|
||
|
/TryAllSupportEnlistmentLogEnsurableSize
|
||
|
/TryAllSupportHashingForReadEnlistments
|
||
|
/TryAllSupportLoadStoreOpt
|
||
|
/TryAllSupportOptimizePass
|
||
|
/TryAllSupportSsaNullCheck
|
||
|
/TryAllSupportSsaNullCheckGlobal
|
||
|
/TryAllSupportUpdateLogChunkSize
|
||
|
/TryAllSupportUpdateLogEnsurableSize
|
||
|
/TypeCheckerAbortOnFailure
|
||
|
/TypeCheckerPrintLimit
|
||
|
/TypedReference
|
||
|
/TypeInitElim
|
||
|
/TypeInitRemoveEmptyCctors
|
||
|
/UnboxChecks
|
||
|
/UndoIrDeadCode
|
||
|
/UndoIrInliner
|
||
|
/UndoSsaDeadCode
|
||
|
/UnmanagedStrings
|
||
|
/UnnameTracedPtrs
|
||
|
/UnsoundLoopRead
|
||
|
/UseSegmentRegister
|
||
|
/UseSharedExceptionUnwind
|
||
|
/UseVTableBits
|
||
|
/ValidMasm
|
||
|
/VectorUseCheckingEnumerator
|
||
|
/VerboseWarnings
|
||
|
/Warnings
|
||
|
/WarnOnPInvokeUsage
|
||
|
/Wb
|
||
|
/WholeProgram
|
||
|
|
||
|
-->
|
||
|
|
||
|
</Project>
|
||
|
|
||
|
|