diff options
author | Kyungwoo Lee <kyulee@microsoft.com> | 2015-12-08 14:26:54 -0800 |
---|---|---|
committer | Kyungwoo Lee <kyulee@microsoft.com> | 2015-12-09 17:43:10 -0800 |
commit | c09a2320ed6184f2ad0f0c59cdd6884c76c9e038 (patch) | |
tree | ec7fb163cb438237d19fdc849d121f84c3dbdac5 /src/ilasm/writer.cpp | |
parent | d1633211ee01ed05f467cacd36418f313e7a3d71 (diff) | |
download | coreclr-c09a2320ed6184f2ad0f0c59cdd6884c76c9e038.tar.gz coreclr-c09a2320ed6184f2ad0f0c59cdd6884c76c9e038.tar.bz2 coreclr-c09a2320ed6184f2ad0f0c59cdd6884c76c9e038.zip |
Enable ILASM for Windows
This enables ILASM/mscorpe on CoreCLR for Windows.
1. Fusion/StrongName(Full Sign) dependencies are removed since these are not CoreCLR features.
2. mscorpe is statically built/linked to ilasm.
3. asmparse.c is auto-generated by an internal version of yacc so I added it under prebuilt directory for now. Will create an issue so that we can build it using a standard tool like bison.
Diffstat (limited to 'src/ilasm/writer.cpp')
-rw-r--r-- | src/ilasm/writer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ilasm/writer.cpp b/src/ilasm/writer.cpp index c2b81ffa72..1b1056213a 100644 --- a/src/ilasm/writer.cpp +++ b/src/ilasm/writer.cpp @@ -11,8 +11,10 @@ #include "assembler.h" #include "ceefilegenwriter.h" +#ifndef FEATURE_CORECLR #include "strongname.h" #include "LegacyActivationShim.h" +#endif #ifndef _MSC_VER //cloned definition from ntimage.h that is removed for non MSVC builds @@ -33,12 +35,17 @@ HRESULT Assembler::InitMetaData() if(bClock) bClock->cMDInitBegin = GetTickCount(); +#ifdef FEATURE_CORECLR + hr = MetaDataGetDispenser(CLSID_CorMetaDataDispenser, + IID_IMetaDataDispenserEx, (void **)&m_pDisp); +#else hr = LegacyActivationShim::ClrCoCreateInstance( CLSID_CorMetaDataDispenser, NULL, CLSCTX_INPROC_SERVER, IID_IMetaDataDispenserEx, (void **)&m_pDisp); +#endif if (FAILED(hr)) goto exit; @@ -250,7 +257,7 @@ HRESULT Assembler::CreateDebugDirectory() pParam->debugDirData = new BYTE[pParam->debugDirDataSize]; } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; - } WIN_PAL_ENDTRY + } PAL_ENDTRY if(FAILED(hr)) return hr; // Actually get the data now. @@ -680,6 +687,7 @@ BYTE HexToByte (CHAR wc) return (BYTE) (wc - L'a' + 10); } +#ifndef FEATURE_CORECLR bool GetBytesFromHex (LPCSTR szPublicKeyHexString, ULONG cchPublicKeyHexString, BYTE** buffer, ULONG *cbBufferSize) { ULONG cchHex = cchPublicKeyHexString; @@ -869,6 +877,7 @@ HRESULT Assembler::StrongNameSign() return S_OK; } +#endif // !FEATURE_CORECLR BOOL Assembler::EmitFieldsMethods(Class* pClass) { @@ -1222,11 +1231,14 @@ HRESULT Assembler::CreatePEFile(__in __nullterminated WCHAR *pwzOutputFilename) if(bClock) bClock->cMDEmit1 = GetTickCount(); +#ifndef FEATURE_CORECLR // Allocate space for a strong name signature if we're delay or full // signing the assembly. if (m_pManifest->m_sStrongName.m_pbPublicKey) if (FAILED(hr = AllocateStrongNameSignature())) goto exit; +#endif + if(bClock) bClock->cMDEmit2 = GetTickCount(); if(m_VTFList.COUNT()==0) |