pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coreclr-git: Another attempt towards alloca(3) fix



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Feb 15 23:54:02 2016 +0100
Changeset:	0dabfd284e20ba4d09e12a02c503fdada7efc7c8

Modified Files:
	coreclr-git/distinfo
	coreclr-git/patches/patch-build.sh
Added Files:
	coreclr-git/patches/patch-src_ToolBox_PdbTypeMatch_PrintSymbol.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_eeheap.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_gcroot.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_metadata.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sildasm.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sos.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_stressLogDump.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.cpp
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_util.h
	coreclr-git/patches/patch-src_classlibnative_bcltype_arraynative.cpp
	coreclr-git/patches/patch-src_debug_daccess_nidump.cpp
	coreclr-git/patches/patch-src_debug_di_breakpoint.cpp
	coreclr-git/patches/patch-src_debug_di_module.cpp
	coreclr-git/patches/patch-src_debug_di_process.cpp
	coreclr-git/patches/patch-src_debug_di_rsappdomain.cpp
	coreclr-git/patches/patch-src_debug_di_rsclass.cpp
	coreclr-git/patches/patch-src_debug_di_rsthread.cpp
	coreclr-git/patches/patch-src_debug_di_rstype.cpp
	coreclr-git/patches/patch-src_debug_ee_dactable.cpp
	coreclr-git/patches/patch-src_debug_ee_debugger.cpp
	coreclr-git/patches/patch-src_debug_ee_funceval.cpp
	coreclr-git/patches/patch-src_debug_ildbsymlib_symread.cpp
	coreclr-git/patches/patch-src_dlls_mscorpe_pewriter.cpp
	coreclr-git/patches/patch-src_ilasm_assembler.cpp
	coreclr-git/patches/patch-src_inc_allocacheck.h
	coreclr-git/patches/patch-src_inc_corperme.h
	coreclr-git/patches/patch-src_inc_daccess.h
	coreclr-git/patches/patch-src_inc_formattype.cpp
	coreclr-git/patches/patch-src_inc_formattype.h
	coreclr-git/patches/patch-src_inc_nsutilpriv.h
	coreclr-git/patches/patch-src_inc_winwrap.h
	coreclr-git/patches/patch-src_jit_compiler.cpp
	coreclr-git/patches/patch-src_jit_error.cpp
	coreclr-git/patches/patch-src_jit_flowgraph.cpp
	coreclr-git/patches/patch-src_jit_gentree.cpp
	coreclr-git/patches/patch-src_jit_gtlist.h
	coreclr-git/patches/patch-src_jit_hashbv.cpp
	coreclr-git/patches/patch-src_jit_importer.cpp
	coreclr-git/patches/patch-src_jit_jiteh.cpp
	coreclr-git/patches/patch-src_jit_rationalize.cpp
	coreclr-git/patches/patch-src_jit_ssabuilder.cpp
	coreclr-git/patches/patch-src_md_compiler_custattr__import.cpp
	coreclr-git/patches/patch-src_md_compiler_regmeta__emit.cpp
	coreclr-git/patches/patch-src_md_enc_imptlb.cpp
	coreclr-git/patches/patch-src_md_enc_metamodelrw.cpp
	coreclr-git/patches/patch-src_md_enc_stgio.cpp
	coreclr-git/patches/patch-src_md_inc_rwutil.h
	coreclr-git/patches/patch-src_pal_inc_pal.h
	coreclr-git/patches/patch-src_pal_src_debug_debug.cpp
	coreclr-git/patches/patch-src_pal_src_file_directory.cpp
	coreclr-git/patches/patch-src_pal_src_file_file.cpp
	coreclr-git/patches/patch-src_pal_src_file_path.cpp
	coreclr-git/patches/patch-src_pal_src_loader_module.cpp
	coreclr-git/patches/patch-src_pal_src_misc_dbgmsg.cpp
	coreclr-git/patches/patch-src_pal_tests_palsuite_c__runtime___alloca_test1_test1.c
	coreclr-git/patches/patch-src_tools_metainfo_mdinfo.cpp
	coreclr-git/patches/patch-src_utilcode_genericstackprobe.cpp
	coreclr-git/patches/patch-src_utilcode_posterror.cpp
	coreclr-git/patches/patch-src_utilcode_prettyprintsig.cpp
	coreclr-git/patches/patch-src_utilcode_sxshelpers.cpp
	coreclr-git/patches/patch-src_vm_array.cpp
	coreclr-git/patches/patch-src_vm_assemblyspec.cpp
	coreclr-git/patches/patch-src_vm_baseassemblyspec.cpp
	coreclr-git/patches/patch-src_vm_baseassemblyspec.inl
	coreclr-git/patches/patch-src_vm_callhelpers.cpp
	coreclr-git/patches/patch-src_vm_ceeload.cpp
	coreclr-git/patches/patch-src_vm_class.cpp
	coreclr-git/patches/patch-src_vm_classhash.cpp
	coreclr-git/patches/patch-src_vm_clrtocomcall.cpp
	coreclr-git/patches/patch-src_vm_clsload.cpp
	coreclr-git/patches/patch-src_vm_comdynamic.cpp
	coreclr-git/patches/patch-src_vm_compile.cpp
	coreclr-git/patches/patch-src_vm_comtoclrcall.cpp
	coreclr-git/patches/patch-src_vm_comwaithandle.cpp
	coreclr-git/patches/patch-src_vm_crossdomaincalls.cpp
	coreclr-git/patches/patch-src_vm_customattribute.cpp
	coreclr-git/patches/patch-src_vm_dbggcinfodecoder.cpp
	coreclr-git/patches/patch-src_vm_debughelp.cpp
	coreclr-git/patches/patch-src_vm_dispatchinfo.cpp
	coreclr-git/patches/patch-src_vm_dllimport.cpp
	coreclr-git/patches/patch-src_vm_dllimportcallback.cpp
	coreclr-git/patches/patch-src_vm_dwbucketmanager.hpp
	coreclr-git/patches/patch-src_vm_dwreport.cpp
	coreclr-git/patches/patch-src_vm_encee.cpp
	coreclr-git/patches/patch-src_vm_excep.cpp
	coreclr-git/patches/patch-src_vm_exceptionhandling.cpp
	coreclr-git/patches/patch-src_vm_exceptmacros.h
	coreclr-git/patches/patch-src_vm_fieldmarshaler.cpp
	coreclr-git/patches/patch-src_vm_fusionbind.cpp
	coreclr-git/patches/patch-src_vm_gchelpers.cpp
	coreclr-git/patches/patch-src_vm_genericdict.cpp
	coreclr-git/patches/patch-src_vm_generics.cpp
	coreclr-git/patches/patch-src_vm_i386_excepcpu.h
	coreclr-git/patches/patch-src_vm_i386_excepx86.cpp
	coreclr-git/patches/patch-src_vm_i386_gmsx86.cpp
	coreclr-git/patches/patch-src_vm_interoputil.cpp
	coreclr-git/patches/patch-src_vm_interpreter.cpp
	coreclr-git/patches/patch-src_vm_invokeutil.cpp
	coreclr-git/patches/patch-src_vm_jithelpers.cpp
	coreclr-git/patches/patch-src_vm_jitinterface.cpp
	coreclr-git/patches/patch-src_vm_method.cpp
	coreclr-git/patches/patch-src_vm_methodtablebuilder.cpp
	coreclr-git/patches/patch-src_vm_objectclone.cpp
	coreclr-git/patches/patch-src_vm_olevariant.cpp
	coreclr-git/patches/patch-src_vm_proftoeeinterfaceimpl.cpp
	coreclr-git/patches/patch-src_vm_reflectioninvocation.cpp
	coreclr-git/patches/patch-src_vm_runtimehandles.cpp
	coreclr-git/patches/patch-src_vm_securityattributes.cpp
	coreclr-git/patches/patch-src_vm_siginfo.cpp
	coreclr-git/patches/patch-src_vm_stackbuildersink.cpp
	coreclr-git/patches/patch-src_vm_stringliteralmap.cpp
	coreclr-git/patches/patch-src_vm_threads.cpp
	coreclr-git/patches/patch-src_vm_threadsuspend.cpp
	coreclr-git/patches/patch-src_vm_util.cpp
	coreclr-git/patches/patch-src_vm_win32threadpool.cpp
	coreclr-git/patches/patch-src_vm_zapsig.cpp
	coreclr-git/patches/patch-src_zap_zapcode.cpp
	coreclr-git/patches/patch-src_zap_zapper.cpp

Log Message:
coreclr-git: Another attempt towards alloca(3) fix

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0dabfd284e20ba4d09e12a02c503fdada7efc7c8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coreclr-git/distinfo                               | 120 ++++++++++++++++++++-
 coreclr-git/patches/patch-build.sh                 |   8 +-
 .../patch-src_ToolBox_PdbTypeMatch_PrintSymbol.cpp |  13 +++
 .../patch-src_ToolBox_SOS_Strike_eeheap.cpp        |  12 +++
 .../patch-src_ToolBox_SOS_Strike_gcroot.cpp        |  22 ++++
 .../patch-src_ToolBox_SOS_Strike_metadata.cpp      |  24 +++++
 .../patch-src_ToolBox_SOS_Strike_sildasm.cpp       |  22 ++++
 .../patches/patch-src_ToolBox_SOS_Strike_sos.cpp   |  13 +++
 .../patch-src_ToolBox_SOS_Strike_stressLogDump.cpp |  22 ++++
 .../patch-src_ToolBox_SOS_Strike_strike.cpp        |  22 ++++
 .../patches/patch-src_ToolBox_SOS_Strike_util.h    |  40 +++++++
 ...atch-src_classlibnative_bcltype_arraynative.cpp |  22 ++++
 .../patches/patch-src_debug_daccess_nidump.cpp     |  32 ++++++
 .../patches/patch-src_debug_di_breakpoint.cpp      |  31 ++++++
 coreclr-git/patches/patch-src_debug_di_module.cpp  |  13 +++
 coreclr-git/patches/patch-src_debug_di_process.cpp |  85 +++++++++++++++
 .../patches/patch-src_debug_di_rsappdomain.cpp     |  13 +++
 coreclr-git/patches/patch-src_debug_di_rsclass.cpp |  13 +++
 .../patches/patch-src_debug_di_rsthread.cpp        |  22 ++++
 coreclr-git/patches/patch-src_debug_di_rstype.cpp  |  22 ++++
 .../patches/patch-src_debug_ee_dactable.cpp        |  20 ++++
 .../patches/patch-src_debug_ee_debugger.cpp        |  22 ++++
 .../patches/patch-src_debug_ee_funceval.cpp        |  76 +++++++++++++
 .../patches/patch-src_debug_ildbsymlib_symread.cpp |  13 +++
 .../patches/patch-src_dlls_mscorpe_pewriter.cpp    |  22 ++++
 coreclr-git/patches/patch-src_ilasm_assembler.cpp  |  13 +++
 coreclr-git/patches/patch-src_inc_allocacheck.h    |  19 ++++
 coreclr-git/patches/patch-src_inc_corperme.h       |  21 ++++
 coreclr-git/patches/patch-src_inc_daccess.h        |  13 +++
 coreclr-git/patches/patch-src_inc_formattype.cpp   |  22 ++++
 coreclr-git/patches/patch-src_inc_formattype.h     |  13 +++
 coreclr-git/patches/patch-src_inc_nsutilpriv.h     |  30 ++++++
 coreclr-git/patches/patch-src_inc_winwrap.h        |  18 ++++
 coreclr-git/patches/patch-src_jit_compiler.cpp     |  13 +++
 coreclr-git/patches/patch-src_jit_error.cpp        |  13 +++
 coreclr-git/patches/patch-src_jit_flowgraph.cpp    |  22 ++++
 coreclr-git/patches/patch-src_jit_gentree.cpp      |  13 +++
 coreclr-git/patches/patch-src_jit_gtlist.h         |  13 +++
 coreclr-git/patches/patch-src_jit_hashbv.cpp       |  22 ++++
 coreclr-git/patches/patch-src_jit_importer.cpp     |  13 +++
 coreclr-git/patches/patch-src_jit_jiteh.cpp        |  35 ++++++
 coreclr-git/patches/patch-src_jit_rationalize.cpp  |  15 +++
 coreclr-git/patches/patch-src_jit_ssabuilder.cpp   |  22 ++++
 .../patch-src_md_compiler_custattr__import.cpp     |  13 +++
 .../patch-src_md_compiler_regmeta__emit.cpp        |  13 +++
 coreclr-git/patches/patch-src_md_enc_imptlb.cpp    |  49 +++++++++
 .../patches/patch-src_md_enc_metamodelrw.cpp       |  13 +++
 coreclr-git/patches/patch-src_md_enc_stgio.cpp     |  13 +++
 coreclr-git/patches/patch-src_md_inc_rwutil.h      |  13 +++
 coreclr-git/patches/patch-src_pal_inc_pal.h        |  35 ++++++
 .../patches/patch-src_pal_src_debug_debug.cpp      |  13 +++
 .../patches/patch-src_pal_src_file_directory.cpp   |  13 +++
 .../patches/patch-src_pal_src_file_file.cpp        |  13 +++
 .../patches/patch-src_pal_src_file_path.cpp        |  13 +++
 .../patches/patch-src_pal_src_loader_module.cpp    |  13 +++
 .../patches/patch-src_pal_src_misc_dbgmsg.cpp      |  31 ++++++
 ...ests_palsuite_c__runtime___alloca_test1_test1.c |  13 +++
 .../patches/patch-src_tools_metainfo_mdinfo.cpp    |  13 +++
 .../patch-src_utilcode_genericstackprobe.cpp       |  13 +++
 .../patches/patch-src_utilcode_posterror.cpp       |  13 +++
 .../patches/patch-src_utilcode_prettyprintsig.cpp  |  22 ++++
 .../patches/patch-src_utilcode_sxshelpers.cpp      |  13 +++
 coreclr-git/patches/patch-src_vm_array.cpp         |  22 ++++
 coreclr-git/patches/patch-src_vm_assemblyspec.cpp  |  13 +++
 .../patches/patch-src_vm_baseassemblyspec.cpp      |  13 +++
 .../patches/patch-src_vm_baseassemblyspec.inl      |  22 ++++
 coreclr-git/patches/patch-src_vm_callhelpers.cpp   |  13 +++
 coreclr-git/patches/patch-src_vm_ceeload.cpp       |  22 ++++
 coreclr-git/patches/patch-src_vm_class.cpp         |  32 ++++++
 coreclr-git/patches/patch-src_vm_classhash.cpp     |  13 +++
 coreclr-git/patches/patch-src_vm_clrtocomcall.cpp  |  22 ++++
 coreclr-git/patches/patch-src_vm_clsload.cpp       |  22 ++++
 coreclr-git/patches/patch-src_vm_comdynamic.cpp    |  22 ++++
 coreclr-git/patches/patch-src_vm_compile.cpp       |  13 +++
 coreclr-git/patches/patch-src_vm_comtoclrcall.cpp  |  13 +++
 coreclr-git/patches/patch-src_vm_comwaithandle.cpp |  16 +++
 .../patches/patch-src_vm_crossdomaincalls.cpp      |  74 +++++++++++++
 .../patches/patch-src_vm_customattribute.cpp       |  44 ++++++++
 .../patches/patch-src_vm_dbggcinfodecoder.cpp      |  22 ++++
 coreclr-git/patches/patch-src_vm_debughelp.cpp     |  13 +++
 coreclr-git/patches/patch-src_vm_dispatchinfo.cpp  |  47 ++++++++
 coreclr-git/patches/patch-src_vm_dllimport.cpp     |  40 +++++++
 .../patches/patch-src_vm_dllimportcallback.cpp     |  13 +++
 .../patches/patch-src_vm_dwbucketmanager.hpp       |  22 ++++
 coreclr-git/patches/patch-src_vm_dwreport.cpp      |  37 +++++++
 coreclr-git/patches/patch-src_vm_encee.cpp         |  13 +++
 coreclr-git/patches/patch-src_vm_excep.cpp         |  13 +++
 .../patches/patch-src_vm_exceptionhandling.cpp     |  13 +++
 coreclr-git/patches/patch-src_vm_exceptmacros.h    |  13 +++
 .../patches/patch-src_vm_fieldmarshaler.cpp        |  31 ++++++
 coreclr-git/patches/patch-src_vm_fusionbind.cpp    |  22 ++++
 coreclr-git/patches/patch-src_vm_gchelpers.cpp     |  13 +++
 coreclr-git/patches/patch-src_vm_genericdict.cpp   |  13 +++
 coreclr-git/patches/patch-src_vm_generics.cpp      |  13 +++
 coreclr-git/patches/patch-src_vm_i386_excepcpu.h   |  22 ++++
 coreclr-git/patches/patch-src_vm_i386_excepx86.cpp |  13 +++
 coreclr-git/patches/patch-src_vm_i386_gmsx86.cpp   |  13 +++
 coreclr-git/patches/patch-src_vm_interoputil.cpp   |  46 ++++++++
 coreclr-git/patches/patch-src_vm_interpreter.cpp   |  76 +++++++++++++
 coreclr-git/patches/patch-src_vm_invokeutil.cpp    |  22 ++++
 coreclr-git/patches/patch-src_vm_jithelpers.cpp    |  22 ++++
 coreclr-git/patches/patch-src_vm_jitinterface.cpp  |  13 +++
 coreclr-git/patches/patch-src_vm_method.cpp        |  13 +++
 .../patches/patch-src_vm_methodtablebuilder.cpp    |  22 ++++
 coreclr-git/patches/patch-src_vm_objectclone.cpp   |  51 +++++++++
 coreclr-git/patches/patch-src_vm_olevariant.cpp    |  37 +++++++
 .../patches/patch-src_vm_proftoeeinterfaceimpl.cpp |  22 ++++
 .../patches/patch-src_vm_reflectioninvocation.cpp  |  67 ++++++++++++
 .../patches/patch-src_vm_runtimehandles.cpp        |  13 +++
 .../patches/patch-src_vm_securityattributes.cpp    |  91 ++++++++++++++++
 coreclr-git/patches/patch-src_vm_siginfo.cpp       |  22 ++++
 .../patches/patch-src_vm_stackbuildersink.cpp      |  57 ++++++++++
 .../patches/patch-src_vm_stringliteralmap.cpp      |  13 +++
 coreclr-git/patches/patch-src_vm_threads.cpp       |  22 ++++
 coreclr-git/patches/patch-src_vm_threadsuspend.cpp |  22 ++++
 coreclr-git/patches/patch-src_vm_util.cpp          |  24 +++++
 .../patches/patch-src_vm_win32threadpool.cpp       |  22 ++++
 coreclr-git/patches/patch-src_vm_zapsig.cpp        |  13 +++
 coreclr-git/patches/patch-src_zap_zapcode.cpp      |  13 +++
 coreclr-git/patches/patch-src_zap_zapper.cpp       |  34 ++++++
 120 files changed, 2883 insertions(+), 2 deletions(-)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index 76738a0..24df54c 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -1,7 +1,125 @@
 $NetBSD$
 
 SHA1 (patch-CMakeLists.txt) = 921b2713e8a7cf4ddcfa1fa2e028f3efa495357b
-SHA1 (patch-build.sh) = 7feac3e423fb4e3fd75f1bcdefee8a67c9c509aa
+SHA1 (patch-build.sh) = 38c35ab6d42f4147ad7b20df06f8ca438daf8070
+SHA1 (patch-src_ToolBox_PdbTypeMatch_PrintSymbol.cpp) = 266d174e5007a4706f0af1f74c2204e50406a7d0
 SHA1 (patch-src_ToolBox_SOS_Strike_CMakeLists.txt) = 6344da328f268a130081a5b6f7a2f736d098612d
+SHA1 (patch-src_ToolBox_SOS_Strike_eeheap.cpp) = a96f30dd3c060dfedf350f712043dd715b58d9d2
+SHA1 (patch-src_ToolBox_SOS_Strike_gcroot.cpp) = 417f0e23a7e6a8b8e88dbaafac463dd14141af25
+SHA1 (patch-src_ToolBox_SOS_Strike_metadata.cpp) = 595d08004892093e588e27a96a5a43b0c1f90258
+SHA1 (patch-src_ToolBox_SOS_Strike_sildasm.cpp) = 56486001066fc86096970e0f314c085f34bc4607
+SHA1 (patch-src_ToolBox_SOS_Strike_sos.cpp) = 7cd78cc84569e4419af54c79da098d5f8c5b0398
+SHA1 (patch-src_ToolBox_SOS_Strike_stressLogDump.cpp) = 67e37480cd2f4524c5c21d8bc4b57eb85825c025
+SHA1 (patch-src_ToolBox_SOS_Strike_strike.cpp) = 081f8ec2020848f988eab5ccf23e4c1dc07a33a3
+SHA1 (patch-src_ToolBox_SOS_Strike_util.h) = 7b62dfda1717d85ce22fa1f01fb6dea2cdccd88d
+SHA1 (patch-src_classlibnative_bcltype_arraynative.cpp) = 9ff26fd95b8ad3e5d8abee46936e98f5e184a960
+SHA1 (patch-src_debug_daccess_nidump.cpp) = 9fbb860b9555276addf6e9771e72e2b373cea7e4
+SHA1 (patch-src_debug_di_breakpoint.cpp) = 0f1a784326439152f685ef44c662b1d784e6ec68
+SHA1 (patch-src_debug_di_module.cpp) = 142e333cfeb8d6af9c77669f40890912830321b2
+SHA1 (patch-src_debug_di_process.cpp) = 3cd81281588f354b05064fee6914c5fc7ea9411c
+SHA1 (patch-src_debug_di_rsappdomain.cpp) = ec0e2f7dda0f6b2470afa04049c5efba283b3870
+SHA1 (patch-src_debug_di_rsclass.cpp) = e1c67d1b7792bff1e504810f017f8786eb2dee02
+SHA1 (patch-src_debug_di_rsthread.cpp) = d539f799ce3158e5f206992cddb05fd7de89949f
+SHA1 (patch-src_debug_di_rstype.cpp) = 05c45b4b4a73b06ae32d599b7fb0c2d12d76656c
+SHA1 (patch-src_debug_ee_dactable.cpp) = 67d37c77ed89d4a49840dcdd273e301f0918721d
+SHA1 (patch-src_debug_ee_debugger.cpp) = 2f496dc40ece985f6c7e6705e998740d1ec977e6
+SHA1 (patch-src_debug_ee_funceval.cpp) = cbb20c56723e424d9e52be3b333581e256dd2105
+SHA1 (patch-src_debug_ildbsymlib_symread.cpp) = a08447cc5cebd4cd101e14238735523a6e48af40
 SHA1 (patch-src_dlls_mscordbi_CMakeLists.txt) = 38013a29e151a949c6c1b86093c7e95435b89e57
+SHA1 (patch-src_dlls_mscorpe_pewriter.cpp) = 4b0d1e454a2229247c02d2d48d642d03584f3e43
+SHA1 (patch-src_ilasm_assembler.cpp) = 70ef6df921e877766c122dc73c2bd890efade426
+SHA1 (patch-src_inc_allocacheck.h) = f45769c357dab7bfc345bc0a2553b7655f768413
+SHA1 (patch-src_inc_corperme.h) = b9f0996db11318d2827fa61c7cec17c38f5e453a
+SHA1 (patch-src_inc_daccess.h) = e8af4ad502a6984aa06399310fa2742e664c8cc9
+SHA1 (patch-src_inc_formattype.cpp) = e88f6b93eda995ff7c8267ee91fbcaa600800590
+SHA1 (patch-src_inc_formattype.h) = 343c2d5a79dcfc225102488569acf3147d8f47c8
+SHA1 (patch-src_inc_nsutilpriv.h) = d4a3a738012fc6ad3c34bb22a64d17399a25208f
+SHA1 (patch-src_inc_winwrap.h) = 872d13a8b81f421ecd4cfd408b86b84f06cd74ca
+SHA1 (patch-src_jit_compiler.cpp) = 26f4d305b4abfa5f729bc394e0a9a3a1d9ad8539
+SHA1 (patch-src_jit_error.cpp) = fbace1044842e7423cd05591741717c50ad7ebd3
+SHA1 (patch-src_jit_flowgraph.cpp) = 1d8db265cae7e3de2702e2e62d21794010cdb20d
+SHA1 (patch-src_jit_gentree.cpp) = 0616e09aee5d9ab9f1d8080457b93d130d048445
+SHA1 (patch-src_jit_gtlist.h) = 7e491a1017d5d3c287730b17c6d6f6cf287e5770
+SHA1 (patch-src_jit_hashbv.cpp) = 35c6135184423ff529fe76fede497cdb61c9ddd5
+SHA1 (patch-src_jit_importer.cpp) = 94e3f6b7f8263e31ab816e2e32d762e684477709
+SHA1 (patch-src_jit_jiteh.cpp) = 369043bdf552afb58ade2e4ba9228585891d0ac9
+SHA1 (patch-src_jit_rationalize.cpp) = 691010ed130e2c18db600df254e101e2e4b9d87d
+SHA1 (patch-src_jit_ssabuilder.cpp) = fa5ea287c9c832775ad31f36ac3a8960321c63c6
+SHA1 (patch-src_md_compiler_custattr__import.cpp) = afd4ce6cb0c972e24aaaa8cba290f8401c9b6d78
+SHA1 (patch-src_md_compiler_regmeta__emit.cpp) = 2bf24416133308021a73b2801e38e5750e026679
+SHA1 (patch-src_md_enc_imptlb.cpp) = 940120bb76fc9c6fa9d1c5565f549262b41f5a61
+SHA1 (patch-src_md_enc_metamodelrw.cpp) = ca4ce964a07455061372b0595a5bad9dc0bf3118
+SHA1 (patch-src_md_enc_stgio.cpp) = a1f7eedf7a52faa2f5cd45c4f4449efde63f81c5
+SHA1 (patch-src_md_inc_rwutil.h) = 43cf7f6c5cf261c6ee09bae8be1a7f6e4ecee4c9
+SHA1 (patch-src_pal_inc_pal.h) = 895232535fec4de4d1fcfa29d6c70f450d92aeb5
 SHA1 (patch-src_pal_src_CMakeLists.txt) = db06bb55a6f78d8191b0005eae34732e03e38e60
+SHA1 (patch-src_pal_src_debug_debug.cpp) = 4b76cc5e8f008d67fbf4a80288620c26826bf47b
+SHA1 (patch-src_pal_src_file_directory.cpp) = bb469384258e5661b8cac832e8995e6168235820
+SHA1 (patch-src_pal_src_file_file.cpp) = 05faf99341da49ae61bd1f83f1bf2a3e2d0fecb4
+SHA1 (patch-src_pal_src_file_path.cpp) = 5a5e3d71c74338f4f534a1f76c54c0e597997416
+SHA1 (patch-src_pal_src_loader_module.cpp) = 64a6aa9ed9dc73d8e973bc795f9c218da9724664
+SHA1 (patch-src_pal_src_misc_dbgmsg.cpp) = baa458a3fb767e9b0e62c8a96c83a21733453b43
+SHA1 (patch-src_pal_tests_palsuite_c__runtime___alloca_test1_test1.c) = 2da2e5f5e8e25408dd5613a1498077f5ddb51a81
+SHA1 (patch-src_tools_metainfo_mdinfo.cpp) = 290a6b40e7facbd686f43bcfcc806cb07b1ec153
+SHA1 (patch-src_utilcode_genericstackprobe.cpp) = 97accc910a45bd86e1f961408ad7749310108c7e
+SHA1 (patch-src_utilcode_posterror.cpp) = 5713450f7c09ef75f1a3b0e3170099111c1e25f0
+SHA1 (patch-src_utilcode_prettyprintsig.cpp) = 4feaf88630f59894aed454b0adb395eef92f615c
+SHA1 (patch-src_utilcode_sxshelpers.cpp) = aee26c29491bf996a2e5d4afeccedb2b4e5a4521
+SHA1 (patch-src_vm_array.cpp) = ebf1015703e0255924d1716a33c8967dd0aec6a2
+SHA1 (patch-src_vm_assemblyspec.cpp) = b279eb520f103ddc15ba531632de98743d1b2d76
+SHA1 (patch-src_vm_baseassemblyspec.cpp) = a177dcd1e1999a4bc2cfe5a2eaead5ea67d687e2
+SHA1 (patch-src_vm_baseassemblyspec.inl) = 9eb2fa0b96ce5fa7908511ce40cb2329291286bc
+SHA1 (patch-src_vm_callhelpers.cpp) = 1ff88564bbf318ebc7c05e448e719fe0ceef6cb5
+SHA1 (patch-src_vm_ceeload.cpp) = 7fc42b571a9cda2018f86175e1734aed6c0a641e
+SHA1 (patch-src_vm_class.cpp) = 02089a5436c736a33d509cfa2dd87c47ed86f4e5
+SHA1 (patch-src_vm_classhash.cpp) = e9ccde60c1a1f93c7257508fcf6cb55098af9d0f
+SHA1 (patch-src_vm_clrtocomcall.cpp) = 069c942437e1855be037d67a2f6a17773b861403
+SHA1 (patch-src_vm_clsload.cpp) = 5aaee85491ff9f7d89899f836c5dafa9692ead5a
+SHA1 (patch-src_vm_comdynamic.cpp) = edf6eb548c82494b8f8d9dc82c8eac5d97b52686
+SHA1 (patch-src_vm_compile.cpp) = 2fe17c6d47aea473b584ee4406c29645b74c961b
+SHA1 (patch-src_vm_comtoclrcall.cpp) = 41b9fb70b573a30f0e3090c2a4d09686dd3b1d3d
+SHA1 (patch-src_vm_comwaithandle.cpp) = 275950b50e6fa138f1152632c05e9451f31afba3
+SHA1 (patch-src_vm_crossdomaincalls.cpp) = 39acc44cfd683389b9accd39a7e2dcb721b05a16
+SHA1 (patch-src_vm_customattribute.cpp) = cbdf9f00f99b15e0e1e6ae13c5d04149385dfcab
+SHA1 (patch-src_vm_dbggcinfodecoder.cpp) = a19c15de55adb3a7cf0ad097cddc37589402b427
+SHA1 (patch-src_vm_debughelp.cpp) = 347e62052ccf30258ce1ec0281de2b808bbb2301
+SHA1 (patch-src_vm_dispatchinfo.cpp) = 112181c1cdcaddcc1e4d79dbc18e1635e3de0d04
+SHA1 (patch-src_vm_dllimport.cpp) = dd165c97684b5275ccae03e026edf8f807966b60
+SHA1 (patch-src_vm_dllimportcallback.cpp) = c4ccb9a7095c438e8540370823e686e925f06a2f
+SHA1 (patch-src_vm_dwbucketmanager.hpp) = 5afbd9888073f918074cf556a7eb0354cfbbdcd1
+SHA1 (patch-src_vm_dwreport.cpp) = cca07e765e0a3f0512617db4491a2c87e0f436d0
+SHA1 (patch-src_vm_encee.cpp) = 670cb7fb83eb07c26a73447f5c2830ea384fa6d9
+SHA1 (patch-src_vm_excep.cpp) = b5618da2ea5504ab980975538867553127af5c0f
+SHA1 (patch-src_vm_exceptionhandling.cpp) = ec435d81d39a00036055552a37d2b5296c7bbaa9
+SHA1 (patch-src_vm_exceptmacros.h) = cb2f72c2b9916d0b326aa3d30bf3859860cbbed9
+SHA1 (patch-src_vm_fieldmarshaler.cpp) = 31a191561f70ad8a4a0f7ee7b94f3efd8e037daa
+SHA1 (patch-src_vm_fusionbind.cpp) = 758a73c7b2f9e7e89b67c72617f9131942a749e9
+SHA1 (patch-src_vm_gchelpers.cpp) = 4bb39b9eda53dd26c3b5a3391672c0468b8ad084
+SHA1 (patch-src_vm_genericdict.cpp) = c0743a6820e06719ee9dde5a0167ec9d8aeea758
+SHA1 (patch-src_vm_generics.cpp) = e3fc585d3593917888d9bebd2840a418cb9b3d70
+SHA1 (patch-src_vm_i386_excepcpu.h) = ae2fa3654e004da1399346ce4ade6d2be477c164
+SHA1 (patch-src_vm_i386_excepx86.cpp) = bf96dfc86bfb51c692f2a3a55e9cd7dbb8ad5d2e
+SHA1 (patch-src_vm_i386_gmsx86.cpp) = 66876a98a4f12e240f2764e72498c579996c1229
+SHA1 (patch-src_vm_interoputil.cpp) = fa46bf2dbe121fc4798020839794fade477686bd
+SHA1 (patch-src_vm_interpreter.cpp) = 42e245da263c20a6b8e2dfe2210b76bc5ead131e
+SHA1 (patch-src_vm_invokeutil.cpp) = 7cc2cb166ee3cdec582ef36c8491ab517524aa39
+SHA1 (patch-src_vm_jithelpers.cpp) = 1e5daf23b269c1d3f93fc2eae75073eb93db3c6c
+SHA1 (patch-src_vm_jitinterface.cpp) = a5686422ce4bcae6ba2bfe9ff21a5acb033c358c
+SHA1 (patch-src_vm_method.cpp) = 7e409b95311a6c1610eb6aceced20607501cc233
+SHA1 (patch-src_vm_methodtablebuilder.cpp) = 7f86a5cb7501586960bafeb1c3a140860fd837f9
+SHA1 (patch-src_vm_objectclone.cpp) = f1005f8ec3a3c59ca7b4ee2887e5a68bd462e760
+SHA1 (patch-src_vm_olevariant.cpp) = 5f7562d68d9748f54c8a46b546f3e085bc262d3f
+SHA1 (patch-src_vm_proftoeeinterfaceimpl.cpp) = 95751444f88eb528074f0f305a8219ac5e3e9ccb
+SHA1 (patch-src_vm_reflectioninvocation.cpp) = 0ab35124ddb64aa9d1e612bb3ea08093c0fdf03c
+SHA1 (patch-src_vm_runtimehandles.cpp) = c0609a981e67396b7cdd744a9790a4ff08a4bcde
+SHA1 (patch-src_vm_securityattributes.cpp) = eba3c8d20989c985fa2d3f4d252c56e23119c039
+SHA1 (patch-src_vm_siginfo.cpp) = 02d3c5736df76f072299cb8c95bea2da5396f428
+SHA1 (patch-src_vm_stackbuildersink.cpp) = 7f2b9e0c0c37a27ac1636fb2b5489cc19186c71a
+SHA1 (patch-src_vm_stringliteralmap.cpp) = 54e2b6b31865ce055f58306e9acc04f3eeda83f5
+SHA1 (patch-src_vm_threads.cpp) = 65d4d08532f23773521c2e0ccd885a49e590ffd9
+SHA1 (patch-src_vm_threadsuspend.cpp) = 302337fc678a58add974113059fbbfa09677c38c
+SHA1 (patch-src_vm_util.cpp) = 2bdb2d9cd4f3faed6579ac17b5c684b9514ea6b3
+SHA1 (patch-src_vm_win32threadpool.cpp) = a382f4ee63f6ace653e0ec7831137561aa85c823
+SHA1 (patch-src_vm_zapsig.cpp) = 2af977e56006f04feade86d903449756b17c1fc3
+SHA1 (patch-src_zap_zapcode.cpp) = c2c0fd5c497543f2ced35feada57d334d463fd93
+SHA1 (patch-src_zap_zapper.cpp) = 21e5c44b11df9aa7d5d4161f256b37c14bda8123
diff --git a/coreclr-git/patches/patch-build.sh b/coreclr-git/patches/patch-build.sh
index f8410e4..8f7931a 100644
--- a/coreclr-git/patches/patch-build.sh
+++ b/coreclr-git/patches/patch-build.sh
@@ -1,7 +1,13 @@
 $NetBSD$
 
---- build.sh.orig	2016-02-15 11:05:55.000000000 +0000
+--- build.sh.orig	2016-02-12 01:41:34.000000000 +0000
 +++ build.sh
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/usr/pkg/bin/bash
+ 
+ PYTHON=${PYTHON:-python}
+ 
 @@ -204,7 +204,7 @@ isMSBuildOnNETCoreSupported()
                      __isMSBuildOnNETCoreSupported=1
                  fi 
diff --git a/coreclr-git/patches/patch-src_ToolBox_PdbTypeMatch_PrintSymbol.cpp b/coreclr-git/patches/patch-src_ToolBox_PdbTypeMatch_PrintSymbol.cpp
new file mode 100644
index 0000000..c90295e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_PdbTypeMatch_PrintSymbol.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/ToolBox/PdbTypeMatch/PrintSymbol.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/PdbTypeMatch/PrintSymbol.cpp
+@@ -1546,7 +1546,7 @@ void PrintType(IDiaSymbol *pSymbol)
+         }
+ 
+         if (pSymbol->get_types(0, &count, NULL) == S_OK) {
+-          IDiaSymbol** rgpDiaSymbols = (IDiaSymbol**) _alloca(sizeof(IDiaSymbol *) * count);
++          IDiaSymbol** rgpDiaSymbols = (IDiaSymbol**) Alloca(sizeof(IDiaSymbol *) * count);
+ 
+           if (pSymbol->get_types(count, &count, rgpDiaSymbols) == S_OK) {
+             for (ULONG i = 0; i < count; i++) {
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_eeheap.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_eeheap.cpp
new file mode 100644
index 0000000..87028cb
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_eeheap.cpp
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/eeheap.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/eeheap.cpp
+@@ -8,6 +8,7 @@
+ // 
+ // ==--==
+ #include <assert.h>
++#include <stdlib.h>
+ #include "sos.h"
+ #include "safemath.h"
+ 
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_gcroot.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_gcroot.cpp
new file mode 100644
index 0000000..681ee3d
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_gcroot.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/gcroot.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/gcroot.cpp
+@@ -544,7 +544,7 @@ int GCRootImpl::PrintRootsInOlderGen()
+             return 0;
+         }
+ 
+-        CLRDATA_ADDRESS *heapAddrs = (CLRDATA_ADDRESS*)alloca(dwAllocSize);
++        CLRDATA_ADDRESS *heapAddrs = (CLRDATA_ADDRESS*)Alloca(dwAllocSize);
+         if (g_sos->GetGCHeapList(dwNHeaps, heapAddrs, NULL) != S_OK)
+         {
+             ExtErr("Failed to get GCHeaps\n");
+@@ -625,7 +625,7 @@ int GCRootImpl::PrintRootsOnFQ(bool notR
+             return 0;
+         }
+ 
+-        CLRDATA_ADDRESS *heapAddrs = (CLRDATA_ADDRESS*)alloca(dwAllocSize);
++        CLRDATA_ADDRESS *heapAddrs = (CLRDATA_ADDRESS*)Alloca(dwAllocSize);
+         if (g_sos->GetGCHeapList(dwNHeaps, heapAddrs, NULL) != S_OK)
+         {
+             ExtErr("Error requesting heap data.\n");
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_metadata.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_metadata.cpp
new file mode 100644
index 0000000..bdb2435
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_metadata.cpp
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/metadata.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/metadata.cpp
+@@ -41,7 +41,7 @@ static HRESULT NameForTypeDef_s(mdTypeDe
+     if (hr != S_OK) {
+         return hr;
+     }
+-    WCHAR *name = (WCHAR*)_alloca((nameLen+1)*sizeof(WCHAR));
++    WCHAR *name = (WCHAR*)alloca((nameLen+1)*sizeof(WCHAR));
+     wcscpy_s (name, nameLen+1, mdName);
+     hr = NameForTypeDef_s(tkEnclosingClass,pImport,mdName, capacity_mdName);
+     if (hr != S_OK) {
+@@ -75,8 +75,8 @@ static HRESULT NameForTypeDefNew(mdTypeD
+ {
+     DWORD flags;
+     ULONG nameLen;
+-    char *name = (char *)_alloca((mdNameLen+1)*sizeof(char));
+-    char *namesp = (char *)_alloca((mdNameLen+1)*sizeof(char));
++    char *name = (char *)alloca((mdNameLen+1)*sizeof(char));
++    char *namesp = (char *)alloca((mdNameLen+1)*sizeof(char));
+     
+     HRESULT hr = pImport->GetNameOfTypeDef(tkTypeDef, name, namesp);
+     if (FAILED(hr))
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sildasm.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sildasm.cpp
new file mode 100644
index 0000000..d6b321e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sildasm.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/sildasm.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/sildasm.cpp
+@@ -774,7 +774,7 @@ PCCOR_SIGNATURE PrettyPrintType(
+ // set Reiterate to true, so we only execute through the loop once!
+ #pragma warning(disable:6263) // "Suppress PREfast warnings about stack overflow due to _alloca in a loop."
+ #endif
+-                    int* lowerBounds = (int*) _alloca(sizeof(int)*2*rank);
++                    int* lowerBounds = (int*) alloca(sizeof(int)*2*rank);
+                     int* sizes       = &lowerBounds[rank];  
+                     memset(lowerBounds, 0, sizeof(int)*2*rank); 
+                     
+@@ -899,7 +899,7 @@ PCCOR_SIGNATURE PrettyPrintType(
+ const char *const szStdNamePrefix[] = {"MO","TR","TD","","FD","","MD","","PA","II","MR","","CA","","PE","","","SG","","","EV",
+ "","","PR","","","MOR","TS","","","","","AS","","","AR","","","FL","ET","MAR"};
+ 
+-#define MAKE_NAME_IF_NONE(psz, tk) { if(!(psz && *psz)) { char* sz = (char*)_alloca(16); \
++#define MAKE_NAME_IF_NONE(psz, tk) { if(!(psz && *psz)) { char* sz = (char*)alloca(16); \
+ sprintf_s(sz,16,"$%s$%X",szStdNamePrefix[tk>>24],tk&0x00FFFFFF); psz = sz; } }
+ 
+ const char* PrettyPrintClass(
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sos.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sos.cpp
new file mode 100644
index 0000000..559f293
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_sos.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/sos.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/sos.cpp
+@@ -729,7 +729,7 @@ namespace sos
+             if (!ClrSafeInt<DWORD>::multiply(sizeof(CLRDATA_ADDRESS), mNumHeaps, dwAllocSize))
+                 sos::Throw<Exception>("Failed to get GCHeaps: Integer overflow.");
+ 
+-            CLRDATA_ADDRESS *heapAddrs = (CLRDATA_ADDRESS*)alloca(dwAllocSize);
++            CLRDATA_ADDRESS *heapAddrs = (CLRDATA_ADDRESS*)Alloca(dwAllocSize);
+             if (FAILED(g_sos->GetGCHeapList(mNumHeaps, heapAddrs, NULL)))
+                 sos::Throw<DataRead>("Failed to get GCHeaps.");
+ 
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_stressLogDump.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_stressLogDump.cpp
new file mode 100644
index 0000000..ab3beae
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_stressLogDump.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/stressLogDump.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/stressLogDump.cpp
+@@ -255,7 +255,7 @@ void formatOutput(struct IDebugDataSpace
+                 // need to _alloca, instead of declaring a local buffer
+                 // since we may have more than one %s in the format
+                 ULONG cbStrBuf = 256;
+-                char* strBuf = (char *)_alloca(cbStrBuf);
++                char* strBuf = (char *)alloca(cbStrBuf);
+                 
+                 hr = memCallBack->ReadVirtual(TO_CDADDR((char* )args[iArgCount]), strBuf, cbStrBuf, 0);
+                 if (hr != S_OK) 
+@@ -272,7 +272,7 @@ void formatOutput(struct IDebugDataSpace
+                 // need to _alloca, instead of declaring a local buffer
+                 // since we may have more than one %s in the format
+                 ULONG cbWstrBuf = 256 * sizeof(WCHAR);
+-                WCHAR* wstrBuf = (WCHAR *)_alloca(cbWstrBuf);
++                WCHAR* wstrBuf = (WCHAR *)alloca(cbWstrBuf);
+                 
+                 hr = memCallBack->ReadVirtual(TO_CDADDR((char* )args[iArgCount]), wstrBuf, cbWstrBuf, 0);
+                 if (hr != S_OK)
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.cpp b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.cpp
new file mode 100644
index 0000000..f49de35
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/strike.cpp.orig	2016-02-10 22:49:42.000000000 +0000
++++ src/ToolBox/SOS/Strike/strike.cpp
+@@ -12752,7 +12752,7 @@ DECLARE_API(SaveModule)
+ 
+     int nSection = Header.FileHeader.NumberOfSections;
+     ExtOut("%u sections in file\n",nSection);
+-    MemLocation *memLoc = (MemLocation*)_alloca(nSection*sizeof(MemLocation));
++    MemLocation *memLoc = (MemLocation*)alloca(nSection*sizeof(MemLocation));
+     int indxSec = -1;
+     int slot;
+     for (int n = 0; n < nSection; n++)
+@@ -12805,7 +12805,7 @@ DECLARE_API(SaveModule)
+     }
+ 
+     ULONG pageSize = OSPageSize();
+-    char *buffer = (char *)_alloca(pageSize);
++    char *buffer = (char *)alloca(pageSize);
+     DWORD nRead;
+     DWORD nWrite;
+     
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_util.h b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_util.h
new file mode 100644
index 0000000..88355a7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_util.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/util.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/util.h
+@@ -683,7 +683,7 @@ namespace Output
+             if (IsDMLEnabled() && mDml != Output::DML_None)
+             {
+                 const int len = GetDMLWidth(mDml);
+-                char *buffer = (char*)alloca(len);
++                char *buffer = (char*)Alloca(len);
+             
+                 BuildDML(buffer, len, (CLRDATA_ADDRESS)mValue, mFormat, mDml);
+                 DMLOut(buffer);
+@@ -732,7 +732,7 @@ namespace Output
+             if (IsDMLEnabled() && mDml != Output::DML_None)
+             {
+                 const int len = GetDMLColWidth(mDml, width);
+-                char *buffer = (char*)alloca(len);
++                char *buffer = (char*)Alloca(len);
+             
+                 BuildDMLCol(buffer, len, (CLRDATA_ADDRESS)mValue, mFormat, mDml, leftAlign, width);
+                 DMLOut(buffer);
+@@ -782,7 +782,7 @@ namespace Output
+             const char *cstr = (const char *)str;
+         
+             int len = MultiByteToWideChar(CP_ACP, 0, cstr, -1, NULL, 0);
+-            WCHAR *buffer = (WCHAR *)alloca(len*sizeof(WCHAR));
++            WCHAR *buffer = (WCHAR *)Alloca(len*sizeof(WCHAR));
+         
+             MultiByteToWideChar(CP_ACP, 0, cstr, -1, buffer, len);
+         
+@@ -798,7 +798,7 @@ namespace Output
+             if (IsDMLEnabled() && mDml != Output::DML_None)
+             {
+                 const int len = GetDMLColWidth(mDml, 0);
+-                char *buffer = (char*)alloca(len);
++                char *buffer = (char*)Alloca(len);
+             
+                 BuildDMLCol(buffer, len, (CLRDATA_ADDRESS)mValue, mFormat, mDml, false, 0);
+                 return buffer;
diff --git a/coreclr-git/patches/patch-src_classlibnative_bcltype_arraynative.cpp b/coreclr-git/patches/patch-src_classlibnative_bcltype_arraynative.cpp
new file mode 100644
index 0000000..9786c9a
--- /dev/null
+++ b/coreclr-git/patches/patch-src_classlibnative_bcltype_arraynative.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/classlibnative/bcltype/arraynative.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/classlibnative/bcltype/arraynative.cpp
+@@ -1306,7 +1306,7 @@ FCIMPL4(Object*, ArrayNative::CreateInst
+             if (!ClrSafeInt<DWORD>::multiply(boundsSize, sizeof(INT32), dwAllocaSize))
+                 COMPlusThrowOM();
+ 
+-            bounds = (INT32*) _alloca(dwAllocaSize);
++            bounds = (INT32*) Alloca(dwAllocaSize);
+ 
+             for (int i=0;i<rank;i++) {
+                 bounds[2*i] = pLowerBounds[i];
+@@ -1320,7 +1320,7 @@ FCIMPL4(Object*, ArrayNative::CreateInst
+             if (!ClrSafeInt<DWORD>::multiply(boundsSize, sizeof(INT32), dwAllocaSize))
+                 COMPlusThrowOM();
+ 
+-            bounds = (INT32*) _alloca(dwAllocaSize);
++            bounds = (INT32*) Alloca(dwAllocaSize);
+ 
+             // We need to create a private copy of pLengths to avoid holes caused
+             // by caller mutating the array
diff --git a/coreclr-git/patches/patch-src_debug_daccess_nidump.cpp b/coreclr-git/patches/patch-src_debug_daccess_nidump.cpp
new file mode 100644
index 0000000..23f474e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_daccess_nidump.cpp
@@ -0,0 +1,32 @@
+$NetBSD$
+
+--- src/debug/daccess/nidump.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/daccess/nidump.cpp
+@@ -2380,14 +2380,14 @@ mdAssemblyRef NativeImageDumper::MapAsse
+     LPWSTR szAssemblyName           = NULL;
+ 
+     if (cchName > 0)
+-        szAssemblyName = (LPWSTR) _alloca(cchName * sizeof(WCHAR));
++        szAssemblyName = (LPWSTR) Alloca(cchName * sizeof(WCHAR));
+ 
+     if (metadata.cbLocale > 0)
+-        metadata.szLocale = (LPWSTR) _alloca(metadata.cbLocale * sizeof(WCHAR));
++        metadata.szLocale = (LPWSTR) Alloca(metadata.cbLocale * sizeof(WCHAR));
+     if (metadata.ulProcessor > 0)
+-        metadata.rProcessor = (DWORD*) _alloca(metadata.ulProcessor * sizeof(DWORD));
++        metadata.rProcessor = (DWORD*) Alloca(metadata.ulProcessor * sizeof(DWORD));
+     if (metadata.ulOS > 0)
+-        metadata.rOS = (OSINFO*) _alloca(metadata.ulOS * sizeof(OSINFO));
++        metadata.rOS = (OSINFO*) Alloca(metadata.ulOS * sizeof(OSINFO));
+ 
+     const void *pbPublicKey;
+     ULONG cbPublicKey;
+@@ -2876,7 +2876,7 @@ IMetaDataImport2 * NativeImageDumper::Ty
+                 size_t cbLowerBounds;
+                 if (!ClrSafeInt<size_t>::multiply(rank, 2*sizeof(int), cbLowerBounds/* passed by ref */))
+                     ThrowHR(COR_E_OVERFLOW);
+-                int* lowerBounds = (int*) _alloca(cbLowerBounds);
++                int* lowerBounds = (int*) Alloca(cbLowerBounds);
+                 int* sizes       = &lowerBounds[rank];  
+                 memset(lowerBounds, 0, sizeof(int)*2*rank); 
+                 
diff --git a/coreclr-git/patches/patch-src_debug_di_breakpoint.cpp b/coreclr-git/patches/patch-src_debug_di_breakpoint.cpp
new file mode 100644
index 0000000..6a4b41a
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_breakpoint.cpp
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- src/debug/di/breakpoint.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/breakpoint.cpp
+@@ -190,7 +190,7 @@ HRESULT CordbFunctionBreakpoint::Activat
+     pProcess->ClearPatchTable(); // if we add something, then the right side 
+                                 // view of the patch table is no longer valid
+ 
+-    DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++    DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+ 
+     CordbAppDomain * pAppDomain = GetAppDomain();
+     _ASSERTE (pAppDomain != NULL);
+@@ -507,7 +507,7 @@ HRESULT CordbStepper::StepRange(BOOL fSt
+     // Build step event
+     //
+ 
+-    DebuggerIPCEvent * pEvent = reinterpret_cast<DebuggerIPCEvent *>(_alloca(CorDBIPC_BUFFER_SIZE));
++    DebuggerIPCEvent * pEvent = reinterpret_cast<DebuggerIPCEvent *>(Alloca(CorDBIPC_BUFFER_SIZE));
+ 
+     pProcess->InitIPCEvent(pEvent, DB_IPCE_STEP, true, GetAppDomain()->GetADToken());
+ 
+@@ -674,7 +674,7 @@ HRESULT CordbStepper::StepOut()
+     // Build step event
+     //
+ 
+-    DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++    DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+ 
+     pProcess->InitIPCEvent(pEvent, DB_IPCE_STEP_OUT, true, GetAppDomain()->GetADToken());
+ 
diff --git a/coreclr-git/patches/patch-src_debug_di_module.cpp b/coreclr-git/patches/patch-src_debug_di_module.cpp
new file mode 100644
index 0000000..72877bb
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_module.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/debug/di/module.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/module.cpp
+@@ -2322,7 +2322,7 @@ HRESULT CordbModule::ApplyChangesInterna
+         // We always copy over the whole buffer size which is bigger than sizeof(DebuggerIPCEvent)
+         // This seems ugly, in this case we know the exact size of the event we want to read
+         // why copy over all the extra data?
+-        DebuggerIPCEvent *retEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++        DebuggerIPCEvent *retEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+ 
+         {
+             //
diff --git a/coreclr-git/patches/patch-src_debug_di_process.cpp b/coreclr-git/patches/patch-src_debug_di_process.cpp
new file mode 100644
index 0000000..df62c6e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_process.cpp
@@ -0,0 +1,85 @@
+$NetBSD$
+
+--- src/debug/di/process.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/process.cpp
+@@ -1970,7 +1970,7 @@ void SendAttachProcessWorkItem::Do()
+     // This is being processed on the RCET, where it's safe to take the Stop-Go lock.
+     RSLockHolder ch(this->GetProcess()->GetStopGoLock());
+ 
+-    DebuggerIPCEvent *event = (DebuggerIPCEvent*) _alloca(CorDBIPC_BUFFER_SIZE);
++    DebuggerIPCEvent *event = (DebuggerIPCEvent*) Alloca(CorDBIPC_BUFFER_SIZE);
+     
+     // This just acts like an async-break, which will kick off things.
+     // This will not induce any faked attach events from the VM (like it did in V2).
+@@ -2511,7 +2511,7 @@ COM_METHOD CordbProcess::InvokePauseCall
+     
+     EX_TRY
+     {
+-        DebuggerIPCEvent * pIPCEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++        DebuggerIPCEvent * pIPCEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+         InitIPCEvent(pIPCEvent, DB_IPCE_NETCF_HOST_CONTROL_PAUSE, true, VMPTR_AppDomain::NullPtr());
+ 
+         hr = m_cordb->SendIPCEvent(this, pIPCEvent, CorDBIPC_BUFFER_SIZE);
+@@ -2530,7 +2530,7 @@ COM_METHOD CordbProcess::InvokeResumeCal
+     
+     EX_TRY
+     {
+-        DebuggerIPCEvent * pIPCEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++        DebuggerIPCEvent * pIPCEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+         InitIPCEvent(pIPCEvent, DB_IPCE_NETCF_HOST_CONTROL_RESUME, true, VMPTR_AppDomain::NullPtr());
+ 
+         hr = m_cordb->SendIPCEvent(this, pIPCEvent, CorDBIPC_BUFFER_SIZE);
+@@ -3090,7 +3090,7 @@ void CordbProcess::DetachShim()
+         }
+ 
+         // Go ahead and detach from the entire process now. This is like sending a "Continue".
+-        DebuggerIPCEvent * pIPCEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++        DebuggerIPCEvent * pIPCEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+         InitIPCEvent(pIPCEvent, DB_IPCE_DETACH_FROM_PROCESS, true, VMPTR_AppDomain::NullPtr());
+ 
+         hr = m_cordb->SendIPCEvent(this, pIPCEvent, CorDBIPC_BUFFER_SIZE);
+@@ -3502,7 +3502,7 @@ HRESULT CordbProcess::StopInternal(DWORD
+     }
+ 
+     // Send the async break event to the RC.
+-    event = (DebuggerIPCEvent*) _alloca(CorDBIPC_BUFFER_SIZE);
++    event = (DebuggerIPCEvent*) Alloca(CorDBIPC_BUFFER_SIZE);
+     InitIPCEvent(event, DB_IPCE_ASYNC_BREAK, false, pAppDomainToken);
+ 
+     STRESS_LOG1(LF_CORDB, LL_INFO1000, "CP::S: sending async stop to appd 0x%x.\n", VmPtrToCookie(pAppDomainToken));
+@@ -4115,7 +4115,7 @@ HRESULT CordbProcess::ContinueInternal(B
+         STRESS_LOG2(LF_CORDB, LL_INFO1000, "Continue flags:special=%d, dowin32=%d\n", m_specialDeferment, fDoWin32Continue);
+ #endif
+         // Send to the RC to continue the process.
+-        DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++        DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+ 
+         InitIPCEvent(pEvent, DB_IPCE_CONTINUE, false, pAppDomainToken);
+ 
+@@ -8404,7 +8404,7 @@ HRESULT CordbProcess::StartSyncFromWin32
+             LOG((LF_CORDB, LL_INFO1000, "[%x] CP::SSFW32S: internal continue returned\n", GetCurrentThreadId()));
+ 
+             // Send an async break to the left side now that its running.
+-            DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) _alloca(CorDBIPC_BUFFER_SIZE);
++            DebuggerIPCEvent * pEvent = (DebuggerIPCEvent *) Alloca(CorDBIPC_BUFFER_SIZE);
+             InitIPCEvent(pEvent, DB_IPCE_ASYNC_BREAK, false, VMPTR_AppDomain::NullPtr());
+ 
+             LOG((LF_CORDB, LL_INFO1000, "[%x] CP::SSFW32S: sending async stop\n", GetCurrentThreadId()));
+@@ -8616,7 +8616,7 @@ HRESULT CordbProcess::EnableLogMessages(
+     ATT_REQUIRE_STOPPED_MAY_FAIL(this);
+     HRESULT hr = S_OK;
+ 
+-    DebuggerIPCEvent *event = (DebuggerIPCEvent*) _alloca(CorDBIPC_BUFFER_SIZE);
++    DebuggerIPCEvent *event = (DebuggerIPCEvent*) Alloca(CorDBIPC_BUFFER_SIZE);
+     InitIPCEvent(event, DB_IPCE_ENABLE_LOG_MESSAGES, false, VMPTR_AppDomain::NullPtr());
+     event->LogSwitchSettingMessage.iLevel = (int)fOnOff;
+ 
+@@ -8642,7 +8642,7 @@ COM_METHOD CordbProcess::ModifyLogSwitch
+ 
+     _ASSERTE (pLogSwitchName != NULL);
+ 
+-    DebuggerIPCEvent *event = (DebuggerIPCEvent*) _alloca(CorDBIPC_BUFFER_SIZE);
++    DebuggerIPCEvent *event = (DebuggerIPCEvent*) Alloca(CorDBIPC_BUFFER_SIZE);
+     InitIPCEvent(event, DB_IPCE_MODIFY_LOGSWITCH, false, VMPTR_AppDomain::NullPtr());
+     event->LogSwitchSettingMessage.iLevel = lLevel;
+     event->LogSwitchSettingMessage.szSwitchName.SetStringTruncate(pLogSwitchName);
diff --git a/coreclr-git/patches/patch-src_debug_di_rsappdomain.cpp b/coreclr-git/patches/patch-src_debug_di_rsappdomain.cpp
new file mode 100644
index 0000000..7841bcd
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_rsappdomain.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/debug/di/rsappdomain.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/rsappdomain.cpp
+@@ -1029,7 +1029,7 @@ HRESULT CordbAppDomain::GetFunctionPoint
+         return E_INVALIDARG;
+     }
+ 
+-    CordbType ** ppTypeInstantiations = reinterpret_cast<CordbType **>(_alloca(allocSize.Value()));
++    CordbType ** ppTypeInstantiations = reinterpret_cast<CordbType **>(Alloca(allocSize.Value()));
+ 
+     for (unsigned int i = 0; i < cTypeArgs; i++)
+     {
diff --git a/coreclr-git/patches/patch-src_debug_di_rsclass.cpp b/coreclr-git/patches/patch-src_debug_di_rsclass.cpp
new file mode 100644
index 0000000..afa49ea
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_rsclass.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/debug/di/rsclass.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/rsclass.cpp
+@@ -405,7 +405,7 @@ HRESULT CordbClass::GetParameterizedType
+ 
+     // Note: casting from (ICorDebugType **) to (CordbType **) is not valid.
+     // Offsets may differ.  Copy and validate the type array.
+-    CordbType ** ppArgTypes = reinterpret_cast<CordbType **>(_alloca( allocSize.Value()));
++    CordbType ** ppArgTypes = reinterpret_cast<CordbType **>(Alloca( allocSize.Value()));
+ 
+     for (unsigned int i = 0; i < cTypeArgs; i++)
+     {
diff --git a/coreclr-git/patches/patch-src_debug_di_rsthread.cpp b/coreclr-git/patches/patch-src_debug_di_rsthread.cpp
new file mode 100644
index 0000000..7bb8b23
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_rsthread.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/debug/di/rsthread.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/rsthread.cpp
+@@ -9368,7 +9368,7 @@ HRESULT CordbEval::GatherArgInfo(ICorDeb
+ 
+             _ASSERTE(fullArgTypeNodeCount > 0);
+             unsigned int bufferSize = sizeof(DebuggerIPCE_TypeArgData) * fullArgTypeNodeCount;
+-            DebuggerIPCE_TypeArgData *bufferFrom = (DebuggerIPCE_TypeArgData *) _alloca(bufferSize);
++            DebuggerIPCE_TypeArgData *bufferFrom = (DebuggerIPCE_TypeArgData *) Alloca(bufferSize);
+ 
+             DebuggerIPCE_TypeArgData *curr = bufferFrom;
+             CordbType::GatherTypeData(cv->m_type, &curr);
+@@ -10332,7 +10332,7 @@ HRESULT CordbEval::NewParameterizedArray
+     }
+ 
+     // Just in case sizeof(SIZE_T) != sizeof(ULONG32)
+-    SIZE_T * rgDimensionsSizeT = reinterpret_cast<SIZE_T *>(_alloca(allocSize.Value()));
++    SIZE_T * rgDimensionsSizeT = reinterpret_cast<SIZE_T *>(Alloca(allocSize.Value()));
+ 
+     for (unsigned int i = 0; i < rank; i++)
+     {
diff --git a/coreclr-git/patches/patch-src_debug_di_rstype.cpp b/coreclr-git/patches/patch-src_debug_di_rstype.cpp
new file mode 100644
index 0000000..f926e4c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_di_rstype.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/debug/di/rstype.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/di/rstype.cpp
+@@ -976,7 +976,7 @@ CordbType::SigToType(CordbModule * pModu
+                 IfFailRet(E_OUTOFMEMORY);
+             }
+ 
+-            CordbType ** ppTypeInstantiations = reinterpret_cast<CordbType **>(_alloca( allocSize.Value()));
++            CordbType ** ppTypeInstantiations = reinterpret_cast<CordbType **>(Alloca( allocSize.Value()));
+ 
+             for (unsigned int i = 0; i < cArgs;i++) 
+             {
+@@ -1082,7 +1082,7 @@ CordbType::SigToType(CordbModule * pModu
+                 IfFailRet(E_OUTOFMEMORY);
+             }
+ 
+-            CordbType ** ppTypeInstantiations = (CordbType **) _alloca( allocSize.Value() );
++            CordbType ** ppTypeInstantiations = (CordbType **) Alloca( allocSize.Value() );
+ 
+             for (unsigned int i = 0; i <= cArgs; i++) 
+             {
diff --git a/coreclr-git/patches/patch-src_debug_ee_dactable.cpp b/coreclr-git/patches/patch-src_debug_ee_dactable.cpp
new file mode 100644
index 0000000..697ba25
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_ee_dactable.cpp
@@ -0,0 +1,20 @@
+$NetBSD$
+
+--- src/debug/ee/dactable.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/ee/dactable.cpp
+@@ -69,13 +69,13 @@ void DacGlobals::InitializeEntries(TADDR
+ 
+ #define VPTR_CLASS(name) \
+     { \
+-        void *pBuf = _alloca(sizeof(name)); \
++        void *pBuf = Alloca(sizeof(name)); \
+         name *dummy = new (pBuf) name(0); \
+         name##__vtAddr = PTR_TO_TADDR(*((PVOID*)dummy)) - baseAddress; \
+     }
+ #define VPTR_MULTI_CLASS(name, keyBase) \
+     { \
+-        void *pBuf = _alloca(sizeof(name)); \
++        void *pBuf = Alloca(sizeof(name)); \
+         name *dummy = new (pBuf) name(0); \
+         name##__##keyBase##__mvtAddr = PTR_TO_TADDR(*((PVOID*)dummy)) - baseAddress; \
+     }
diff --git a/coreclr-git/patches/patch-src_debug_ee_debugger.cpp b/coreclr-git/patches/patch-src_debug_ee_debugger.cpp
new file mode 100644
index 0000000..dedecb7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_ee_debugger.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/debug/ee/debugger.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/ee/debugger.cpp
+@@ -12341,7 +12341,7 @@ TypeHandle Debugger::TypeDataWalk::ReadI
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    TypeHandle * inst = (TypeHandle *) _alloca(dwAllocSize);
++    TypeHandle * inst = (TypeHandle *) Alloca(dwAllocSize);
+     ReadTypeHandles(nTypeArgs, inst) ;
+     TypeHandle th = g_pEEInterface->LoadInstantiation(pModule, tok, nTypeArgs, inst);
+     if (th.IsNull())
+@@ -12408,7 +12408,7 @@ TypeHandle Debugger::TypeDataWalk::ReadT
+                 _ASSERTE(COR_E_OVERFLOW);
+                 cbAllocSize = UINT_MAX;
+             }
+-            TypeHandle * inst = (TypeHandle *) _alloca(cbAllocSize);
++            TypeHandle * inst = (TypeHandle *) Alloca(cbAllocSize);
+             ReadTypeHandles(data->numTypeArgs, inst) ;
+             th = g_pEEInterface->LoadFnptrType(inst, data->numTypeArgs);
+             break;
diff --git a/coreclr-git/patches/patch-src_debug_ee_funceval.cpp b/coreclr-git/patches/patch-src_debug_ee_funceval.cpp
new file mode 100644
index 0000000..63daece
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_ee_funceval.cpp
@@ -0,0 +1,76 @@
+$NetBSD$
+
+--- src/debug/ee/funceval.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/ee/funceval.cpp
+@@ -1534,7 +1534,7 @@ void ResolveFuncEvalGenericArgInfo(Debug
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    TypeHandle * pGenericArgs = (nGenericArgs == 0) ? NULL : (TypeHandle *) _alloca(cbAllocSize);
++    TypeHandle * pGenericArgs = (nGenericArgs == 0) ? NULL : (TypeHandle *) Alloca(cbAllocSize);
+ 
+     //
+     // Snag the type arguments from the input and get the
+@@ -3203,7 +3203,7 @@ static void DoNormalFuncEval( DebuggerEv
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    FuncEvalArgInfo * pFEArgInfo = (FuncEvalArgInfo *)_alloca(cbAllocSize);
++    FuncEvalArgInfo * pFEArgInfo = (FuncEvalArgInfo *)Alloca(cbAllocSize);
+     memset(pFEArgInfo, 0, cbAllocSize);
+ 
+     GatherFuncEvalArgInfo(pDE, mSig, argData, pFEArgInfo);
+@@ -3275,7 +3275,7 @@ static void DoNormalFuncEval( DebuggerEv
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    ARG_SLOT * pArguments = (ARG_SLOT *)_alloca(cbAllocSize);
++    ARG_SLOT * pArguments = (ARG_SLOT *)Alloca(cbAllocSize);
+     memset(pArguments, 0, cbAllocSize);
+ 
+     LPVOID pRetBuff = NULL;
+@@ -3385,7 +3385,7 @@ static void GCProtectArgsAndDoNormalFunc
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    OBJECTREF * pObjectRefArray = (OBJECTREF*)_alloca(cbAllocSize);
++    OBJECTREF * pObjectRefArray = (OBJECTREF*)Alloca(cbAllocSize);
+     memset(pObjectRefArray, 0, cbAllocSize);
+     GCPROTECT_ARRAY_BEGIN(*pObjectRefArray, pDE->m_argCount);
+ 
+@@ -3398,7 +3398,7 @@ static void GCProtectArgsAndDoNormalFunc
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    void ** pMaybeInteriorPtrArray = (void **)_alloca(cbAllocSize);
++    void ** pMaybeInteriorPtrArray = (void **)Alloca(cbAllocSize);
+     memset(pMaybeInteriorPtrArray, 0, cbAllocSize);
+     GCPROTECT_BEGININTERIOR_ARRAY(*pMaybeInteriorPtrArray, (UINT)(cbAllocSize/sizeof(OBJECTREF)));
+ 
+@@ -3413,7 +3413,7 @@ static void GCProtectArgsAndDoNormalFunc
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    void ** pByRefMaybeInteriorPtrArray = (void **)_alloca(cbAllocSize);
++    void ** pByRefMaybeInteriorPtrArray = (void **)Alloca(cbAllocSize);
+     memset(pByRefMaybeInteriorPtrArray, 0, cbAllocSize);
+     GCPROTECT_BEGININTERIOR_ARRAY(*pByRefMaybeInteriorPtrArray, (UINT)(cbAllocSize/sizeof(OBJECTREF)));
+ 
+@@ -3426,7 +3426,7 @@ static void GCProtectArgsAndDoNormalFunc
+     {
+         ThrowHR(COR_E_OVERFLOW);
+     }
+-    INT64 *pBufferForArgsArray = (INT64*)_alloca(cbAllocSize);
++    INT64 *pBufferForArgsArray = (INT64*)Alloca(cbAllocSize);
+     memset(pBufferForArgsArray, 0, cbAllocSize);
+ 
+     FrameWithCookie<ProtectValueClassFrame> protectValueClassFrame;
+@@ -3539,7 +3539,7 @@ void FuncEvalHijackRealWorker(DebuggerEv
+         {
+             ThrowHR(COR_E_OVERFLOW);
+         }
+-        TypeHandle *pGenericArgs = (nGenericArgs == 0) ? NULL : (TypeHandle *) _alloca(cbAllocSize);
++        TypeHandle *pGenericArgs = (nGenericArgs == 0) ? NULL : (TypeHandle *) Alloca(cbAllocSize);
+         //
+         // Snag the type arguments from the input and get the
+         // method desc that corresponds to the instantiated desc.
diff --git a/coreclr-git/patches/patch-src_debug_ildbsymlib_symread.cpp b/coreclr-git/patches/patch-src_debug_ildbsymlib_symread.cpp
new file mode 100644
index 0000000..7d7dab4
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_ildbsymlib_symread.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/debug/ildbsymlib/symread.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/debug/ildbsymlib/symread.cpp
+@@ -241,7 +241,7 @@ HRESULT SymReader::InitializeFromStream(
+     // Make sure we're at the beginning of the stream
+     IfFailGo(pIStream->Seek(li, STREAM_SEEK_SET, NULL));
+ 
+-    IfNullGo(pSignature = (BYTE *)_alloca(ILDB_SIGNATURE_SIZE));
++    IfNullGo(pSignature = (BYTE *)Alloca(ILDB_SIGNATURE_SIZE));
+     IfFailGo(ReadFromStream(pIStream, pSignature, ILDB_SIGNATURE_SIZE));
+     
+     // Verify that we're looking at an ILDB File
diff --git a/coreclr-git/patches/patch-src_dlls_mscorpe_pewriter.cpp b/coreclr-git/patches/patch-src_dlls_mscorpe_pewriter.cpp
new file mode 100644
index 0000000..b245d7b
--- /dev/null
+++ b/coreclr-git/patches/patch-src_dlls_mscorpe_pewriter.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/dlls/mscorpe/pewriter.cpp.orig	2016-02-02 22:59:18.000000000 +0000
++++ src/dlls/mscorpe/pewriter.cpp
+@@ -1572,7 +1572,7 @@ HRESULT PEWriter::link() {
+     // First collect all information into entries[]
+ 
+     int sectCount = getSectCount();
+-    entry *entries = (entry *) _alloca(sizeof(entry) * sectCount);
++    entry *entries = (entry *) Alloca(sizeof(entry) * sectCount);
+ 
+     unsigned iUniqueSections, iEntries;
+     HRESULT hr;
+@@ -2279,7 +2279,7 @@ HRESULT PEWriter::write(void ** ppImage)
+ {
+     bool ExeOrDll = isExeOrDll(m_ntHeaders);
+     const unsigned RoundUpVal = VAL32(m_ntHeaders->OptionalHeader.FileAlignment);
+-    char *pad = (char *) _alloca(RoundUpVal);
++    char *pad = (char *) Alloca(RoundUpVal);
+     memset(pad, 0, RoundUpVal);
+ 
+     size_t lSize = filePos;
diff --git a/coreclr-git/patches/patch-src_ilasm_assembler.cpp b/coreclr-git/patches/patch-src_ilasm_assembler.cpp
new file mode 100644
index 0000000..71a8461
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ilasm_assembler.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/ilasm/assembler.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ilasm/assembler.cpp
+@@ -952,7 +952,7 @@ BOOL Assembler::EmitField(FieldDescripto
+             lVal /= sizeof(WCHAR);
+ 
+ #if defined(ALIGN_ACCESS) || BIGENDIAN
+-            void* pValueTemp = _alloca(lVal * sizeof(WCHAR));
++            void* pValueTemp = Alloca(lVal * sizeof(WCHAR));
+             memcpy(pValueTemp, pValue, lVal * sizeof(WCHAR));
+             pValue = pValueTemp;
+ 
diff --git a/coreclr-git/patches/patch-src_inc_allocacheck.h b/coreclr-git/patches/patch-src_inc_allocacheck.h
new file mode 100644
index 0000000..37ed792
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_allocacheck.h
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- src/inc/allocacheck.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/allocacheck.h
+@@ -72,12 +72,12 @@ private:
+ };
+ 
+ #define ALLOCA_CHECK() AllocaCheck __allocaChecker
+-#define ALLOCA(size)  __allocaChecker.add(_alloca(size+sizeof(AllocaCheck::AllocaSentinal)), size);
++#define ALLOCA(size)  __allocaChecker.add(Alloca(size+sizeof(AllocaCheck::AllocaSentinal)), size);
+ 
+ #else
+ 
+ #define ALLOCA_CHECK() 
+-#define ALLOCA(size)  _alloca(size)
++#define ALLOCA(size)  Alloca(size)
+ 
+ #endif
+ 	
diff --git a/coreclr-git/patches/patch-src_inc_corperme.h b/coreclr-git/patches/patch-src_inc_corperme.h
new file mode 100644
index 0000000..f875a4c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_corperme.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/inc/corperme.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/corperme.h
+@@ -38,14 +38,14 @@ extern "C" {
+ #define WIDEN(psz, pwsz) \
+     LPCSTR _##psz = (LPCSTR) psz; \
+     int _cc##psz = _##psz ? strlen(_##psz) + 1 : 0; \
+-    LPWSTR pwsz = (LPWSTR) (_cc##psz ? _alloca((_cc##psz) * sizeof(WCHAR)) : NULL); \
++    LPWSTR pwsz = (LPWSTR) (_cc##psz ? Alloca((_cc##psz) * sizeof(WCHAR)) : NULL); \
+     if(pwsz) WszMultiByteToWideChar(WIDEN_CP, 0, _##psz, _cc##psz, pwsz, _cc##psz);
+ 
+ 
+ #define NARROW(pwsz, psz) \
+     LPCWSTR _##pwsz = (LPCWSTR) pwsz; \
+     int _cc##psz =  _##pwsz ? WszWideCharToMultiByte(WIDEN_CP, 0, _##pwsz, -1, NULL, 0, NULL, NULL) : 0; \
+-    LPSTR psz = (LPSTR) (_cc##psz ? _alloca(_cc##psz) : NULL); \
++    LPSTR psz = (LPSTR) (_cc##psz ? Alloca(_cc##psz) : NULL); \
+     if(psz) WszWideCharToMultiByte(WIDEN_CP, 0, _##pwsz, -1, psz, _cc##psz, NULL, NULL);
+ 
+ 
diff --git a/coreclr-git/patches/patch-src_inc_daccess.h b/coreclr-git/patches/patch-src_inc_daccess.h
new file mode 100644
index 0000000..df0111c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_daccess.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/inc/daccess.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/daccess.h
+@@ -1820,7 +1820,7 @@ typedef __VoidPtr PTR_CVOID;
+ #define VPTR_ANY_CLASS_METHODS(name)                            \
+         virtual ULONG32 VPtrSize(void) { SUPPORTS_DAC; return sizeof(name); } \
+         static PVOID VPtrHostVTable() {                         \
+-            void * pBuf = _alloca(sizeof(name));                \
++            void * pBuf = Alloca(sizeof(name));                \
+             name * dummy = new (pBuf) name((TADDR)0, (TADDR)0); \
+             return *((PVOID*)dummy); }
+ 
diff --git a/coreclr-git/patches/patch-src_inc_formattype.cpp b/coreclr-git/patches/patch-src_inc_formattype.cpp
new file mode 100644
index 0000000..e5ca557
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_formattype.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/inc/formattype.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/formattype.cpp
+@@ -564,7 +564,7 @@ PCCOR_SIGNATURE PrettyPrintType(
+ #pragma prefast(push)
+ #pragma prefast(disable:22009 "Suppress PREFAST warnings about integer overflow")
+ #endif
+-                    int* lowerBounds = (int*) _alloca(sizeof(int)*2*rank);
++                    int* lowerBounds = (int*) Alloca(sizeof(int)*2*rank);
+                     int* sizes       = &lowerBounds[rank];  
+                     memset(lowerBounds, 0, sizeof(int)*2*rank); 
+                     
+@@ -1204,7 +1204,7 @@ char* DumpMarshaling(IMDInternalImport* 
+ #pragma prefast(push)
+ #pragma prefast(disable:22009 "Suppress PREFAST warnings about integer overflow")
+ #endif
+-                            strTemp = (LPUTF8)_alloca(strLen + 1);
++                            strTemp = (LPUTF8)Alloca(strLen + 1);
+                             memcpy(strTemp, (LPUTF8)&pSigNativeType[cbCur], strLen);
+                             strTemp[strLen] = 0;
+                             buf.AppendPrintf(", \"%s\"", UnquotedProperName(strTemp));
diff --git a/coreclr-git/patches/patch-src_inc_formattype.h b/coreclr-git/patches/patch-src_inc_formattype.h
new file mode 100644
index 0000000..185eef7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_formattype.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/inc/formattype.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/formattype.h
+@@ -105,7 +105,7 @@ inline BOOL IsDup(mdToken tk)
+     }
+     return FALSE;
+ }
+-#define MAKE_NAME_IF_NONE(psz, tk) { if((!(psz && *psz))||IsDup(tk)) { char* sz = (char*)_alloca(16); \
++#define MAKE_NAME_IF_NONE(psz, tk) { if((!(psz && *psz))||IsDup(tk)) { char* sz = (char*)Alloca(16); \
+ sprintf_s(sz,16,"$%s$%X",szStdNamePrefix[tk>>24],tk&0x00FFFFFF); psz = sz; } }
+ 
+ 
diff --git a/coreclr-git/patches/patch-src_inc_nsutilpriv.h b/coreclr-git/patches/patch-src_inc_nsutilpriv.h
new file mode 100644
index 0000000..8b0e7ba
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_nsutilpriv.h
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/inc/nsutilpriv.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/nsutilpriv.h
+@@ -223,14 +223,14 @@ void MakeNestedTypeName(                
+ #define MAKE_FULL_PATH_ON_STACK_UTF8(toptr, pnamespace, pname) \
+ { \
+     int __i##toptr = ns::GetFullLength(pnamespace, pname); \
+-    toptr = (char *) alloca(__i##toptr); \
++    toptr = (char *) Alloca(__i##toptr); \
+     ns::MakePath(toptr, __i##toptr, pnamespace, pname); \
+ }
+ 
+ #define MAKE_FULL_PATH_ON_STACK_UNICODE(toptr, pnamespace, pname) \
+ { \
+     int __i##toptr = ns::GetFullLength(pnamespace, pname); \
+-    toptr = (WCHAR *) alloca(__i##toptr * sizeof(WCHAR)); \
++    toptr = (WCHAR *) Alloca(__i##toptr * sizeof(WCHAR)); \
+     ns::MakePath(toptr, __i##toptr, pnamespace, pname); \
+ }
+ 
+@@ -242,7 +242,7 @@ void MakeNestedTypeName(                
+     __i##ptr += (pszMemberName ? (int) strlen(pszMemberName) : 0); \
+     __i##ptr += (NAMESPACE_SEPARATOR_LEN * 2); \
+     __i##ptr += (pszSig ? (int) strlen(pszSig) : 0); \
+-    ptr = (LPUTF8) alloca(__i##ptr); \
++    ptr = (LPUTF8) Alloca(__i##ptr); \
+     ns::MakePath(ptr, __i##ptr, pszNameSpace, pszClassName); \
+     if (pszMemberName) { \
+         strcat_s(ptr, __i##ptr, NAMESPACE_SEPARATOR_STR); \
diff --git a/coreclr-git/patches/patch-src_inc_winwrap.h b/coreclr-git/patches/patch-src_inc_winwrap.h
new file mode 100644
index 0000000..c411160
--- /dev/null
+++ b/coreclr-git/patches/patch-src_inc_winwrap.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- src/inc/winwrap.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/inc/winwrap.h
+@@ -1013,11 +1013,11 @@ inline int LateboundMessageBoxA(HWND hWn
+         lpCaption = "<null>";
+ 
+     SIZE_T cchText = strlen(lpText) + 1;
+-    LPWSTR wszText = (LPWSTR)_alloca(cchText * sizeof(WCHAR));
++    LPWSTR wszText = (LPWSTR)Alloca(cchText * sizeof(WCHAR));
+     swprintf_s(wszText, cchText, W("%S"), lpText);
+ 
+     SIZE_T cchCaption = strlen(lpCaption) + 1;
+-    LPWSTR wszCaption = (LPWSTR)_alloca(cchCaption * sizeof(WCHAR));
++    LPWSTR wszCaption = (LPWSTR)Alloca(cchCaption * sizeof(WCHAR));
+     swprintf_s(wszCaption, cchCaption, W("%S"), lpCaption);
+ 
+     return LateboundMessageBoxW(hWnd, wszText, wszCaption, uType);
diff --git a/coreclr-git/patches/patch-src_jit_compiler.cpp b/coreclr-git/patches/patch-src_jit_compiler.cpp
new file mode 100644
index 0000000..e97ca3c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_compiler.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/jit/compiler.cpp.orig	2016-02-13 00:18:27.000000000 +0000
++++ src/jit/compiler.cpp
+@@ -6974,7 +6974,7 @@ void dumpConvertedVarSet(Compiler* comp,
+     BYTE* pVarNumSet;   // trivial set: one byte per varNum, 0 means not in set, 1 means in set.
+ 
+     size_t varNumSetBytes = comp->lvaCount * sizeof(BYTE);
+-    pVarNumSet = (BYTE*)_alloca(varNumSetBytes);
++    pVarNumSet = (BYTE*)Alloca(varNumSetBytes);
+     memset(pVarNumSet, 0, varNumSetBytes);          // empty the set
+ 
+     VARSET_ITER_INIT(comp, iter, vars, varIndex);
diff --git a/coreclr-git/patches/patch-src_jit_error.cpp b/coreclr-git/patches/patch-src_jit_error.cpp
new file mode 100644
index 0000000..4f572e7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_error.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/jit/error.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/jit/error.cpp
+@@ -293,7 +293,7 @@ void  __cdecl   assertAbort(const char *
+     const char* msg = why;
+     LogEnv* env = LogEnv::cur();
+     const int BUFF_SIZE = 8192;
+-    char *buff = (char*)alloca(BUFF_SIZE);
++    char *buff = (char*)Alloca(BUFF_SIZE);
+     if (env->compiler) {
+         _snprintf_s(buff, BUFF_SIZE, _TRUNCATE, "Assertion failed '%s' in '%s' (IL size %d)\n", why, env->compiler->info.compFullName, env->compiler->info.compILCodeSize);
+         msg = buff;
diff --git a/coreclr-git/patches/patch-src_jit_flowgraph.cpp b/coreclr-git/patches/patch-src_jit_flowgraph.cpp
new file mode 100644
index 0000000..f3477ce
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_flowgraph.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/jit/flowgraph.cpp.orig	2016-02-09 22:37:14.000000000 +0000
++++ src/jit/flowgraph.cpp
+@@ -19235,7 +19235,7 @@ ONE_FILE_PER_METHOD:;
+         {
+             wCharCount += wcslen(pathname) + 1;
+         }
+-        filename = (LPCWSTR) alloca(wCharCount * sizeof(WCHAR));
++        filename = (LPCWSTR) Alloca(wCharCount * sizeof(WCHAR));
+         if (pathname != NULL)
+         {
+             swprintf_s((LPWSTR)filename, wCharCount, W("%s\\%S-%s.%s"), pathname, escapedString, phaseName, type);
+@@ -19297,7 +19297,7 @@ ONE_FILE_PER_METHOD:;
+         {
+             wCharCount += wcslen(pathname) + 1;
+         }
+-        filename = (LPCWSTR) alloca(wCharCount * sizeof(WCHAR));
++        filename = (LPCWSTR) Alloca(wCharCount * sizeof(WCHAR));
+         if (pathname != NULL)
+         {
+             swprintf_s((LPWSTR)filename, wCharCount, W("%s\\%s.%s"), pathname, origFilename, type);
diff --git a/coreclr-git/patches/patch-src_jit_gentree.cpp b/coreclr-git/patches/patch-src_jit_gentree.cpp
new file mode 100644
index 0000000..774d343
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_gentree.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/jit/gentree.cpp.orig	2016-02-03 00:16:44.000000000 +0000
++++ src/jit/gentree.cpp
+@@ -4776,7 +4776,7 @@ GenTree::VtablePtr GenTree::GetVtableFor
+                 assert(!IsExOp(opKind));
+                 assert(OperIsSimple(oper) || OperIsLeaf(oper));
+                 // Need to provide non-null operands.
+-                Compiler* comp = (Compiler*)_alloca(sizeof(Compiler));
++                Compiler* comp = (Compiler*)Alloca(sizeof(Compiler));
+                 GenTreeIntCon dummyOp(TYP_INT, 0);
+                 GenTreeOp gt(oper, TYP_INT, &dummyOp, ((opKind & GTK_UNOP) ? NULL : &dummyOp));
+                 s_vtableForOp = *reinterpret_cast<VtablePtr*>(&gt);
diff --git a/coreclr-git/patches/patch-src_jit_gtlist.h b/coreclr-git/patches/patch-src_jit_gtlist.h
new file mode 100644
index 0000000..21479ec
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_gtlist.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/jit/gtlist.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/jit/gtlist.h
+@@ -64,7 +64,7 @@ GTNODE(MEMORYBARRIER    , "memoryBarrier
+ 
+ GTNODE(CAST             , "cast"          ,0,GTK_UNOP|GTK_EXOP) // conversion to another type
+ GTNODE(CKFINITE         , "ckfinite"      ,0,GTK_UNOP)          // Check for NaN
+-GTNODE(LCLHEAP          , "lclHeap"       ,0,GTK_UNOP)          // alloca()
++GTNODE(LCLHEAP          , "lclHeap"       ,0,GTK_UNOP)          // Alloca()
+ GTNODE(JMP              , "jump"          ,0,GTK_LEAF)          // Jump to another function
+ 
+ 
diff --git a/coreclr-git/patches/patch-src_jit_hashbv.cpp b/coreclr-git/patches/patch-src_jit_hashbv.cpp
new file mode 100644
index 0000000..6ad1dc6
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_hashbv.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/jit/hashbv.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/jit/hashbv.cpp
+@@ -530,7 +530,7 @@ void hashBv::Resize(int newSize)
+ 
+     hashBvNode ** newNodes = this->getNewVector(newSize);
+ 
+-    hashBvNode *** insertionPoints = (hashBvNode ***) alloca(sizeof(hashBvNode *)* newSize);
++    hashBvNode *** insertionPoints = (hashBvNode ***) Alloca(sizeof(hashBvNode *)* newSize);
+     memset(insertionPoints, 0, sizeof(hashBvNode *)* newSize);
+ 
+     for (int i=0; i<newSize; i++)
+@@ -1223,7 +1223,7 @@ template <typename Action> bool hashBv::
+     hashBvNode *** cursors;
+     int shiftFactor = this->log2_hashSize - other->log2_hashSize;
+     int expansionFactor = hts/ots;
+-    cursors = (hashBvNode ***) alloca(expansionFactor*sizeof(void*));
++    cursors = (hashBvNode ***) Alloca(expansionFactor*sizeof(void*));
+ 
+     for (int h=0; h<other->hashtable_size(); h++)
+     {
diff --git a/coreclr-git/patches/patch-src_jit_importer.cpp b/coreclr-git/patches/patch-src_jit_importer.cpp
new file mode 100644
index 0000000..07af7ca
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_importer.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/jit/importer.cpp.orig	2016-02-12 01:41:34.000000000 +0000
++++ src/jit/importer.cpp
+@@ -8470,7 +8470,7 @@ GenTreePtr Compiler::impCastClassOrIsIns
+ #define assertImp(cond)                                                        \
+             do { if (!(cond)) {                                                \
+                 const int cchAssertImpBuf = 600;                               \
+-                char *assertImpBuf = (char*)alloca(cchAssertImpBuf);           \
++                char *assertImpBuf = (char*)Alloca(cchAssertImpBuf);           \
+                 _snprintf_s(assertImpBuf, cchAssertImpBuf, cchAssertImpBuf - 1,\
+                         "%s : Possibly bad IL with CEE_%s at offset %04Xh (op1=%s op2=%s stkDepth=%d)", \
+                         #cond, impCurOpcName, impCurOpcOffs,                   \
diff --git a/coreclr-git/patches/patch-src_jit_jiteh.cpp b/coreclr-git/patches/patch-src_jit_jiteh.cpp
new file mode 100644
index 0000000..0c87845
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_jiteh.cpp
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- src/jit/jiteh.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/jit/jiteh.cpp
+@@ -3032,7 +3032,7 @@ void                Compiler::fgVerifyHa
+ 
+     // blockNumMap[old block number] => new block number
+     size_t blockNumBytes = (bbNumMax + 1) * sizeof(unsigned);
+-    unsigned* blockNumMap = (unsigned*)_alloca(blockNumBytes);
++    unsigned* blockNumMap = (unsigned*)Alloca(blockNumBytes);
+     memset(blockNumMap, 0, blockNumBytes);
+ 
+     BasicBlock* block;
+@@ -3069,8 +3069,8 @@ void                Compiler::fgVerifyHa
+     // over all blocks and verify that only handler begin blocks have bbCatchTyp == BBCT_NONE, and some other things.
+ 
+     size_t blockBoolSetBytes = (bbNumMax + 1) * sizeof(bool);
+-    bool* blockTryBegSet = (bool*)_alloca(blockBoolSetBytes);
+-    bool* blockHndBegSet = (bool*)_alloca(blockBoolSetBytes);
++    bool* blockTryBegSet = (bool*)Alloca(blockBoolSetBytes);
++    bool* blockHndBegSet = (bool*)Alloca(blockBoolSetBytes);
+     for (unsigned i = 0; i <= bbNumMax; i++)
+     {
+         blockTryBegSet[i] = false;
+@@ -3390,8 +3390,8 @@ void                Compiler::fgVerifyHa
+     // a previously processed handler, so we ignore it.
+ 
+     size_t blockIndexBytes = (bbNumMax + 1) * sizeof(unsigned short);
+-    unsigned short* blockTryIndex = (unsigned short*)_alloca(blockIndexBytes);
+-    unsigned short* blockHndIndex = (unsigned short*)_alloca(blockIndexBytes);
++    unsigned short* blockTryIndex = (unsigned short*)Alloca(blockIndexBytes);
++    unsigned short* blockHndIndex = (unsigned short*)Alloca(blockIndexBytes);
+     memset(blockTryIndex, 0, blockIndexBytes);
+     memset(blockHndIndex, 0, blockIndexBytes);
+ 
diff --git a/coreclr-git/patches/patch-src_jit_rationalize.cpp b/coreclr-git/patches/patch-src_jit_rationalize.cpp
new file mode 100644
index 0000000..289be53
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_rationalize.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- src/jit/rationalize.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/jit/rationalize.cpp
+@@ -566,8 +566,8 @@ void Rationalizer::RenameUpdatedVars(Loc
+     rename->ZeroAll();
+     unexp->ZeroAll();
+     
+-    int *renameMap = (int *) alloca(sizeof(int) * comp->lvaCount);
+-    var_types *renameTypeMap = (var_types *) alloca(sizeof(var_types) * comp->lvaCount);
++    int *renameMap = (int *) Alloca(sizeof(int) * comp->lvaCount);
++    var_types *renameTypeMap = (var_types *) Alloca(sizeof(var_types) * comp->lvaCount);
+ 
+     // find locals that are redefined within the tree
+     foreach_treenode_execution_order(tree, statement)
diff --git a/coreclr-git/patches/patch-src_jit_ssabuilder.cpp b/coreclr-git/patches/patch-src_jit_ssabuilder.cpp
new file mode 100644
index 0000000..dd2a913
--- /dev/null
+++ b/coreclr-git/patches/patch-src_jit_ssabuilder.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/jit/ssabuilder.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/jit/ssabuilder.cpp
+@@ -224,7 +224,7 @@ SsaBuilder::SsaBuilder(Compiler* pCompil
+ int SsaBuilder::TopologicalSort(BasicBlock** postOrder, int count)
+ {
+     // Allocate and initialize visited flags.
+-    bool* visited = (bool*) alloca(count * sizeof(bool));
++    bool* visited = (bool*) Alloca(count * sizeof(bool));
+     memset(visited, 0, count * sizeof(bool));
+ 
+     // Display basic blocks.
+@@ -1626,7 +1626,7 @@ void SsaBuilder::Build()
+     JITDUMP("[SsaBuilder] Max block count is %d.\n", blockCount);
+ 
+     // Allocate the postOrder array for the graph.
+-    BasicBlock** postOrder = (BasicBlock**) alloca(blockCount * sizeof(BasicBlock*));
++    BasicBlock** postOrder = (BasicBlock**) Alloca(blockCount * sizeof(BasicBlock*));
+ 
+     // Topologically sort the graph.
+     int count = TopologicalSort(postOrder, blockCount);
diff --git a/coreclr-git/patches/patch-src_md_compiler_custattr__import.cpp b/coreclr-git/patches/patch-src_md_compiler_custattr__import.cpp
new file mode 100644
index 0000000..2518758
--- /dev/null
+++ b/coreclr-git/patches/patch-src_md_compiler_custattr__import.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/md/compiler/custattr_import.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/md/compiler/custattr_import.cpp
+@@ -77,7 +77,7 @@ STDMETHODIMP RegMeta::GetCustomAttribute
+     pMiniMd = &(m_pStgdb->m_MiniMd);
+ 
+     iLen = WszWideCharToMultiByte(CP_UTF8,0, wzName,-1, NULL,0, 0,0);
+-    szName = (LPUTF8)_alloca(iLen);
++    szName = (LPUTF8)Alloca(iLen);
+     VERIFY(WszWideCharToMultiByte(CP_UTF8,0, wzName,-1, szName,iLen, 0,0));
+ 
+     hr = ImportHelper::GetCustomAttributeByName(pMiniMd, tkObj, szName, ppData, pcbData);
diff --git a/coreclr-git/patches/patch-src_md_compiler_regmeta__emit.cpp b/coreclr-git/patches/patch-src_md_compiler_regmeta__emit.cpp
new file mode 100644
index 0000000..c618bb0
--- /dev/null
+++ b/coreclr-git/patches/patch-src_md_compiler_regmeta__emit.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/md/compiler/regmeta_emit.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/md/compiler/regmeta_emit.cpp
+@@ -1689,7 +1689,7 @@ HRESULT RegMeta::_DefineSetConstant(    
+         {
+ #if BIGENDIAN
+             void *pValueTemp;
+-            pValueTemp = (void *)alloca(cbBlob);
++            pValueTemp = (void *)Alloca(cbBlob);
+             IfFailGo(m_pStgdb->m_MiniMd.SwapConstant(pValue, dwCPlusTypeFlag, pValueTemp, cbBlob));
+             pValue = pValueTemp;
+ #endif
diff --git a/coreclr-git/patches/patch-src_md_enc_imptlb.cpp b/coreclr-git/patches/patch-src_md_enc_imptlb.cpp
new file mode 100644
index 0000000..6fc6073
--- /dev/null
+++ b/coreclr-git/patches/patch-src_md_enc_imptlb.cpp
@@ -0,0 +1,49 @@
+$NetBSD$
+
+--- src/md/enc/imptlb.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/md/enc/imptlb.cpp
+@@ -703,7 +703,7 @@ HRESULT CImportTlb::GetAttrType(
+ 
+                 // Build the sig.
+                 dwMaxSigSize = 5 + sizeof(mdTypeRef) * 2;
+-                pSig = (COR_SIGNATURE*)_alloca(dwMaxSigSize);
++                pSig = (COR_SIGNATURE*)Alloca(dwMaxSigSize);
+                 pCurr = pSig;
+                 *pCurr++ = IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS;
+                 *pCurr++ = 2;
+@@ -728,7 +728,7 @@ HRESULT CImportTlb::GetAttrType(
+ 
+                 // Build the sig.
+                 dwMaxSigSize = 4 + sizeof(mdTypeRef);
+-                pSig = (COR_SIGNATURE*)_alloca(dwMaxSigSize);
++                pSig = (COR_SIGNATURE*)Alloca(dwMaxSigSize);
+                 pCurr = pSig;
+                 *pCurr++ = IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS;
+                 *pCurr++ = 1;
+@@ -3301,7 +3301,7 @@ HRESULT CImportTlb::_ConvFunction(
+ 
+     //-------------------------------------------------------------------------
+     // Get the parameter names.
+-    rszParamNames = reinterpret_cast<BSTR*>(_alloca((psFunc->cParams+1) * sizeof(BSTR*)));
++    rszParamNames = reinterpret_cast<BSTR*>(Alloca((psFunc->cParams+1) * sizeof(BSTR*)));
+ 
+     // Get list of names.
+     IfFailGo(pITI->GetNames(psFunc->memid, rszParamNames, psFunc->cParams+1, &iNames));
+@@ -6149,7 +6149,7 @@ HRESULT CImportTlb::_ConvSignature(     
+                     {
+                         // Convert the UTF8 string to unicode.
+                         int MngTypeNameStrLen = (int)(strlen(pConvertionInfo->m_strMngTypeName) + 1);
+-                        WCHAR *strFullyQualifiedMngTypeName = (WCHAR *)_alloca(MngTypeNameStrLen * sizeof(WCHAR));
++                        WCHAR *strFullyQualifiedMngTypeName = (WCHAR *)Alloca(MngTypeNameStrLen * sizeof(WCHAR));
+                         int ret = WszMultiByteToWideChar(CP_UTF8, 0, pConvertionInfo->m_strMngTypeName, MngTypeNameStrLen, strFullyQualifiedMngTypeName, MngTypeNameStrLen);
+                         _ASSERTE(ret != 0);
+                         if (!ret)
+@@ -6184,7 +6184,7 @@ HRESULT CImportTlb::_ConvSignature(     
+         {
+             // Convert the UTF8 string to unicode.
+             int MngTypeNameStrLen = (int)(strlen(pConvertionInfo->m_strMngTypeName) + 1);
+-            WCHAR *strFullyQualifiedMngTypeName = (WCHAR *)_alloca(MngTypeNameStrLen * sizeof(WCHAR));
++            WCHAR *strFullyQualifiedMngTypeName = (WCHAR *)Alloca(MngTypeNameStrLen * sizeof(WCHAR));
+             int ret = WszMultiByteToWideChar(CP_UTF8, 0, pConvertionInfo->m_strMngTypeName, MngTypeNameStrLen, strFullyQualifiedMngTypeName, MngTypeNameStrLen);
+             _ASSERTE(ret != 0);
+             if (!ret)
diff --git a/coreclr-git/patches/patch-src_md_enc_metamodelrw.cpp b/coreclr-git/patches/patch-src_md_enc_metamodelrw.cpp
new file mode 100644
index 0000000..8e805d7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_md_enc_metamodelrw.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/md/enc/metamodelrw.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/md/enc/metamodelrw.cpp
+@@ -5968,7 +5968,7 @@ CMiniMdRW::FixParamSequence(
+             IfFailRet(GetParamPtrRecord(endRid - 1, &pNewParamPtr));
+         }
+         int cbCopy = m_TableDefs[TBL_ParamPtr].m_cbRec;
+-        void * pbBackup = _alloca(cbCopy);
++        void * pbBackup = Alloca(cbCopy);
+         memcpy(pbBackup, pNewParamPtr, cbCopy);
+         
+         IfFailRet(getEndParamListOfMethod(md, &endRid));
diff --git a/coreclr-git/patches/patch-src_md_enc_stgio.cpp b/coreclr-git/patches/patch-src_md_enc_stgio.cpp
new file mode 100644
index 0000000..7b552dc
--- /dev/null
+++ b/coreclr-git/patches/patch-src_md_enc_stgio.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/md/enc/stgio.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/md/enc/stgio.cpp
+@@ -1305,7 +1305,7 @@ HRESULT StgIO::CopyFileInternal(        
+     DWORD       cbRead;                 // Byte count for buffer.
+     DWORD       cbWrite;                // Check write of bytes.
+     const DWORD cbBuff = 4096;          // Size of buffer for copy (in bytes).
+-    BYTE       *pBuff = (BYTE*)alloca(cbBuff); // Buffer for copy.
++    BYTE       *pBuff = (BYTE*)Alloca(cbBuff); // Buffer for copy.
+     HANDLE      hFile;                  // Target file.
+     HRESULT     hr = S_OK;
+ 
diff --git a/coreclr-git/patches/patch-src_md_inc_rwutil.h b/coreclr-git/patches/patch-src_md_inc_rwutil.h
new file mode 100644
index 0000000..6fbb7a7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_md_inc_rwutil.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/md/inc/rwutil.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/md/inc/rwutil.h
+@@ -23,7 +23,7 @@ class UTSemReadWrite;
+         else                                                \
+         {                                                   \
+             int cbBuffer = ((int)wcslen(wszInput) * 3) + 1; \
+-            (szOutput) = (char *)_alloca(cbBuffer);         \
++            (szOutput) = (char *)Alloca(cbBuffer);         \
+             Unicode2UTF((wszInput), (szOutput), cbBuffer);  \
+         }                                                   \
+     } while (0)
diff --git a/coreclr-git/patches/patch-src_pal_inc_pal.h b/coreclr-git/patches/patch-src_pal_inc_pal.h
new file mode 100644
index 0000000..1078000
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_inc_pal.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- src/pal/inc/pal.h.orig	2016-02-15 22:52:17.000000000 +0000
++++ src/pal/inc/pal.h
+@@ -6330,23 +6330,14 @@ PALIMPORT void * __cdecl realloc(void *,
+ PALIMPORT char * __cdecl _strdup(const char *);
+ 
+ #if defined(_MSC_VER)
+-#define alloca _alloca
+-#elif defined(PLATFORM_UNIX)
+-#define _alloca alloca
++#define Alloca _alloca
++#elif defined(__GNUC__) /* GCC-compatbile */
++// Use explicitly alloca(3) as __builtin_alloca to more strongly prevent reuse
++// of a libc version. This was required on NetBSD.
++#define Alloca __builtin_alloca
+ #else
+-// MingW
+-#define _alloca __builtin_alloca
+-#define alloca __builtin_alloca
+-#endif //_MSC_VER
+-
+-#if defined(__GNUC__) && defined(PLATFORM_UNIX)
+-// we set -fno-builtin on the command line. This requires that if
+-// we use alloca, with either have to call __builtin_alloca, or
+-// ensure that the alloca call doesn't happen in code which is
+-// modifying the stack (such as "memset (alloca(x), y, z)"
+-
+-#define alloca  __builtin_alloca
+-#endif // __GNUC__
++#error Port me
++#endif
+ 
+ #define max(a, b) (((a) > (b)) ? (a) : (b))
+ #define min(a, b) (((a) < (b)) ? (a) : (b))
diff --git a/coreclr-git/patches/patch-src_pal_src_debug_debug.cpp b/coreclr-git/patches/patch-src_pal_src_debug_debug.cpp
new file mode 100644
index 0000000..44be30c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_debug_debug.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/pal/src/debug/debug.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/pal/src/debug/debug.cpp
+@@ -1340,7 +1340,7 @@ ReadProcessMemory(
+     lpBaseAddressAligned = (int*)((SIZE_T) lpBaseAddress & ~VIRTUAL_PAGE_MASK);
+     offset = ((SIZE_T) lpBaseAddress & VIRTUAL_PAGE_MASK);
+     char *data;
+-    data = (char*)alloca(VIRTUAL_PAGE_SIZE);
++    data = (char*)Alloca(VIRTUAL_PAGE_SIZE);
+     while (nSize > 0)
+     {
+         vm_size_t bytesRead;
diff --git a/coreclr-git/patches/patch-src_pal_src_file_directory.cpp b/coreclr-git/patches/patch-src_pal_src_file_directory.cpp
new file mode 100644
index 0000000..a008254
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_file_directory.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/pal/src/file/directory.cpp.orig	2016-02-13 00:18:27.000000000 +0000
++++ src/pal/src/file/directory.cpp
+@@ -600,7 +600,7 @@ CreateDirectoryA(
+ 
+         // Copy cwd, '/', path
+         int iLen = strlen(cwd) + 1 + pathLength + 1;
+-        realPath = static_cast<char *>(alloca(iLen));
++        realPath = static_cast<char *>(Alloca(iLen));
+         sprintf_s(realPath, iLen, "%s/%s", cwd, UnixPathName);
+ 
+         PAL_free((char *)cwd);
diff --git a/coreclr-git/patches/patch-src_pal_src_file_file.cpp b/coreclr-git/patches/patch-src_pal_src_file_file.cpp
new file mode 100644
index 0000000..ab7e26d
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_file_file.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/pal/src/file/file.cpp.orig	2016-02-06 02:05:27.000000000 +0000
++++ src/pal/src/file/file.cpp
+@@ -3943,7 +3943,7 @@ CopyFileA(
+     
+     LPSTR lpUnixPath = NULL;
+     const int    buffer_size = 16*1024;
+-    char        *buffer = (char*)alloca(buffer_size);
++    char        *buffer = (char*)Alloca(buffer_size);
+     DWORD        bytes_read;
+     DWORD        bytes_written;
+     int          permissions;
diff --git a/coreclr-git/patches/patch-src_pal_src_file_path.cpp b/coreclr-git/patches/patch-src_pal_src_file_path.cpp
new file mode 100644
index 0000000..7a74ec0
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_file_path.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/pal/src/file/path.cpp.orig	2016-02-13 00:18:27.000000000 +0000
++++ src/pal/src/file/path.cpp
+@@ -224,7 +224,7 @@ GetFullPathNameW(
+     }
+     else
+     {
+-        fileNameA = static_cast<LPSTR>(alloca(fileNameLength));
++        fileNameA = static_cast<LPSTR>(Alloca(fileNameLength));
+     }
+     
+     /* Now convert lpFileName to ANSI. */
diff --git a/coreclr-git/patches/patch-src_pal_src_loader_module.cpp b/coreclr-git/patches/patch-src_pal_src_loader_module.cpp
new file mode 100644
index 0000000..ffd884b
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_loader_module.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/pal/src/loader/module.cpp.orig	2016-02-13 00:18:27.000000000 +0000
++++ src/pal/src/loader/module.cpp
+@@ -315,7 +315,7 @@ GetProcAddress(
+     if (pal_module && module->dl_handle == pal_module->dl_handle)
+     {
+         int iLen = 4 + strlen(lpProcName) + 1;
+-        LPSTR lpPALProcName = (LPSTR) alloca(iLen);
++        LPSTR lpPALProcName = (LPSTR) Alloca(iLen);
+ 
+         if (strcpy_s(lpPALProcName, iLen, "PAL_") != SAFECRT_SUCCESS)
+         {
diff --git a/coreclr-git/patches/patch-src_pal_src_misc_dbgmsg.cpp b/coreclr-git/patches/patch-src_pal_src_misc_dbgmsg.cpp
new file mode 100644
index 0000000..020e24f
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_misc_dbgmsg.cpp
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- src/pal/src/misc/dbgmsg.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/pal/src/misc/dbgmsg.cpp
+@@ -475,7 +475,7 @@ Notes :
+ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
+                    LPCSTR function, LPCSTR file, INT line, LPCSTR format, ...)
+ {
+-    CHAR *buffer = (CHAR*)alloca(DBG_BUFFER_SIZE);
++    CHAR *buffer = (CHAR*)Alloca(DBG_BUFFER_SIZE);
+     CHAR indent[MAX_NESTING+1];
+     LPSTR buffer_ptr;
+     INT output_size;
+@@ -593,7 +593,7 @@ Notes :
+ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
+                    LPSTR file, INT line, LPSTR format, ...)
+ {
+-    CHAR *buffer = (CHAR*)alloca(DBG_BUFFER_SIZE);
++    CHAR *buffer = (CHAR*)Alloca(DBG_BUFFER_SIZE);
+     CHAR indent[MAX_NESTING+1];
+     LPSTR buffer_ptr;
+     INT output_size;
+@@ -941,7 +941,7 @@ void PAL_DisplayDialogFormatted(const ch
+     va_start(args, szTextFormat);
+ 
+     const int cchBuffer = 4096;
+-    char *szBuffer = (char*)alloca(cchBuffer);
++    char *szBuffer = (char*)Alloca(cchBuffer);
+     PAL__vsnprintf(szBuffer, cchBuffer, szTextFormat, args);
+     PAL_DisplayDialog(szTitle, szBuffer);
+ 
diff --git a/coreclr-git/patches/patch-src_pal_tests_palsuite_c__runtime___alloca_test1_test1.c b/coreclr-git/patches/patch-src_pal_tests_palsuite_c__runtime___alloca_test1_test1.c
new file mode 100644
index 0000000..d6dc235
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_tests_palsuite_c__runtime___alloca_test1_test1.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.c.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.c
+@@ -30,7 +30,7 @@ int __cdecl main(int argc, char **argv)
+ 
+ 
+     /* check that _alloca really gives us addressable memory */
+-    testA = (char *)_alloca(20 * sizeof(char));
++    testA = (char *)Alloca(20 * sizeof(char));
+     if (testA == NULL)
+     {
+         Fail ("The call to _alloca failed\n");
diff --git a/coreclr-git/patches/patch-src_tools_metainfo_mdinfo.cpp b/coreclr-git/patches/patch-src_tools_metainfo_mdinfo.cpp
new file mode 100644
index 0000000..d9e8c88
--- /dev/null
+++ b/coreclr-git/patches/patch-src_tools_metainfo_mdinfo.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/tools/metainfo/mdinfo.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/tools/metainfo/mdinfo.cpp
+@@ -3326,7 +3326,7 @@ HRESULT _FillVariant(
+             V_VT(pvar) = VT_BSTR;
+             WCHAR *TempString;;
+ #if BIGENDIAN
+-            TempString = (WCHAR *)alloca(cbValue);
++            TempString = (WCHAR *)Alloca(cbValue);
+             memcpy(TempString, pValue, cbValue);
+             SwapStringLength(TempString, cbValue/sizeof(WCHAR));
+ #else
diff --git a/coreclr-git/patches/patch-src_utilcode_genericstackprobe.cpp b/coreclr-git/patches/patch-src_utilcode_genericstackprobe.cpp
new file mode 100644
index 0000000..f384dc2
--- /dev/null
+++ b/coreclr-git/patches/patch-src_utilcode_genericstackprobe.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/utilcode/genericstackprobe.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/utilcode/genericstackprobe.cpp
+@@ -316,7 +316,7 @@ void BaseStackMarker::SetMarker(float nu
+     
+     // We might not have committed our stack yet, so allocate the number of pages
+     // we need so that they will be commited and we won't AV when we try to set the mark.
+-    _alloca( (int)(OS_PAGE_SIZE * m_numPages) );
++    Alloca( (int)(OS_PAGE_SIZE * m_numPages) );
+     m_pMarker = pMarker;
+     *m_pMarker = STACK_COOKIE_VALUE;
+ 
diff --git a/coreclr-git/patches/patch-src_utilcode_posterror.cpp b/coreclr-git/patches/patch-src_utilcode_posterror.cpp
new file mode 100644
index 0000000..6610527
--- /dev/null
+++ b/coreclr-git/patches/patch-src_utilcode_posterror.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/utilcode/posterror.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/utilcode/posterror.cpp
+@@ -341,7 +341,7 @@ HRESULT __cdecl PostErrorVA(            
+ #ifdef FEATURE_COMINTEROP        
+ 
+     const DWORD cchMsg = 4096;
+-    WCHAR      *rcMsg = (WCHAR*)alloca(cchMsg * sizeof(WCHAR));             // Error message.
++    WCHAR      *rcMsg = (WCHAR*)Alloca(cchMsg * sizeof(WCHAR));             // Error message.
+     HRESULT     hr;
+ 
+     BEGIN_ENTRYPOINT_NOTHROW;
diff --git a/coreclr-git/patches/patch-src_utilcode_prettyprintsig.cpp b/coreclr-git/patches/patch-src_utilcode_prettyprintsig.cpp
new file mode 100644
index 0000000..694d9f5
--- /dev/null
+++ b/coreclr-git/patches/patch-src_utilcode_prettyprintsig.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/utilcode/prettyprintsig.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/utilcode/prettyprintsig.cpp
+@@ -315,7 +315,7 @@ static PCCOR_SIGNATURE PrettyPrintType(
+             else 
+             {
+                 _ASSERTE(rank != 0);
+-                int* lowerBounds = (int*) _alloca(sizeof(int)*2*rank);
++                int* lowerBounds = (int*) Alloca(sizeof(int)*2*rank);
+                 int* sizes               = &lowerBounds[rank];
+                 memset(lowerBounds, 0, sizeof(int)*2*rank); 
+                 
+@@ -752,7 +752,7 @@ static HRESULT PrettyPrintTypeA(
+             else 
+             {
+                 _ASSERTE(rank != 0);
+-                int* lowerBounds = (int*) _alloca(sizeof(int)*2*rank);
++                int* lowerBounds = (int*) Alloca(sizeof(int)*2*rank);
+                 int* sizes       = &lowerBounds[rank];
+                 memset(lowerBounds, 0, sizeof(int)*2*rank); 
+                 
diff --git a/coreclr-git/patches/patch-src_utilcode_sxshelpers.cpp b/coreclr-git/patches/patch-src_utilcode_sxshelpers.cpp
new file mode 100644
index 0000000..149db0a
--- /dev/null
+++ b/coreclr-git/patches/patch-src_utilcode_sxshelpers.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/utilcode/sxshelpers.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/utilcode/sxshelpers.cpp
+@@ -1483,7 +1483,7 @@ HRESULT GetApplicationPathFromWin32Manif
+         if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) 
+         {
+            
+-            pInfo = (ACTIVATION_CONTEXT_DETAILED_INFORMATION*) alloca(nCount);
++            pInfo = (ACTIVATION_CONTEXT_DETAILED_INFORMATION*) Alloca(nCount);
+             
+             if (WszQueryActCtxW(0, hActCtx, NULL, ActivationContextDetailedInformation, 
+                                 pInfo, nCount, &nCount) &&
diff --git a/coreclr-git/patches/patch-src_vm_array.cpp b/coreclr-git/patches/patch-src_vm_array.cpp
new file mode 100644
index 0000000..76d857c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_array.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/array.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/array.cpp
+@@ -661,7 +661,7 @@ MethodTable* Module::CreateArrayMethodTa
+             SSIZE_T AllocSizeSeries;
+             if (!ClrSafeInt<SSIZE_T>::multiply(sizeof(CGCDescSeries*), nSeries, AllocSizeSeries))
+                 COMPlusThrowOM();
+-            CGCDescSeries** sortedSeries = (CGCDescSeries**) _alloca(AllocSizeSeries);
++            CGCDescSeries** sortedSeries = (CGCDescSeries**) Alloca(AllocSizeSeries);
+             int index;
+             for (index = 0; index < nSeries; index++)
+                 sortedSeries[index] = &pByValueSeries[-index];
+@@ -1278,7 +1278,7 @@ Stub *GenerateArrayOpStub(ArrayMethodDes
+ 
+     MethodTable *pMT = pMD->GetMethodTable();
+ 
+-    ArrayOpScript *paos = (ArrayOpScript*)_alloca(sizeof(ArrayOpScript) + sizeof(ArrayOpIndexSpec) * pMT->GetRank());
++    ArrayOpScript *paos = (ArrayOpScript*)Alloca(sizeof(ArrayOpScript) + sizeof(ArrayOpIndexSpec) * pMT->GetRank());
+ 
+     GenerateArrayOpScript(pMD, paos);
+ 
diff --git a/coreclr-git/patches/patch-src_vm_assemblyspec.cpp b/coreclr-git/patches/patch-src_vm_assemblyspec.cpp
new file mode 100644
index 0000000..2d29f6c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_assemblyspec.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/assemblyspec.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/assemblyspec.cpp
+@@ -1573,7 +1573,7 @@ HRESULT AssemblySpec::EmitToken(
+             AMD.cbLocale = MultiByteToWideChar(CP_UTF8, 0, m_context.szLocale, -1, NULL, 0);
+             if(AMD.cbLocale==0)
+                 IfFailGo(HRESULT_FROM_GetLastError());
+-            AMD.szLocale = (LPWSTR) alloca(AMD.cbLocale * sizeof(WCHAR) );
++            AMD.szLocale = (LPWSTR) Alloca(AMD.cbLocale * sizeof(WCHAR) );
+             if(MultiByteToWideChar(CP_UTF8, 0, m_context.szLocale, -1, AMD.szLocale, AMD.cbLocale)==0)
+                 IfFailGo(HRESULT_FROM_GetLastError());
+         }
diff --git a/coreclr-git/patches/patch-src_vm_baseassemblyspec.cpp b/coreclr-git/patches/patch-src_vm_baseassemblyspec.cpp
new file mode 100644
index 0000000..5e0c421
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_baseassemblyspec.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/baseassemblyspec.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/baseassemblyspec.cpp
+@@ -498,7 +498,7 @@ HRESULT BaseAssemblySpec::Init(IAssembly
+     hr = pName->GetProperty(ASM_NAME_CULTURE, NULL, &cbSize);
+     
+     if (hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) {
+-        LPWSTR pwName = (LPWSTR) alloca(cbSize);
++        LPWSTR pwName = (LPWSTR) Alloca(cbSize);
+         IfFailRet(pName->GetProperty(ASM_NAME_CULTURE, pwName, &cbSize));
+ 
+         hr = FString::ConvertUnicode_Utf8(pwName, & ((LPSTR &) m_context.szLocale));
diff --git a/coreclr-git/patches/patch-src_vm_baseassemblyspec.inl b/coreclr-git/patches/patch-src_vm_baseassemblyspec.inl
new file mode 100644
index 0000000..1e75c25
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_baseassemblyspec.inl
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/baseassemblyspec.inl.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/baseassemblyspec.inl
+@@ -559,7 +559,7 @@ inline HRESULT BaseAssemblySpec::Init(md
+                                             NULL));       // [OUT] Flags.
+ 
+         // Get the assembly name other naming properties
+-        wszAssemblyName = (LPWSTR)_alloca(cchName * sizeof(WCHAR));
++        wszAssemblyName = (LPWSTR)Alloca(cchName * sizeof(WCHAR));
+         IfFailRet(pImport->GetAssemblyProps(tkAssemblyRef,
+                                             (const void **)&m_pbPublicKeyOrToken,
+                                             &m_cbPublicKeyOrToken,
+@@ -585,7 +585,7 @@ inline HRESULT BaseAssemblySpec::Init(md
+                                             NULL));       // [OUT] Flags.
+ 
+         // Get the assembly name other naming properties
+-        wszAssemblyName = (LPWSTR)_alloca(cchName * sizeof(WCHAR));
++        wszAssemblyName = (LPWSTR)Alloca(cchName * sizeof(WCHAR));
+         IfFailRet(pImport->GetAssemblyRefProps(tkAssemblyRef,
+                                             (const void **)&m_pbPublicKeyOrToken,
+                                             &m_cbPublicKeyOrToken,
diff --git a/coreclr-git/patches/patch-src_vm_callhelpers.cpp b/coreclr-git/patches/patch-src_vm_callhelpers.cpp
new file mode 100644
index 0000000..d04cfe7
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_callhelpers.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/callhelpers.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/callhelpers.cpp
+@@ -473,7 +473,7 @@ ARG_SLOT MethodDescCallSite::CallTargetW
+         // Note that SizeOfFrameArgumentArray does overflow checks with sufficient margin to prevent overflows here
+         DWORD dwAllocaSize = TransitionBlock::GetNegSpaceSize() + sizeof(TransitionBlock) + nStackBytes;
+ 
+-        LPBYTE pAlloc = (LPBYTE)_alloca(dwAllocaSize);
++        LPBYTE pAlloc = (LPBYTE)Alloca(dwAllocaSize);
+ 
+         pTransitionBlock = pAlloc + TransitionBlock::GetNegSpaceSize();
+ 
diff --git a/coreclr-git/patches/patch-src_vm_ceeload.cpp b/coreclr-git/patches/patch-src_vm_ceeload.cpp
new file mode 100644
index 0000000..d3a9ad2
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_ceeload.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/ceeload.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/ceeload.cpp
+@@ -5203,7 +5203,7 @@ OBJECTHANDLE Module::ResolveStringRef(DW
+         #ifdef LOGGING 
+         int length = strData.GetCharCount();
+         length = min(length, 100);
+-        WCHAR *szString = (WCHAR *)_alloca((length + 1) * sizeof(WCHAR));
++        WCHAR *szString = (WCHAR *)Alloca((length + 1) * sizeof(WCHAR));
+         memcpyNoGCRefs((void*)szString, (void*)strData.GetStringBuffer(), length * sizeof(WCHAR));
+         szString[length] = '\0';
+         LOG((LF_APPDOMAIN, LL_INFO10000, "String literal \"%S\" won't be interned due to NoInterningAttribute\n", szString));
+@@ -9057,7 +9057,7 @@ MethodDesc* Module::LoadIBCMethodHelper(
+             if (!ClrSafeInt<SIZE_T>::multiply(nargs, sizeof(TypeHandle), cbMem/* passed by ref */))
+                 ThrowHR(COR_E_OVERFLOW);
+             
+-            TypeHandle * pInst = (TypeHandle*) _alloca(cbMem);
++            TypeHandle * pInst = (TypeHandle*) Alloca(cbMem);
+             SigTypeContext typeContext;   // empty type context
+ 
+             for (DWORD i = 0; i < nargs; i++)
diff --git a/coreclr-git/patches/patch-src_vm_class.cpp b/coreclr-git/patches/patch-src_vm_class.cpp
new file mode 100644
index 0000000..b530f0b
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_class.cpp
@@ -0,0 +1,32 @@
+$NetBSD$
+
+--- src/vm/class.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/class.cpp
+@@ -321,15 +321,15 @@ VOID EEClass::FixupFieldDescForEnC(Metho
+ 
+     MethodTableBuilder::bmtMetaDataInfo bmtMetaData;
+     bmtMetaData.cFields = 1;
+-    bmtMetaData.pFields = (mdToken*)_alloca(sizeof(mdToken));
++    bmtMetaData.pFields = (mdToken*)Alloca(sizeof(mdToken));
+     bmtMetaData.pFields[0] = fieldDef;
+-    bmtMetaData.pFieldAttrs = (DWORD*)_alloca(sizeof(DWORD));
++    bmtMetaData.pFieldAttrs = (DWORD*)Alloca(sizeof(DWORD));
+     IfFailThrow(pImport->GetFieldDefProps(fieldDef, &bmtMetaData.pFieldAttrs[0]));
+     
+     MethodTableBuilder::bmtMethAndFieldDescs bmtMFDescs;
+     // We need to alloc the memory, but don't have to fill it in.  InitializeFieldDescs
+     // will copy pFD (1st arg) into here.
+-    bmtMFDescs.ppFieldDescList = (FieldDesc**)_alloca(sizeof(FieldDesc*));
++    bmtMFDescs.ppFieldDescList = (FieldDesc**)Alloca(sizeof(FieldDesc*));
+ 
+     MethodTableBuilder::bmtFieldPlacement bmtFP;
+ 
+@@ -362,7 +362,7 @@ VOID EEClass::FixupFieldDescForEnC(Metho
+     
+     // We shouldn't have to fill this in b/c we're not allowed to EnC value classes, or
+     // anything else with layout info associated with it.
+-    LayoutRawFieldInfo *pLayoutRawFieldInfos = (LayoutRawFieldInfo*)_alloca((2) * sizeof(LayoutRawFieldInfo));
++    LayoutRawFieldInfo *pLayoutRawFieldInfos = (LayoutRawFieldInfo*)Alloca((2) * sizeof(LayoutRawFieldInfo));
+ 
+     // If not NULL, it means there are some by-value fields, and this contains an entry for each instance or static field,
+     // which is NULL if not a by value field, and points to the EEClass of the field if a by value field.  Instance fields
diff --git a/coreclr-git/patches/patch-src_vm_classhash.cpp b/coreclr-git/patches/patch-src_vm_classhash.cpp
new file mode 100644
index 0000000..fcd0119
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_classhash.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/classhash.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/classhash.cpp
+@@ -306,7 +306,7 @@ VOID EEClassHashTable::ConstructKeyFromD
+             INT32 iAllocSize;
+             if (!ClrSafeInt<INT32>::addition(iNSLength, iNameLength, iAllocSize))
+                 COMPlusThrowOM();
+-            LPUTF8 pszOutNameSpace = (LPUTF8) _alloca(iAllocSize);
++            LPUTF8 pszOutNameSpace = (LPUTF8) Alloca(iAllocSize);
+             if (iNSLength == 1)
+             {
+                 *pszOutNameSpace = '\0';
diff --git a/coreclr-git/patches/patch-src_vm_clrtocomcall.cpp b/coreclr-git/patches/patch-src_vm_clrtocomcall.cpp
new file mode 100644
index 0000000..f0e9439
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_clrtocomcall.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/clrtocomcall.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/clrtocomcall.cpp
+@@ -518,7 +518,7 @@ I4ARRAYREF SetUpWrapperInfo(MethodDesc *
+ 
+         // Collects ParamDef information in an indexed array where element 0 represents
+         // the return type.
+-        mdParamDef *params = (mdParamDef*)_alloca((numArgs+1) * sizeof(mdParamDef));
++        mdParamDef *params = (mdParamDef*)Alloca((numArgs+1) * sizeof(mdParamDef));
+         CollateParamTokens(msig.GetModule()->GetMDImport(), pMD->GetMemberDef(), numArgs, params);
+ 
+ 
+@@ -728,7 +728,7 @@ UINT32 CLRToCOMLateBoundWorker(ComPlusMe
+                 if (allocSize < cAssoc)
+                     COMPlusThrow(kTypeLoadException, IDS_EE_TOOMANYASSOCIATES);
+                 
+-                pAssoc = (ASSOCIATE_RECORD*) _alloca((size_t) allocSize);
++                pAssoc = (ASSOCIATE_RECORD*) Alloca((size_t) allocSize);
+                 IfFailThrow(pMDImport->GetAllAssociates(&henum, pAssoc, cAssoc));
+                 
+                 pMDImport->EnumClose(&henum);
diff --git a/coreclr-git/patches/patch-src_vm_clsload.cpp b/coreclr-git/patches/patch-src_vm_clsload.cpp
new file mode 100644
index 0000000..57f9037
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_clsload.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/clsload.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/clsload.cpp
+@@ -1688,7 +1688,7 @@ ClassLoader::FindClassModuleThrowing(
+                 return FALSE;
+             }
+ 
+-            pszLowerNameSpace = (LPUTF8)_alloca(allocLen);
++            pszLowerNameSpace = (LPUTF8)Alloca(allocLen);
+             if (allocLen == 1)
+             {
+                 *pszLowerNameSpace = '\0';
+@@ -1709,7 +1709,7 @@ ClassLoader::FindClassModuleThrowing(
+             return FALSE;
+         }
+ 
+-        pszLowerClassName = (LPUTF8)_alloca(allocLen);
++        pszLowerClassName = (LPUTF8)Alloca(allocLen);
+         if (!InternalCasingHelper::InvariantToLower(
+                 pszLowerClassName, 
+                 allocLen, 
diff --git a/coreclr-git/patches/patch-src_vm_comdynamic.cpp b/coreclr-git/patches/patch-src_vm_comdynamic.cpp
new file mode 100644
index 0000000..2bda460
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_comdynamic.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/comdynamic.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/comdynamic.cpp
+@@ -1415,7 +1415,7 @@ HRESULT COMDynamicWrite::EmitDebugInfoBe
+         if (debugDirDataSize > 0)
+         {
+             // Make some room for the data.
+-            debugDirData = (BYTE*)_alloca(debugDirDataSize);
++            debugDirData = (BYTE*)Alloca(debugDirDataSize);
+ 
+             // Actually get the data now.
+             IfFailGo(pWriter->GetDebugInfo(&debugDirIDD,
+@@ -1544,7 +1544,7 @@ HRESULT COMDynamicWrite::EmitDebugInfoEn
+         SIZE_T dotOffset = dot ? dot - filename : fnLen;
+ 
+         size_t len = dotOffset + 6;
+-            WCHAR *fn = (WCHAR*)_alloca(len * sizeof(WCHAR));
++            WCHAR *fn = (WCHAR*)Alloca(len * sizeof(WCHAR));
+         wcsncpy_s(fn, len, filename, dotOffset);
+ 
+         fn[dotOffset] = W('.');
diff --git a/coreclr-git/patches/patch-src_vm_compile.cpp b/coreclr-git/patches/patch-src_vm_compile.cpp
new file mode 100644
index 0000000..12b506d
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_compile.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/compile.cpp.orig	2016-02-04 01:25:17.000000000 +0000
++++ src/vm/compile.cpp
+@@ -2639,7 +2639,7 @@ void CEECompileInfo::EncodeTypeLayout(CO
+         size_t cbGCRefMap = (dwSize / sizeof(TADDR) + 7) / 8;
+         _ASSERTE(cbGCRefMap > 0);
+ 
+-        BYTE * pGCRefMap = (BYTE *)_alloca(cbGCRefMap);
++        BYTE * pGCRefMap = (BYTE *)Alloca(cbGCRefMap);
+ 
+         ComputeGCRefMap(pMT, pGCRefMap, cbGCRefMap);
+ 
diff --git a/coreclr-git/patches/patch-src_vm_comtoclrcall.cpp b/coreclr-git/patches/patch-src_vm_comtoclrcall.cpp
new file mode 100644
index 0000000..79dd38c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_comtoclrcall.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/comtoclrcall.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/comtoclrcall.cpp
+@@ -1556,7 +1556,7 @@ void ComCallMethodDesc::InitNativeInfo()
+ 
+             // Collects ParamDef information in an indexed array where element 0 represents 
+             // the return type.
+-            mdParamDef *params = (mdParamDef*)_alloca((numArgs+1) * sizeof(mdParamDef));
++            mdParamDef *params = (mdParamDef*)Alloca((numArgs+1) * sizeof(mdParamDef));
+             CollateParamTokens(pInternalImport, md, numArgs, params);
+ 
+ #ifdef _TARGET_X86_
diff --git a/coreclr-git/patches/patch-src_vm_comwaithandle.cpp b/coreclr-git/patches/patch-src_vm_comwaithandle.cpp
new file mode 100644
index 0000000..f31cc39
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_comwaithandle.cpp
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- src/vm/comwaithandle.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/comwaithandle.cpp
+@@ -273,9 +273,9 @@ FCIMPL4(INT32, WaitHandleNative::CorWait
+     arrayHolder.Initialize(numWaiters, (PTRARRAYREF*) &waitObjects);
+     
+     pWaitObjects = (PTRARRAYREF)waitObjects;  // array of objects on which to wait
+-    HANDLE* internalHandles = (HANDLE*) _alloca(numWaiters*sizeof(HANDLE));
++    HANDLE* internalHandles = (HANDLE*) Alloca(numWaiters*sizeof(HANDLE));
+ #ifndef FEATURE_CORECLR
+-    BOOL *hasThreadAffinity = (BOOL*) _alloca(numWaiters*sizeof(BOOL));
++    BOOL *hasThreadAffinity = (BOOL*) Alloca(numWaiters*sizeof(BOOL));
+ 
+     BOOL mayRequireThreadAffinity = FALSE;
+ #endif // !FEATURE_CORECLR
diff --git a/coreclr-git/patches/patch-src_vm_crossdomaincalls.cpp b/coreclr-git/patches/patch-src_vm_crossdomaincalls.cpp
new file mode 100644
index 0000000..eaf9930
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_crossdomaincalls.cpp
@@ -0,0 +1,74 @@
+$NetBSD$
+
+--- src/vm/crossdomaincalls.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/crossdomaincalls.cpp
+@@ -1243,7 +1243,7 @@ CrossDomainChannel::BlitAndCall()
+         // since the srvObject is in the server domain and the TPMethodFrame m_pFrame is in the client domain.
+         // I don't think we need to protect the srvOjbect in this case, since it's reachable from the transparent
+         // proxy, which is protected by the TPMethodFrame.
+-        SIZE_T* pTmpStackArgs = (SIZE_T*)_alloca(m_numStackSlotsToCopy * sizeof(SIZE_T));
++        SIZE_T* pTmpStackArgs = (SIZE_T*)Alloca(m_numStackSlotsToCopy * sizeof(SIZE_T));
+         memcpy(pTmpStackArgs, pStackArgs, m_numStackSlotsToCopy * sizeof(SIZE_T));
+         pStackArgs = pTmpStackArgs;
+ 
+@@ -1571,10 +1571,10 @@ void CrossDomainChannel::MarshalAndCall_
+ 
+     // And a variable sized array and frame of marshaled arg GC references.
+     OBJECTREF *pServerArgArray = NULL;
+-    pServerArgArray = (OBJECTREF *) _alloca(pArgs->dwNumObjectsMarshalled * sizeof(OBJECTREF));
++    pServerArgArray = (OBJECTREF *) Alloca(pArgs->dwNumObjectsMarshalled * sizeof(OBJECTREF));
+     ZeroMemory(pServerArgArray, sizeof(OBJECTREF) * pArgs->dwNumObjectsMarshalled);
+ 
+-    TypeHandle* pServerArgTH = (TypeHandle *) _alloca(pArgs->dwNumObjectsMarshalled * sizeof(TypeHandle));
++    TypeHandle* pServerArgTH = (TypeHandle *) Alloca(pArgs->dwNumObjectsMarshalled * sizeof(TypeHandle));
+     GCPROTECT_ARRAY_BEGIN(pServerArgArray[0], pArgs->dwNumObjectsMarshalled);
+ 
+     // Initialize server side info, such as method address etc
+@@ -1740,9 +1740,9 @@ void CrossDomainChannel::MarshalAndCall_
+             if (pMT->IsStructRequiringStackAllocRetBuf())
+             {
+                 SIZE_T sz = pMT->GetNumInstanceFieldBytes();
+-                pvRetBuff = _alloca(sz);
++                pvRetBuff = Alloca(sz);
+                 memset(pvRetBuff, 0, sz);
+-                pValueClasses = new (_alloca(sizeof(ValueClassInfo))) ValueClassInfo(pvRetBuff, pMT, pValueClasses);
++                pValueClasses = new (Alloca(sizeof(ValueClassInfo))) ValueClassInfo(pvRetBuff, pMT, pValueClasses);
+             }
+             else
+             {
+@@ -2094,21 +2094,21 @@ CrossDomainChannel::MarshalAndCall()
+ #endif // _TARGET_X86_
+ 
+     // pArgAttribs tell where the marshalled objects should go, where they need unboxing etc
+-    pArgAttribs = (DWORD*) _alloca(dwNumArgs * sizeof(DWORD));
++    pArgAttribs = (DWORD*) Alloca(dwNumArgs * sizeof(DWORD));
+     ZeroMemory(pArgAttribs, sizeof(DWORD) * dwNumArgs);
+     // pThByRefs has the typehandles of the by-ref args
+-    pThByRefs = (TypeHandle *)_alloca(dwNumArgs * sizeof(TypeHandle));
++    pThByRefs = (TypeHandle *)Alloca(dwNumArgs * sizeof(TypeHandle));
+     ZeroMemory(pThByRefs, sizeof(TypeHandle) *dwNumArgs);
+     // pByRefArgAttribs tell where the by-ref args should go, after the call
+-    pByRefArgAttribs = (int*) _alloca(dwNumArgs * sizeof(int));
++    pByRefArgAttribs = (int*) Alloca(dwNumArgs * sizeof(int));
+     ZeroMemory(pByRefArgAttribs, sizeof(int) * dwNumArgs);
+     // bMarshalledArgs is a bunch of flags that tell which args were marshalled
+-    bMarshalledArgs = (BOOL*) _alloca(dwNumArgs * sizeof(BOOL));
++    bMarshalledArgs = (BOOL*) Alloca(dwNumArgs * sizeof(BOOL));
+     ZeroMemory(bMarshalledArgs, sizeof(BOOL) * dwNumArgs);
+ 
+     // pArgArray contains marshalled objects on the client side
+     OBJECTREF *pClientArgArray = NULL;
+-    pClientArgArray = (OBJECTREF *) _alloca(dwNumArgs * sizeof(OBJECTREF));
++    pClientArgArray = (OBJECTREF *) Alloca(dwNumArgs * sizeof(OBJECTREF));
+     ZeroMemory(pClientArgArray, sizeof(OBJECTREF) * dwNumArgs);
+     GCPROTECT_ARRAY_BEGIN(pClientArgArray[0], dwNumArgs);
+ 
+@@ -2122,7 +2122,7 @@ CrossDomainChannel::MarshalAndCall()
+     // spans registers and the stack.
+     cbStackArgs += sizeof(ArgumentRegisters);
+ #endif
+-    SIZE_T *pStackArgs = (SIZE_T*)_alloca(cbStackArgs);
++    SIZE_T *pStackArgs = (SIZE_T*)Alloca(cbStackArgs);
+     ZeroMemory(pStackArgs, cbStackArgs);
+ #ifdef CALLDESCR_ARGREGS
+     SIZE_T *pRegArgs = pStackArgs;
diff --git a/coreclr-git/patches/patch-src_vm_customattribute.cpp b/coreclr-git/patches/patch-src_vm_customattribute.cpp
new file mode 100644
index 0000000..b689dfa
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_customattribute.cpp
@@ -0,0 +1,44 @@
+$NetBSD$
+
+--- src/vm/customattribute.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/customattribute.cpp
+@@ -576,7 +576,7 @@ FCIMPL5(VOID, Attribute::ParseAttributeA
+             size_t size = sizeof(CaArg) * cArgs;
+             if ((size / sizeof(CaArg)) != cArgs) // uint over/underflow
+                 IfFailGo(E_INVALIDARG);
+-            pCaArgs = (CaArg*)_alloca(size);
++            pCaArgs = (CaArg*)Alloca(size);
+             
+             for (COUNT_T i = 0; i < cArgs; i ++)
+             {
+@@ -596,7 +596,7 @@ FCIMPL5(VOID, Attribute::ParseAttributeA
+             size_t size = sizeof(CaNamedArg) * cNamedArgs;
+             if ((size / sizeof(CaNamedArg)) != cNamedArgs) // uint over/underflow
+                 IfFailGo(E_INVALIDARG);
+-            pCaNamedArgs = (CaNamedArg*)_alloca(size);
++            pCaNamedArgs = (CaNamedArg*)Alloca(size);
+ 
+             for (COUNT_T i = 0; i < cNamedArgs; i ++)
+             {
+@@ -764,10 +764,10 @@ FCIMPL5(LPVOID, COMCustomAttribute::Crea
+         UINT cArgs = pSig->NumFixedArgs() + 1; // make room for the this pointer
+         UINT i = 1; // used to flag that we actually get the right number of arg from the blob
+         
+-        args = (ARG_SLOT*)_alloca(cArgs * sizeof(ARG_SLOT));
++        args = (ARG_SLOT*)Alloca(cArgs * sizeof(ARG_SLOT));
+         memset((void*)args, 0, cArgs * sizeof(ARG_SLOT));
+         
+-        OBJECTREF *argToProtect = (OBJECTREF*)_alloca(cArgs * sizeof(OBJECTREF));
++        OBJECTREF *argToProtect = (OBJECTREF*)Alloca(cArgs * sizeof(OBJECTREF));
+         memset((void*)argToProtect, 0, cArgs * sizeof(OBJECTREF));
+ 
+         // If we relax this, we need to insure custom attributes construct properly for Nullable<T>
+@@ -1207,7 +1207,7 @@ TypeHandle COMCustomAttribute::GetTypeHa
+         if ((size+1 <= 1) || (size > endBlob - *pBlob))
+             COMPlusThrow(kCustomAttributeFormatException);
+ 
+-        LPUTF8 szName = (LPUTF8)_alloca(size + 1);
++        LPUTF8 szName = (LPUTF8)Alloca(size + 1);
+         memcpy(szName, *pBlob, size);
+         *pBlob += size;
+         szName[size] = 0;
diff --git a/coreclr-git/patches/patch-src_vm_dbggcinfodecoder.cpp b/coreclr-git/patches/patch-src_vm_dbggcinfodecoder.cpp
new file mode 100644
index 0000000..e959a66
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_dbggcinfodecoder.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/dbggcinfodecoder.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/dbggcinfodecoder.cpp
+@@ -309,7 +309,7 @@ bool GcInfoDecoder::EnumerateLiveSlots(
+             {
+                 m_IsInterruptible = true;
+ 
+-                BYTE* callSiteLiveSet = (BYTE*) _alloca( ( numSlotMappings + 7 ) / 8 );
++                BYTE* callSiteLiveSet = (BYTE*) Alloca( ( numSlotMappings + 7 ) / 8 );
+ 
+                 UINT32 i;
+                 for( i=0; i<numSlotMappings/8; i++ )
+@@ -323,7 +323,7 @@ bool GcInfoDecoder::EnumerateLiveSlots(
+                 // Read slot mappings
+                 //---------------------------------------------------------------------------
+ 
+-                GcSlotDesc* slotMappings = (GcSlotDesc*) _alloca( numSlotMappings * sizeof( GcSlotDesc ) );
++                GcSlotDesc* slotMappings = (GcSlotDesc*) Alloca( numSlotMappings * sizeof( GcSlotDesc ) );
+                 // Assert that we can read a GcSlotDesc with a single call to m_Reader.Read()
+                 _ASSERTE( sizeof( GcSlotDesc ) <= sizeof ( size_t ) );
+                 for( UINT32 i=0; i<numSlotMappings; i++ )
diff --git a/coreclr-git/patches/patch-src_vm_debughelp.cpp b/coreclr-git/patches/patch-src_vm_debughelp.cpp
new file mode 100644
index 0000000..85daafd
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_debughelp.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/debughelp.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/debughelp.cpp
+@@ -884,7 +884,7 @@ StackWalkAction PrintStackTraceCallback(
+ 
+     MethodDesc* pMD = pCF->GetFunction();
+     const int nLen = 2048 - 1;    // keep one character for "\n"
+-    wchar_t *buff = (wchar_t*)alloca((nLen + 1) * sizeof(wchar_t));
++    wchar_t *buff = (wchar_t*)Alloca((nLen + 1) * sizeof(wchar_t));
+     buff[0] = 0;
+     buff[nLen-1] = W('\0');                    // make sure the buffer is always NULL-terminated
+ 
diff --git a/coreclr-git/patches/patch-src_vm_dispatchinfo.cpp b/coreclr-git/patches/patch-src_vm_dispatchinfo.cpp
new file mode 100644
index 0000000..8c080c8
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_dispatchinfo.cpp
@@ -0,0 +1,47 @@
+$NetBSD$
+
+--- src/vm/dispatchinfo.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/dispatchinfo.cpp
+@@ -1267,14 +1267,14 @@ void DispatchInfo::InvokeMemberWorker(Di
+     HRESULT hr;
+     
+     // Allocate the array of used flags.
+-    BYTE *aArgUsedFlags = (BYTE*)_alloca(NumParams * sizeof(BYTE));
++    BYTE *aArgUsedFlags = (BYTE*)Alloca(NumParams * sizeof(BYTE));
+     memset(aArgUsedFlags, 0, NumParams * sizeof(BYTE));
+ 
+     size_t cbByrefArgMngVariantIndex;
+     if (!ClrSafeInt<size_t>::multiply(sizeof(DWORD), NumArgs, cbByrefArgMngVariantIndex))
+         ThrowHR(COR_E_OVERFLOW);
+ 
+-    DWORD *aByrefArgMngVariantIndex = (DWORD *)_alloca(cbByrefArgMngVariantIndex);
++    DWORD *aByrefArgMngVariantIndex = (DWORD *)Alloca(cbByrefArgMngVariantIndex);
+ 
+     
+     //
+@@ -2182,7 +2182,7 @@ HRESULT DispatchInfo::InvokeMember(Simpl
+         if (!ClrSafeInt<size_t>::multiply(sizeof(OBJECTHANDLE *), NumArgs, cbStaticArrayBackupObjHandle))
+             ThrowHR(COR_E_OVERFLOW);
+ 
+-        OBJECTHANDLE *aByrefStaticArrayBackupObjHandle = (OBJECTHANDLE *)_alloca(cbStaticArrayBackupObjHandle);
++        OBJECTHANDLE *aByrefStaticArrayBackupObjHandle = (OBJECTHANDLE *)Alloca(cbStaticArrayBackupObjHandle);
+         memset(aByrefStaticArrayBackupObjHandle, 0, cbStaticArrayBackupObjHandle);
+ 
+         // Allocate the array that maps method params to their indices.
+@@ -2190,14 +2190,14 @@ HRESULT DispatchInfo::InvokeMember(Simpl
+         if (!ClrSafeInt<size_t>::multiply(sizeof(int), NumArgs, cbManagedMethodParamIndexMap))
+             ThrowHR(COR_E_OVERFLOW);
+ 
+-        int *pManagedMethodParamIndexMap = (int *)_alloca(cbManagedMethodParamIndexMap);
++        int *pManagedMethodParamIndexMap = (int *)Alloca(cbManagedMethodParamIndexMap);
+ 
+         // Allocate the array of byref objects.
+         size_t cbByrefArgOleVariant;
+         if (!ClrSafeInt<size_t>::multiply(sizeof(VARIANT *), NumArgs, cbByrefArgOleVariant))
+             ThrowHR(COR_E_OVERFLOW);
+ 
+-        VARIANT **aByrefArgOleVariant = (VARIANT **)_alloca(cbByrefArgOleVariant);
++        VARIANT **aByrefArgOleVariant = (VARIANT **)Alloca(cbByrefArgOleVariant);
+       
+         Objs.Target = pSimpleWrap->GetObjectRef();
+ 
diff --git a/coreclr-git/patches/patch-src_vm_dllimport.cpp b/coreclr-git/patches/patch-src_vm_dllimport.cpp
new file mode 100644
index 0000000..86bfd1b
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_dllimport.cpp
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- src/vm/dllimport.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/dllimport.cpp
+@@ -3668,7 +3668,7 @@ BOOL NDirect::MarshalingRequired(MethodD
+     numArgs++;   // +1 for return type
+ 
+     // We'll need to parse parameter native types
+-    mdParamDef *pParamTokenArray = (mdParamDef *)_alloca(numArgs * sizeof(mdParamDef));
++    mdParamDef *pParamTokenArray = (mdParamDef *)Alloca(numArgs * sizeof(mdParamDef));
+     IMDInternalImport *pMDImport = pModule->GetMDImport();
+ 
+     SigTypeContext emptyTypeContext;
+@@ -5511,7 +5511,7 @@ MethodDesc* NDirect::CreateCLRToNativeIL
+     
+     Module *pModule = pSigDesc->m_pModule;
+     numParamTokens = numArgs + 1;
+-    pParamTokenArray = (mdParamDef*)_alloca(numParamTokens * sizeof(mdParamDef));
++    pParamTokenArray = (mdParamDef*)Alloca(numParamTokens * sizeof(mdParamDef));
+     CollateParamTokens(pModule->GetMDImport(), pSigDesc->m_tkMethodDef, numArgs, pParamTokenArray);
+ 
+     // for interop vectors that have declarative security, we need
+@@ -5615,7 +5615,7 @@ MethodDesc* NDirect::CreateFieldAccessIL
+     int numParamTokens = numArgs + 1;
+ 
+     // make sure we capture marshaling metadata
+-    mdParamDef* pParamTokenArray = (mdParamDef *)_alloca(numParamTokens * sizeof(mdParamDef));
++    mdParamDef* pParamTokenArray = (mdParamDef *)Alloca(numParamTokens * sizeof(mdParamDef));
+     pParamTokenArray[0] = mdParamDefNil;
+     pParamTokenArray[numArgs] = (mdParamDef)fd;
+ 
+@@ -6102,7 +6102,7 @@ void CreateCLRToDispatchCOMStub(
+                                     &numArgs);
+ 
+     numParamTokens = numArgs + 1;
+-    pParamTokenArray = (mdParamDef*)_alloca(numParamTokens * sizeof(mdParamDef));
++    pParamTokenArray = (mdParamDef*)Alloca(numParamTokens * sizeof(mdParamDef));
+     CollateParamTokens(sigDesc.m_pModule->GetMDImport(), sigDesc.m_tkMethodDef, numArgs, pParamTokenArray);
+ 
+     DispatchStubState MyStubState;
diff --git a/coreclr-git/patches/patch-src_vm_dllimportcallback.cpp b/coreclr-git/patches/patch-src_vm_dllimportcallback.cpp
new file mode 100644
index 0000000..e92d062
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_dllimportcallback.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/dllimportcallback.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/dllimportcallback.cpp
+@@ -872,7 +872,7 @@ Stub *UMThunkMarshInfo::CompileNExportTh
+     // parameters with copy constructors where we perform value-to-reference transformation
+     UINT nStackBytesIncoming = nStackBytes;
+ 
+-    UINT *psrcofs = (UINT *)_alloca((nStackBytes / STACK_ELEM_SIZE) * sizeof(UINT));
++    UINT *psrcofs = (UINT *)Alloca((nStackBytes / STACK_ELEM_SIZE) * sizeof(UINT));
+     UINT psrcofsregs[NUM_ARGUMENT_REGISTERS];
+     UINT retbufofs = UNUSED_STACK_OFFSET;
+ 
diff --git a/coreclr-git/patches/patch-src_vm_dwbucketmanager.hpp b/coreclr-git/patches/patch-src_vm_dwbucketmanager.hpp
new file mode 100644
index 0000000..54e3445
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_dwbucketmanager.hpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/dwbucketmanager.hpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/dwbucketmanager.hpp
+@@ -596,7 +596,7 @@ void BaseBucketParamsManager::GetModuleN
+         if (pModule->IsManifest())
+         {
+             // Single-module assembly; allocate a buffer and convert assembly name.
+-            fullName = reinterpret_cast< WCHAR* >(_alloca(sizeof(WCHAR)*(fullNameLength)));
++            fullName = reinterpret_cast< WCHAR* >(Alloca(sizeof(WCHAR)*(fullNameLength)));
+             WszMultiByteToWideChar(CP_UTF8, 0, utf8AssemblyName, -1, fullName, fullNameLength);
+         }
+         else
+@@ -624,7 +624,7 @@ void BaseBucketParamsManager::GetModuleN
+                 }
+                 else
+                 {
+-                    fullName = reinterpret_cast< WCHAR* >(_alloca(AllocLen));
++                    fullName = reinterpret_cast< WCHAR* >(Alloca(AllocLen));
+ 
+                     // Convert the assembly name.
+                     WszMultiByteToWideChar(CP_UTF8, 0, utf8AssemblyName, -1, fullName, assemblyNameLength);
diff --git a/coreclr-git/patches/patch-src_vm_dwreport.cpp b/coreclr-git/patches/patch-src_vm_dwreport.cpp
new file mode 100644
index 0000000..763535e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_dwreport.cpp
@@ -0,0 +1,37 @@
+$NetBSD$
+
+--- src/vm/dwreport.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/dwreport.cpp
+@@ -459,8 +459,8 @@ HRESULT DwCheckCompany(                 
+     }
+ 
+     // Allocate the buffer for the version info structure
+-    // _alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
+-    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(_alloca(bufSize));
++    // Alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
++    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(Alloca(bufSize));
+ 
+     // Extract the version information blob. The version information
+     // contains much more than the actual item of interest.
+@@ -595,8 +595,8 @@ int DwGetAppDescription(                
+     }
+ 
+     // Allocate the buffer for the version info structure
+-    // _alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
+-    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(_alloca(bufSize));
++    // Alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
++    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(Alloca(bufSize));
+ 
+     // Extract the version information blob. The version information
+     // contains much more than the actual item of interest.
+@@ -718,8 +718,8 @@ int DwGetAssemblyVersion(               
+     }
+ 
+     // Allocate the buffer for the version info structure
+-    // _alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
+-    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(_alloca(bufSize));
++    // Alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
++    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(Alloca(bufSize));
+ 
+     // Extract the version information blob. The version information
+     // contains much more than the actual item of interest.
diff --git a/coreclr-git/patches/patch-src_vm_encee.cpp b/coreclr-git/patches/patch-src_vm_encee.cpp
new file mode 100644
index 0000000..820f968
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_encee.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/encee.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/encee.cpp
+@@ -654,7 +654,7 @@ HRESULT EditAndContinueModule::ResumeInU
+     if( newFrameSize > oldFrameSize) 
+     {
+         DWORD frameIncrement = newFrameSize - oldFrameSize;
+-        (void)alloca(frameIncrement);
++        (void)Alloca(frameIncrement);
+     }
+ 
+     // Ask the EECodeManager to actually fill in the context and stack for the new frame so that
diff --git a/coreclr-git/patches/patch-src_vm_excep.cpp b/coreclr-git/patches/patch-src_vm_excep.cpp
new file mode 100644
index 0000000..763843d
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_excep.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/excep.cpp.orig	2016-02-08 23:48:23.000000000 +0000
++++ src/vm/excep.cpp
+@@ -6643,7 +6643,7 @@ static STRINGREF MissingMemberException_
+         return StringObject::NewString("Unknown signature");
+     }
+ 
+-    psig = (const BYTE*)_alloca(csig);
++    psig = (const BYTE*)Alloca(csig);
+     CopyMemory((BYTE*)psig,
+                (*ppPersistedSig)->GetDirectPointerToNonObjectElements(),
+                csig);
diff --git a/coreclr-git/patches/patch-src_vm_exceptionhandling.cpp b/coreclr-git/patches/patch-src_vm_exceptionhandling.cpp
new file mode 100644
index 0000000..eb4c0eb
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_exceptionhandling.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/exceptionhandling.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/exceptionhandling.cpp
+@@ -4298,7 +4298,7 @@ void DumpClauses(IJitManager* pJitMan, c
+ }
+ 
+ #define STACK_ALLOC_ARRAY(numElements, type) \
+-    ((type *)_alloca((numElements)*(sizeof(type))))
++    ((type *)Alloca((numElements)*(sizeof(type))))
+ 
+ static void DoEHLog(
+     DWORD lvl,
diff --git a/coreclr-git/patches/patch-src_vm_exceptmacros.h b/coreclr-git/patches/patch-src_vm_exceptmacros.h
new file mode 100644
index 0000000..831b092
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_exceptmacros.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/exceptmacros.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/exceptmacros.h
+@@ -230,7 +230,7 @@ VOID DECLSPEC_NORETURN RealCOMPlusThrowS
+ #if !defined(WIN64EXCEPTIONS)
+ 
+ #define INSTALL_NESTED_EXCEPTION_HANDLER(frame)                                                                       \
+-   NestedHandlerExRecord *__pNestedHandlerExRecord = (NestedHandlerExRecord*) _alloca(sizeof(NestedHandlerExRecord)); \
++   NestedHandlerExRecord *__pNestedHandlerExRecord = (NestedHandlerExRecord*) Alloca(sizeof(NestedHandlerExRecord)); \
+    __pNestedHandlerExRecord->m_handlerInfo.m_hThrowable = NULL;                                                       \
+    __pNestedHandlerExRecord->Init((PEXCEPTION_ROUTINE)COMPlusNestedExceptionHandler, frame);                          \
+    INSTALL_EXCEPTION_HANDLING_RECORD(&(__pNestedHandlerExRecord->m_ExReg));
diff --git a/coreclr-git/patches/patch-src_vm_fieldmarshaler.cpp b/coreclr-git/patches/patch-src_vm_fieldmarshaler.cpp
new file mode 100644
index 0000000..c60b71c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_fieldmarshaler.cpp
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- src/vm/fieldmarshaler.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/fieldmarshaler.cpp
+@@ -1329,7 +1329,7 @@ VOID EEClassLayoutInfo::CollectLayoutFie
+     {
+         ThrowHR(COR_E_TYPELOAD);
+     }
+-    LayoutRawFieldInfo **pSortArray = (LayoutRawFieldInfo **)_alloca(cbSortArraySize.Value());
++    LayoutRawFieldInfo **pSortArray = (LayoutRawFieldInfo **)Alloca(cbSortArraySize.Value());
+     LayoutRawFieldInfo **pSortArrayEnd = pSortArray;
+     
+     ULONG maxRid = pInternalImport->GetCountWithTokenKind(mdtFieldDef);
+@@ -3297,7 +3297,7 @@ VOID FieldMarshaler_FixedStringAnsi::Upd
+     if (allocSize < m_numchar)
+         ThrowOutOfMemory();
+     
+-    LPSTR tempbuf = (LPSTR)(_alloca((size_t)allocSize));
++    LPSTR tempbuf = (LPSTR)(Alloca((size_t)allocSize));
+     if (!tempbuf)
+         ThrowOutOfMemory();
+ 
+@@ -3310,7 +3310,7 @@ VOID FieldMarshaler_FixedStringAnsi::Upd
+     if (allocSize < m_numchar)
+         ThrowOutOfMemory();
+     
+-    LPWSTR    wsztemp = (LPWSTR)_alloca( (size_t)allocSize );
++    LPWSTR    wsztemp = (LPWSTR)Alloca( (size_t)allocSize );
+     int ncwritten = MultiByteToWideChar(CP_ACP,
+                                         MB_PRECOMPOSED,
+                                         tempbuf,
diff --git a/coreclr-git/patches/patch-src_vm_fusionbind.cpp b/coreclr-git/patches/patch-src_vm_fusionbind.cpp
new file mode 100644
index 0000000..15e77c3
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_fusionbind.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/fusionbind.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/fusionbind.cpp
+@@ -503,7 +503,7 @@ HRESULT FusionBind::AddEnvironmentProper
+     WCHAR *pValue = &(rcValue[0]);
+     size = WszGetEnvironmentVariable(variable, pValue, size);
+     if(size > _MAX_PATH) {
+-        pValue = (WCHAR*) _alloca(size * sizeof(WCHAR));
++        pValue = (WCHAR*) Alloca(size * sizeof(WCHAR));
+         size = WszGetEnvironmentVariable(variable, pValue, size);
+         size++; // Add in the null terminator
+     }
+@@ -540,7 +540,7 @@ HRESULT FusionBind::SetupFusionContext(L
+     LPCWSTR pBase;
+     // if the appbase is null then use the current directory
+     if (szAppBase == NULL) {
+-        pBase = (LPCWSTR) _alloca(_MAX_PATH * sizeof(WCHAR));
++        pBase = (LPCWSTR) Alloca(_MAX_PATH * sizeof(WCHAR));
+         if(!WszGetCurrentDirectory(_MAX_PATH, (LPWSTR) pBase))
+             IfFailGo(HRESULT_FROM_GetLastError());
+     }
diff --git a/coreclr-git/patches/patch-src_vm_gchelpers.cpp b/coreclr-git/patches/patch-src_vm_gchelpers.cpp
new file mode 100644
index 0000000..866f84a
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_gchelpers.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/gchelpers.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/gchelpers.cpp
+@@ -700,7 +700,7 @@ OBJECTREF   DupArrayForCloning(BASEARRAY
+     unsigned rank = arrayType.GetRank();
+ 
+     DWORD numArgs =  rank*2;
+-    INT32* args = (INT32*) _alloca(sizeof(INT32)*numArgs);
++    INT32* args = (INT32*) Alloca(sizeof(INT32)*numArgs);
+ 
+     if (arrayType.GetInternalCorElementType() == ELEMENT_TYPE_ARRAY)
+     {
diff --git a/coreclr-git/patches/patch-src_vm_genericdict.cpp b/coreclr-git/patches/patch-src_vm_genericdict.cpp
new file mode 100644
index 0000000..88789ff
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_genericdict.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/genericdict.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/genericdict.cpp
+@@ -829,7 +829,7 @@ Dictionary::PopulateEntry(
+                 if (!ClrSafeInt<SIZE_T>::multiply(nargs, sizeof(TypeHandle), cbMem/* passed by ref */))
+                     ThrowHR(COR_E_OVERFLOW);
+                         
+-                TypeHandle * pInst = (TypeHandle*) _alloca(cbMem);
++                TypeHandle * pInst = (TypeHandle*) Alloca(cbMem);
+                 for (DWORD i = 0; i < nargs; i++)
+                 {
+                     pInst[i] = ptr.GetTypeHandleThrowing(
diff --git a/coreclr-git/patches/patch-src_vm_generics.cpp b/coreclr-git/patches/patch-src_vm_generics.cpp
new file mode 100644
index 0000000..401e07c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_generics.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/generics.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/generics.cpp
+@@ -151,7 +151,7 @@ TypeHandle ClassLoader::LoadCanonicalGen
+         DO_INTERIOR_STACK_PROBE_FOR_NOTHROW_CHECK_THREAD((10+dwAllocSize/PAGE_SIZE+1), NO_FORBIDGC_LOADER_USE_ThrowSO(););
+     }
+ #endif // DACCESS_COMPILE
+-    TypeHandle *repInst = (TypeHandle*) _alloca(dwAllocSize);
++    TypeHandle *repInst = (TypeHandle*) Alloca(dwAllocSize);
+ 
+     for (DWORD i = 0; i < ntypars; i++)
+     {
diff --git a/coreclr-git/patches/patch-src_vm_i386_excepcpu.h b/coreclr-git/patches/patch-src_vm_i386_excepcpu.h
new file mode 100644
index 0000000..bf90180
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_i386_excepcpu.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/i386/excepcpu.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/i386/excepcpu.h
+@@ -50,7 +50,7 @@ class Thread;
+ // stackOverwriteBarrier is used to detect overwriting of stack which will mess up handler registration
+ #if defined(_DEBUG)
+ #define DECLARE_CPFH_EH_RECORD(pCurThread) \
+-    FrameHandlerExRecordWithBarrier *___pExRecordWithBarrier = (FrameHandlerExRecordWithBarrier *)_alloca(sizeof(FrameHandlerExRecordWithBarrier)); \
++    FrameHandlerExRecordWithBarrier *___pExRecordWithBarrier = (FrameHandlerExRecordWithBarrier *)Alloca(sizeof(FrameHandlerExRecordWithBarrier)); \
+     for (int ___i =0; ___i < STACK_OVERWRITE_BARRIER_SIZE; ___i++) \
+         ___pExRecordWithBarrier->m_StackOverwriteBarrier[___i] = STACK_OVERWRITE_BARRIER_VALUE; \
+     FrameHandlerExRecord *___pExRecord = &(___pExRecordWithBarrier->m_ExRecord); \
+@@ -59,7 +59,7 @@ class Thread;
+ 
+ #else
+ #define DECLARE_CPFH_EH_RECORD(pCurThread) \
+-    FrameHandlerExRecord *___pExRecord = (FrameHandlerExRecord *)_alloca(sizeof(FrameHandlerExRecord)); \
++    FrameHandlerExRecord *___pExRecord = (FrameHandlerExRecord *)Alloca(sizeof(FrameHandlerExRecord)); \
+     ___pExRecord->m_ExReg.Handler = (PEXCEPTION_ROUTINE)COMPlusFrameHandler; \
+     ___pExRecord->m_pEntryFrame = (pCurThread)->GetFrame();
+ 
diff --git a/coreclr-git/patches/patch-src_vm_i386_excepx86.cpp b/coreclr-git/patches/patch-src_vm_i386_excepx86.cpp
new file mode 100644
index 0000000..9fecbc6
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_i386_excepx86.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/i386/excepx86.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/i386/excepx86.cpp
+@@ -2209,7 +2209,7 @@ VOID PopNestedExceptionRecords(LPVOID pT
+  * COMPlusThrowCallbackHelper
+  *
+  * This function is a simple helper function for COMPlusThrowCallback.  It is needed
+- * because of the EX_TRY macro.  This macro does an alloca(), which allocates space
++ * because of the EX_TRY macro.  This macro does an Alloca(), which allocates space
+  * off the stack, not free'ing it.  Thus, doing a EX_TRY in a loop can easily result
+  * in a stack overflow error.  By factoring out the EX_TRY into a separate function,
+  * we recover that stack space.
diff --git a/coreclr-git/patches/patch-src_vm_i386_gmsx86.cpp b/coreclr-git/patches/patch-src_vm_i386_gmsx86.cpp
new file mode 100644
index 0000000..2bc51a4
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_i386_gmsx86.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/i386/gmsx86.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/i386/gmsx86.cpp
+@@ -398,7 +398,7 @@ void LazyMachState::unwindLazyState(Lazy
+ #ifdef _DEBUG
+     int count = 0;
+     const DWORD cInstructions = 1000;
+-    PTR_BYTE *instructionBytes = (PTR_BYTE*)alloca(cInstructions * sizeof(PTR_BYTE));
++    PTR_BYTE *instructionBytes = (PTR_BYTE*)Alloca(cInstructions * sizeof(PTR_BYTE));
+     memset(instructionBytes, 0, cInstructions * sizeof(PTR_BYTE));
+ #endif
+     bool bset16bit=false;
diff --git a/coreclr-git/patches/patch-src_vm_interoputil.cpp b/coreclr-git/patches/patch-src_vm_interoputil.cpp
new file mode 100644
index 0000000..db15401
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_interoputil.cpp
@@ -0,0 +1,46 @@
+$NetBSD$
+
+--- src/vm/interoputil.cpp.orig	2016-02-02 01:31:09.000000000 +0000
++++ src/vm/interoputil.cpp
+@@ -4580,7 +4580,7 @@ void IUInvokeDispMethod(REFLECTCLASSBASE
+         UINT cPositionalArgs = cArgs - cNamedArgs;
+        
+         DispParams.cArgs = cArgs;
+-        DispParams.rgvarg = (VARIANTARG *)_alloca(cArgs * sizeof(VARIANTARG));
++        DispParams.rgvarg = (VARIANTARG *)Alloca(cArgs * sizeof(VARIANTARG));
+         params = new DispParamHolder[cArgs];
+ 
+         // Initialize all the variants.
+@@ -4670,12 +4670,12 @@ void IUInvokeDispMethod(REFLECTCLASSBASE
+             size_t allocSize = cNamesToConvert * sizeof(LPWSTR);
+             if (allocSize < cNamesToConvert)
+                 COMPlusThrowArgumentOutOfRange(W("namedParameters"), W("ArgumentOutOfRange_Capacity"));
+-            LPWSTR *aNamesToConvert = (LPWSTR *)_alloca(allocSize);
++            LPWSTR *aNamesToConvert = (LPWSTR *)Alloca(allocSize);
+             
+             allocSize = cNamesToConvert * sizeof(DISPID);
+             if (allocSize < cNamesToConvert)
+                 COMPlusThrowArgumentOutOfRange(W("namedParameters"), W("ArgumentOutOfRange_Capacity"));
+-            aDispID = (DISPID *)_alloca(allocSize);
++            aDispID = (DISPID *)Alloca(allocSize);
+ 
+             // The first name to convert is the name of the method itself.
+             aNamesToConvert[0] = (*pStrName)->GetBuffer();
+@@ -4826,7 +4826,7 @@ void IUInvokeDispMethod(REFLECTCLASSBASE
+     if (cArgs > 0)
+     {
+         // Allocate the byref argument information.
+-        aByrefArgInfos = (ByrefArgumentInfo*)_alloca(cArgs * sizeof(ByrefArgumentInfo));
++        aByrefArgInfos = (ByrefArgumentInfo*)Alloca(cArgs * sizeof(ByrefArgumentInfo));
+         memset(aByrefArgInfos, 0, cArgs * sizeof(ByrefArgumentInfo));
+ 
+         // Set the byref bit on the arguments that have the byref modifier.
+@@ -4877,7 +4877,7 @@ void IUInvokeDispMethod(REFLECTCLASSBASE
+                 // If we are doing a property put then we need to set the DISPID of the
+                 // argument to DISP_PROPERTYPUT if there is at least one argument.
+                 DispParams.cNamedArgs = cNamedArgs + 1;
+-                DispParams.rgdispidNamedArgs = (DISPID*)_alloca((cNamedArgs + 1) * sizeof(DISPID));
++                DispParams.rgdispidNamedArgs = (DISPID*)Alloca((cNamedArgs + 1) * sizeof(DISPID));
+                 
+                 // Fill in the array of named arguments.
+                 DispParams.rgdispidNamedArgs[0] = DISPID_PROPERTYPUT;
diff --git a/coreclr-git/patches/patch-src_vm_interpreter.cpp b/coreclr-git/patches/patch-src_vm_interpreter.cpp
new file mode 100644
index 0000000..23acd02
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_interpreter.cpp
@@ -0,0 +1,76 @@
+$NetBSD$
+
+--- src/vm/interpreter.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/interpreter.cpp
+@@ -1630,7 +1630,7 @@ ARG_SLOT Interpreter::ExecuteMethodWrapp
+ #endif
+ 
+     size_t sizeWithGS = GetFrameSize(interpMethInfo) + sizeof(GSCookie);
+-    BYTE* frameMemoryGS = static_cast<BYTE*>(_alloca(sizeWithGS));
++    BYTE* frameMemoryGS = static_cast<BYTE*>(Alloca(sizeWithGS));
+ 
+     ARG_SLOT retVal = 0;
+     unsigned jmpCallToken = 0;
+@@ -5965,7 +5965,7 @@ void Interpreter::NewObj()
+             assert(m_curStackHt >= dwNumArgs);
+             m_curStackHt -= dwNumArgs;
+ 
+-            INT32* args = (INT32*)_alloca(dwNumArgs * sizeof(INT32));
++            INT32* args = (INT32*)Alloca(dwNumArgs * sizeof(INT32));
+ 
+             unsigned dwArg;
+             for (dwArg = 0; dwArg < dwNumArgs; dwArg++)
+@@ -9381,13 +9381,13 @@ void Interpreter::DoCallWork(bool virtua
+     }
+     else
+     {
+-        args = (ARG_SLOT*)_alloca(totalArgSlots * sizeof(ARG_SLOT));
++        args = (ARG_SLOT*)Alloca(totalArgSlots * sizeof(ARG_SLOT));
+ #if defined(_ARM_)
+         // The HFA return buffer, if any, is assumed to be at a negative
+         // offset from the IL arg pointer, so adjust that pointer upward.
+         args = args + HFAReturnArgSlots;
+ #endif // defined(_ARM_)
+-        argTypes = (InterpreterType*)_alloca(nSlots * sizeof(InterpreterType));
++        argTypes = (InterpreterType*)Alloca(nSlots * sizeof(InterpreterType));
+     }
+     // Make sure that we don't scan any of these until we overwrite them with
+     // the real types of the arguments.
+@@ -9647,7 +9647,7 @@ void Interpreter::DoCallWork(bool virtua
+ #ifdef ENREGISTERED_RETURNTYPE_MAXSIZE
+                 retBuffSize = max(retTypeSz, ENREGISTERED_RETURNTYPE_MAXSIZE);
+ #endif // ENREGISTERED_RETURNTYPE_MAXSIZE
+-                pLargeStructRetVal = (BYTE*)_alloca(retBuffSize);
++                pLargeStructRetVal = (BYTE*)Alloca(retBuffSize);
+                 // Clear this in case a GC happens.
+                 for (unsigned i = 0; i < retTypeSz; i++) pLargeStructRetVal[i] = 0;
+                 // Register this as location needing GC.
+@@ -10120,8 +10120,8 @@ void Interpreter::CallI()
+     }
+     else
+     {
+-        args = (ARG_SLOT*)_alloca(nSlots * sizeof(ARG_SLOT));
+-        argTypes = (InterpreterType*)_alloca(nSlots * sizeof(InterpreterType));
++        args = (ARG_SLOT*)Alloca(nSlots * sizeof(ARG_SLOT));
++        argTypes = (InterpreterType*)Alloca(nSlots * sizeof(InterpreterType));
+     }
+     // Make sure that we don't scan any of these until we overwrite them with
+     // the real types of the arguments.
+@@ -10206,7 +10206,7 @@ void Interpreter::CallI()
+ #ifdef ENREGISTERED_RETURNTYPE_MAXSIZE
+                 retBuffSize = max(retTypeSz, ENREGISTERED_RETURNTYPE_MAXSIZE);
+ #endif // ENREGISTERED_RETURNTYPE_MAXSIZE
+-                pLargeStructRetVal = (BYTE*)_alloca(retBuffSize);
++                pLargeStructRetVal = (BYTE*)Alloca(retBuffSize);
+ 
+                 // Clear this in case a GC happens.
+                 for (unsigned i = 0; i < retTypeSz; i++)
+@@ -10716,7 +10716,7 @@ void Interpreter::VerificationError(cons
+     // TODO: Should raise an exception eventually; for now:
+     const char* const msgPrefix = "Verification Error: ";
+     size_t len = strlen(msgPrefix) + strlen(msg) + 1;
+-    char* msgFinal = (char*)_alloca(len);
++    char* msgFinal = (char*)Alloca(len);
+     strcpy_s(msgFinal, len, msgPrefix);
+     strcat_s(msgFinal, len, msg);
+     _ASSERTE_MSG(false, msgFinal);
diff --git a/coreclr-git/patches/patch-src_vm_invokeutil.cpp b/coreclr-git/patches/patch-src_vm_invokeutil.cpp
new file mode 100644
index 0000000..d3761ae
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_invokeutil.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/invokeutil.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/invokeutil.cpp
+@@ -565,7 +565,7 @@ OBJECTREF InvokeUtil::GetBoxedObject(Typ
+     // Save off the data.  We are going to create and object
+     //  which may cause GC to occur.
+     int size = pMethTable->GetNumInstanceFieldBytes();
+-    void *p = _alloca(size);
++    void *p = Alloca(size);
+     memcpy(p, pData, size);
+     OBJECTREF retO = pMethTable->Box(p);
+     return retO;
+@@ -1170,7 +1170,7 @@ void InvokeUtil::SetValidField(CorElemen
+             else if (val == NULL) {
+                 // Null is the universal null object.  (Is this a good idea?)
+                 int size = pMT->GetNumInstanceFieldBytes();
+-                valueData = _alloca(size);
++                valueData = Alloca(size);
+                 memset(valueData, 0, size);
+             }
+             else 
diff --git a/coreclr-git/patches/patch-src_vm_jithelpers.cpp b/coreclr-git/patches/patch-src_vm_jithelpers.cpp
new file mode 100644
index 0000000..8249a88
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_jithelpers.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/jithelpers.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/jithelpers.cpp
+@@ -3413,7 +3413,7 @@ OBJECTREF allocNewMDArr(TypeHandle typeH
+     }
+ #else
+     // create an array where fwdArgList[0] == arg[0] ...
+-    fwdArgList = (INT32*) _alloca(dwNumArgs * sizeof(INT32));
++    fwdArgList = (INT32*) Alloca(dwNumArgs * sizeof(INT32));
+     for (unsigned i = 0; i < dwNumArgs; i++)
+     {
+         fwdArgList[i] = va_arg(args, INT32);
+@@ -6822,7 +6822,7 @@ void F_CALL_VA_CONV JIT_TailCall(PCODE c
+         //     where our buffer 'starts' is off by 8, so make sure our buffer is
+         //     off by 8.
+         //
+-        pvTempStack = (BYTE*)_alloca(cbTempStack + STACK_ADJUST_FOR_RETURN_ADDRESS) + STACK_ADJUST_FOR_RETURN_ADDRESS;
++        pvTempStack = (BYTE*)Alloca(cbTempStack + STACK_ADJUST_FOR_RETURN_ADDRESS) + STACK_ADJUST_FOR_RETURN_ADDRESS;
+     }
+ 
+     _ASSERTE(((size_t)pvTempStack & STACK_ALIGN_MASK) == STACK_ADJUST_FOR_RETURN_ADDRESS);
diff --git a/coreclr-git/patches/patch-src_vm_jitinterface.cpp b/coreclr-git/patches/patch-src_vm_jitinterface.cpp
new file mode 100644
index 0000000..27551c0
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_jitinterface.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/jitinterface.cpp.orig	2016-02-06 19:16:53.000000000 +0000
++++ src/vm/jitinterface.cpp
+@@ -13280,7 +13280,7 @@ BOOL TypeLayoutCheck(MethodTable * pMT, 
+             size_t cbGCRefMap = (dwActualSize / sizeof(TADDR) + 7) / 8;
+             _ASSERTE(cbGCRefMap > 0);
+ 
+-            BYTE * pGCRefMap = (BYTE *)_alloca(cbGCRefMap);
++            BYTE * pGCRefMap = (BYTE *)Alloca(cbGCRefMap);
+ 
+             ComputeGCRefMap(pMT, pGCRefMap, cbGCRefMap);
+ 
diff --git a/coreclr-git/patches/patch-src_vm_method.cpp b/coreclr-git/patches/patch-src_vm_method.cpp
new file mode 100644
index 0000000..a9b7c4e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_method.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/method.cpp.orig	2016-02-01 23:37:48.000000000 +0000
++++ src/vm/method.cpp
+@@ -5211,7 +5211,7 @@ LPVOID NDirectMethodDesc::FindEntryPoint
+ 
+     // Allocate a single character before the start of this string to enable quickly
+     // prepending a '_' character if we look for a stdcall entrypoint later on.
+-    LPSTR szAnsiEntrypointName = ((LPSTR)_alloca(dstbufsize + 1)) + 1;
++    LPSTR szAnsiEntrypointName = ((LPSTR)Alloca(dstbufsize + 1)) + 1;
+ 
+     // Copy the name so we can mangle it.
+     strcpy_s(szAnsiEntrypointName,dstbufsize,GetEntrypointName());
diff --git a/coreclr-git/patches/patch-src_vm_methodtablebuilder.cpp b/coreclr-git/patches/patch-src_vm_methodtablebuilder.cpp
new file mode 100644
index 0000000..eda7bb9
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_methodtablebuilder.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/methodtablebuilder.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/methodtablebuilder.cpp
+@@ -6867,7 +6867,7 @@ VOID MethodTableBuilder::PlaceInterfaceD
+         
+         // We have to MethodImpl all interface duplicates as all duplicates are 'declared on type' (see 
+         // code:#InjectInterfaceDuplicates_ApproxInterfaces)
+-        DispatchMapTypeID * rgDispatchMapTypeIDs = (DispatchMapTypeID *)_alloca(sizeof(DispatchMapTypeID) * cInterfaceDuplicates);
++        DispatchMapTypeID * rgDispatchMapTypeIDs = (DispatchMapTypeID *)Alloca(sizeof(DispatchMapTypeID) * cInterfaceDuplicates);
+         ComputeDispatchMapTypeIDs(
+             pDeclMT, 
+             &pDecl->GetMethodSignature().GetSubstitution(), 
+@@ -9428,7 +9428,7 @@ MethodTableBuilder::LoadExactInterfaceMa
+     // (d) If no duplicates then we can use the computed interface map we've created
+     // (e) If duplicates found then use the slow metadata-based technique code:#LoadExactInterfaceMap_Algorithm2
+     DWORD nInterfacesCount = pMT->GetNumInterfaces();
+-    MethodTable **pExactMTs = (MethodTable**) _alloca(sizeof(MethodTable *) * nInterfacesCount);
++    MethodTable **pExactMTs = (MethodTable**) Alloca(sizeof(MethodTable *) * nInterfacesCount);
+     DWORD nAssigned = 0;
+     BOOL duplicates = false;
+     if (pParentMT != NULL)
diff --git a/coreclr-git/patches/patch-src_vm_objectclone.cpp b/coreclr-git/patches/patch-src_vm_objectclone.cpp
new file mode 100644
index 0000000..ba3721f
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_objectclone.cpp
@@ -0,0 +1,51 @@
+$NetBSD$
+
+--- src/vm/objectclone.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/objectclone.cpp
+@@ -1002,7 +1002,7 @@ OBJECTREF ObjectClone::Clone(OBJECTREF r
+                 DWORD size = sizeof(IObjRefInstanceInfo) + (currObjFixupInfo ? currObjFixupInfo->GetSize() : 0);
+                 if (size > dwCurrStackSpaceSize)
+                 {
+-                    pTempStackSpace = _alloca(size);
++                    pTempStackSpace = Alloca(size);
+                     dwCurrStackSpaceSize = size;
+                 }
+                 IObjRefInstanceInfo *pIORInfo = new (pTempStackSpace) IObjRefInstanceInfo(currID, 0, 0);
+@@ -1040,7 +1040,7 @@ OBJECTREF ObjectClone::Clone(OBJECTREF r
+                 DWORD size = sizeof(ValueTypeInfo) + currObjFixupInfo->GetSize();
+                 if (size > dwCurrStackSpaceSize)
+                 {
+-                    pTempStackSpace = _alloca(size);
++                    pTempStackSpace = Alloca(size);
+                     dwCurrStackSpaceSize = size;
+                 }
+                 ValueTypeInfo *valInfo = new (pTempStackSpace) ValueTypeInfo(currID, currObjFixupInfo);
+@@ -1496,7 +1496,7 @@ void ObjectClone::AllocateArray()
+     TypeHandle __arrayTh = ClassLoader::LoadArrayTypeThrowing(__elemTh, __rank == 1 ? ELEMENT_TYPE_SZARRAY : ELEMENT_TYPE_ARRAY, __rank);
+ 
+     DWORD __numArgs =  __rank*2;
+-    INT32* __args = (INT32*) _alloca(sizeof(INT32)*__numArgs);
++    INT32* __args = (INT32*) Alloca(sizeof(INT32)*__numArgs);
+ 
+     if (__arrayTh.AsArray()->GetInternalCorElementType() == ELEMENT_TYPE_ARRAY)
+     {
+@@ -2743,8 +2743,8 @@ void ObjectClone::ScanArrayMembers()
+     DWORD rank                   = pArrayMT->GetRank();
+     DWORD dwOffset               = 0;
+ 
+-    DWORD *pIndices = (DWORD*) _alloca(sizeof(DWORD) * rank);
+-    VOID *pTemp = _alloca(sizeof(NDimArrayMemberInfo) + rank * sizeof(DWORD));
++    DWORD *pIndices = (DWORD*) Alloca(sizeof(DWORD) * rank);
++    VOID *pTemp = Alloca(sizeof(NDimArrayMemberInfo) + rank * sizeof(DWORD));
+     NDimArrayMemberInfo *pArrInfo = new (pTemp) NDimArrayMemberInfo(rank);
+     
+     bool boxingObjects = (pArrayMT->GetArrayElementType() == ELEMENT_TYPE_VALUETYPE);
+@@ -3784,7 +3784,7 @@ void ObjectClone::InvokeVtsCallbacks(OBJ
+ 
+     // Allocate an array to hold the methods to invoke (we do this because the invocation order is the opposite way round from the
+     // way we can easily scan for the methods). We can easily optimize this for the single callback case though.
+-    MethodDesc **pCallbacks = cMethods == 1 ? &pLastCallback : (MethodDesc**)_alloca(cMethods * sizeof(MethodDesc*));
++    MethodDesc **pCallbacks = cMethods == 1 ? &pLastCallback : (MethodDesc**)Alloca(cMethods * sizeof(MethodDesc*));
+ 
+     if (cMethods > 1)
+     {
diff --git a/coreclr-git/patches/patch-src_vm_olevariant.cpp b/coreclr-git/patches/patch-src_vm_olevariant.cpp
new file mode 100644
index 0000000..3890391
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_olevariant.cpp
@@ -0,0 +1,37 @@
+$NetBSD$
+
+--- src/vm/olevariant.cpp.orig	2016-02-02 01:31:09.000000000 +0000
++++ src/vm/olevariant.cpp
+@@ -4506,7 +4506,7 @@ BASEARRAYREF OleVariant::CreateArrayRefF
+         // and element pairs are presented before we call AllocateArrayEx().
+         Rank = pSafeArray->cDims;
+         cAllocateArrayArgs = Rank * 2;
+-        pAllocateArrayArgs = (INT32*)_alloca(sizeof(INT32) * Rank * 2);
++        pAllocateArrayArgs = (INT32*)Alloca(sizeof(INT32) * Rank * 2);
+         INT32 * pBoundsPtr = pAllocateArrayArgs;
+ 
+         // Copy the lower bounds and count of elements for the dimensions. These
+@@ -4758,10 +4758,10 @@ void OleVariant::TransposeArrayData(BYTE
+     CONTRACTL_END;
+ 
+     int iDims;
+-    DWORD *aDestElemCount = (DWORD*)_alloca(pSafeArray->cDims * sizeof(DWORD));
+-    DWORD *aDestIndex = (DWORD*)_alloca(pSafeArray->cDims * sizeof(DWORD));
+-    BYTE **aDestDataPos = (BYTE **)_alloca(pSafeArray->cDims * sizeof(BYTE *));
+-    SIZE_T *aDestDelta = (SIZE_T*)_alloca(pSafeArray->cDims * sizeof(SIZE_T));
++    DWORD *aDestElemCount = (DWORD*)Alloca(pSafeArray->cDims * sizeof(DWORD));
++    DWORD *aDestIndex = (DWORD*)Alloca(pSafeArray->cDims * sizeof(DWORD));
++    BYTE **aDestDataPos = (BYTE **)Alloca(pSafeArray->cDims * sizeof(BYTE *));
++    SIZE_T *aDestDelta = (SIZE_T*)Alloca(pSafeArray->cDims * sizeof(SIZE_T));
+     CQuickArray<BYTE> TmpArray;
+ 
+     // If there are no components, then there we are done.
+@@ -4917,7 +4917,7 @@ BASEARRAYREF OleVariant::ExtractWrappedO
+ 
+     // Set up the bounds arguments.
+     DWORD numArgs =  rank*2;
+-        INT32* args = (INT32*) _alloca(sizeof(INT32)*numArgs);
++        INT32* args = (INT32*) Alloca(sizeof(INT32)*numArgs);
+     
+     if (bIsMDArray)
+     {
diff --git a/coreclr-git/patches/patch-src_vm_proftoeeinterfaceimpl.cpp b/coreclr-git/patches/patch-src_vm_proftoeeinterfaceimpl.cpp
new file mode 100644
index 0000000..b725fc1
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_proftoeeinterfaceimpl.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/proftoeeinterfaceimpl.cpp.orig	2016-01-31 22:29:17.000000000 +0000
++++ src/vm/proftoeeinterfaceimpl.cpp
+@@ -1123,7 +1123,7 @@ BOOL HeapWalkHelper(Object * pBO, void *
+             if (bOnStack)
+             {
+                 // It's small enough, so just allocate on the stack
+-                arrObjRef = (OBJECTREF *)_alloca(cNumRefs * sizeof(OBJECTREF));
++                arrObjRef = (OBJECTREF *)Alloca(cNumRefs * sizeof(OBJECTREF));
+             }
+             else
+             {
+@@ -9716,7 +9716,7 @@ HCIMPL2(EXTERN_C void, ProfileEnter, UIN
+             }
+             
+             ulArgInfoSize = sizeof(COR_PRF_FUNCTION_ARGUMENT_INFO) + count * sizeof(COR_PRF_FUNCTION_ARGUMENT_RANGE);
+-            pArgumentInfo = (COR_PRF_FUNCTION_ARGUMENT_INFO *)_alloca(ulArgInfoSize);
++            pArgumentInfo = (COR_PRF_FUNCTION_ARGUMENT_INFO *)Alloca(ulArgInfoSize);
+         }
+ 
+         HRESULT hr = ProfilingGetFunctionEnter3Info(functionId, (COR_PRF_ELT_INFO)&eltInfo, &frameInfo, &ulArgInfoSize, pArgumentInfo);
diff --git a/coreclr-git/patches/patch-src_vm_reflectioninvocation.cpp b/coreclr-git/patches/patch-src_vm_reflectioninvocation.cpp
new file mode 100644
index 0000000..c570ffd
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_reflectioninvocation.cpp
@@ -0,0 +1,67 @@
+$NetBSD$
+
+--- src/vm/reflectioninvocation.cpp.orig	2016-02-06 18:10:53.000000000 +0000
++++ src/vm/reflectioninvocation.cpp
+@@ -543,7 +543,7 @@ FCIMPL6(Object*, RuntimeTypeHandle::Crea
+         }
+  
+         INT32 rank = atd->GetRank();
+-        INT32* lengths = (INT32*) _alloca(sizeof(INT32) * rank);
++        INT32* lengths = (INT32*) Alloca(sizeof(INT32) * rank);
+         for (INT32 i = 0; i < rank; ++i)
+         {
+             lengths[i] = 0;
+@@ -1076,7 +1076,7 @@ OBJECTREF InvokeArrayConstructor(ArrayTy
+     if (!ClrSafeInt<int>::multiply(sizeof(INT32), argCnt, allocSize))
+         COMPlusThrow(kArgumentException, IDS_EE_SIGTOOCOMPLEX);
+         
+-    INT32* indexes = (INT32*) _alloca((size_t)allocSize);
++    INT32* indexes = (INT32*) Alloca((size_t)allocSize);
+     ZeroMemory(indexes, allocSize);
+ 
+     for (i=0; i<(DWORD)argCnt; i++)
+@@ -1446,7 +1446,7 @@ FCIMPL4(Object*, RuntimeMethodHandle::In
+     // and second time to actually make the call.
+     INTERIOR_STACK_PROBE_FOR(pThread, 1 + static_cast<UINT>((2 * nAllocaSize) / OS_PAGE_SIZE) + static_cast<UINT>(HOLDER_CODE_NORMAL_STACK_LIMIT));
+ 
+-    LPBYTE pAlloc = (LPBYTE)_alloca(nAllocaSize);
++    LPBYTE pAlloc = (LPBYTE)Alloca(nAllocaSize);
+ 
+     LPBYTE pTransitionBlock = pAlloc + TransitionBlock::GetNegSpaceSize();
+ 
+@@ -1559,10 +1559,10 @@ FCIMPL4(Object*, RuntimeMethodHandle::In
+         if (pMT->IsStructRequiringStackAllocRetBuf())
+         {
+             SIZE_T sz = pMT->GetNumInstanceFieldBytes();
+-            pRetBufStackCopy = _alloca(sz);
++            pRetBufStackCopy = Alloca(sz);
+             memset(pRetBufStackCopy, 0, sz);
+ 
+-            pValueClasses = new (_alloca(sizeof(ValueClassInfo))) ValueClassInfo(pRetBufStackCopy, pMT, pValueClasses);
++            pValueClasses = new (Alloca(sizeof(ValueClassInfo))) ValueClassInfo(pRetBufStackCopy, pMT, pValueClasses);
+             *((LPVOID*) (pTransitionBlock + argit.GetRetBuffArgOffset())) = pRetBufStackCopy;
+         }
+         else
+@@ -1628,19 +1628,19 @@ FCIMPL4(Object*, RuntimeMethodHandle::In
+ 
+             PVOID pArgDst = argDest.GetDestinationAddress();
+ 
+-            PVOID pStackCopy = _alloca(structSize);
++            PVOID pStackCopy = Alloca(structSize);
+             *(PVOID *)pArgDst = pStackCopy;
+             pArgDst = pStackCopy;
+ 
+             if (!nullableType.IsNull())
+             {
+-                byRefToNullables = new(_alloca(sizeof(ByRefToNullable))) ByRefToNullable(i, pStackCopy, nullableType, byRefToNullables);
++                byRefToNullables = new(Alloca(sizeof(ByRefToNullable))) ByRefToNullable(i, pStackCopy, nullableType, byRefToNullables);
+             }
+ 
+             // save the info into ValueClassInfo
+             if (pMT->ContainsPointers()) 
+             {
+-                pValueClasses = new (_alloca(sizeof(ValueClassInfo))) ValueClassInfo(pStackCopy, pMT, pValueClasses);
++                pValueClasses = new (Alloca(sizeof(ValueClassInfo))) ValueClassInfo(pStackCopy, pMT, pValueClasses);
+             }
+ 
+             // We need a new ArgDestination that points to the stack copy
diff --git a/coreclr-git/patches/patch-src_vm_runtimehandles.cpp b/coreclr-git/patches/patch-src_vm_runtimehandles.cpp
new file mode 100644
index 0000000..01daad8
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_runtimehandles.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/runtimehandles.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/runtimehandles.cpp
+@@ -2874,7 +2874,7 @@ FCIMPL3(MethodDesc*, RuntimeMethodHandle
+             size_t size = ntypars * sizeof(TypeHandle);
+             if ((size / sizeof(TypeHandle)) != ntypars) // uint over/underflow
+                 COMPlusThrow(kArgumentException);
+-            inst = (TypeHandle*) _alloca(size);        
++            inst = (TypeHandle*) Alloca(size);
+ 
+             for (DWORD i = 0; i < ntypars; i++) 
+             {
diff --git a/coreclr-git/patches/patch-src_vm_securityattributes.cpp b/coreclr-git/patches/patch-src_vm_securityattributes.cpp
new file mode 100644
index 0000000..9ef0df8
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_securityattributes.cpp
@@ -0,0 +1,91 @@
+$NetBSD$
+
+--- src/vm/securityattributes.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/securityattributes.cpp
+@@ -373,10 +373,10 @@ Assembly* SecurityAttributes::LoadAssemb
+     _ASSERTE(SUCCEEDED(hr));
+ 
+     // Allocate the necessary buffers.
+-    wszName = (LPWSTR)_alloca(cchName * sizeof(WCHAR));
+-    sContext.szLocale = (LPWSTR)_alloca(sContext.cbLocale * sizeof(WCHAR));
+-    sContext.rProcessor = (DWORD *)_alloca(sContext.ulProcessor * sizeof(DWORD));
+-    sContext.rOS = (OSINFO *)_alloca(sContext.ulOS * sizeof(OSINFO));
++    wszName = (LPWSTR)Alloca(cchName * sizeof(WCHAR));
++    sContext.szLocale = (LPWSTR)Alloca(sContext.cbLocale * sizeof(WCHAR));
++    sContext.rProcessor = (DWORD *)Alloca(sContext.ulProcessor * sizeof(DWORD));
++    sContext.rOS = (OSINFO *)Alloca(sContext.ulOS * sizeof(OSINFO));
+ 
+     // Get the assembly name and rest of naming properties.
+     hr = pImport->GetAssemblyRefProps(tkAssemblyRef,
+@@ -887,7 +887,7 @@ HRESULT SecurityAttributes::SetAttrField
+ 
+             DWORD allocLen = cbName + 1;
+             // Buffer and nul terminate it.
+-            szString = (LPSTR)_alloca(allocLen);
++            szString = (LPSTR)Alloca(allocLen);
+             memcpy(szString, pbName, cbName);
+             szString[cbName] = '\0';
+ 
+@@ -1043,7 +1043,7 @@ HRESULT SecurityAttributes::SetAttrPrope
+ 
+             if ((pbName - *ppbBuffer) < 4) {
+                 // Buffer and nul terminate it.
+-                szString = (LPSTR)_alloca(allocLen);
++                szString = (LPSTR)Alloca(allocLen);
+             } else {
+                 tmpLargeStringHolder = new BYTE[allocLen];                
+                 szString = (LPSTR) ((BYTE*)tmpLargeStringHolder);
+@@ -1145,7 +1145,7 @@ void SecurityAttributes::AttrSetBlobToPe
+     GCPROTECT_BEGIN(throwable);
+     {
+         // allocate and GC-protect an array of objectrefs to reference the permissions
+-        OBJECTREF* attrArray = (OBJECTREF*)_alloca(pset.dwAttrCount * sizeof(OBJECTREF));
++        OBJECTREF* attrArray = (OBJECTREF*)Alloca(pset.dwAttrCount * sizeof(OBJECTREF));
+         memset(attrArray, 0, pset.dwAttrCount * sizeof(OBJECTREF));
+         GCPROTECT_ARRAY_BEGIN(*attrArray, pset.dwAttrCount);
+         {
+@@ -1223,7 +1223,7 @@ HRESULT SecurityAttributes::TranslateSec
+                 SetupRestrictSecAttributes();
+ 
+                 // allocate and protect an array of objectrefs to reference the permissions
+-                attrArray = (OBJECTREF*)_alloca(pAttrSet->dwAttrCount * sizeof(OBJECTREF));
++                attrArray = (OBJECTREF*)Alloca(pAttrSet->dwAttrCount * sizeof(OBJECTREF));
+                 memset(attrArray, 0, pAttrSet->dwAttrCount * sizeof(OBJECTREF));
+                 GCPROTECT_ARRAY_BEGIN(*attrArray, pAttrSet->dwAttrCount);
+                 {
+@@ -1900,7 +1900,7 @@ bool SecurityAttributes::IsUnrestrictedP
+     if (allocLen < cbName)
+         return false;
+ 
+-    LPSTR szName = (LPSTR)_alloca(allocLen);
++    LPSTR szName = (LPSTR)Alloca(allocLen);
+     memcpy(szName, pbName, cbName);
+     szName[cbName] = '\0';
+ 
+@@ -1965,7 +1965,7 @@ HRESULT SecurityAttributes::FixUpPermiss
+ 
+     // Buffer the name of the property and null terminate it.
+     DWORD allocLen = cbName + 1;
+-    LPSTR szName = (LPSTR)_alloca(allocLen);
++    LPSTR szName = (LPSTR)Alloca(allocLen);
+     memcpy(szName, pbName, cbName);
+     szName[cbName] = '\0';
+ 
+@@ -2098,7 +2098,7 @@ HRESULT GetFullyQualifiedTypeName(SStrin
+             return hr;
+ 
+         // Get the assembly name other naming properties
+-        wszAssemblyName = (LPWSTR)_alloca(cchName * sizeof(WCHAR));
++        wszAssemblyName = (LPWSTR)Alloca(cchName * sizeof(WCHAR));
+         hr = pImport->GetAssemblyProps(tkAssemblyRef,
+                                             (const void **)&pbPublicKeyOrToken,
+                                             &cbPublicKeyOrToken,
+@@ -2128,7 +2128,7 @@ HRESULT GetFullyQualifiedTypeName(SStrin
+             return hr;
+ 
+         // Get the assembly name other naming properties
+-        wszAssemblyName = (LPWSTR)_alloca(cchName * sizeof(WCHAR));
++        wszAssemblyName = (LPWSTR)Alloca(cchName * sizeof(WCHAR));
+         hr = pImport->GetAssemblyRefProps(tkAssemblyRef,
+                                             (const void **)&pbPublicKeyOrToken,
+                                             &cbPublicKeyOrToken,
diff --git a/coreclr-git/patches/patch-src_vm_siginfo.cpp b/coreclr-git/patches/patch-src_vm_siginfo.cpp
new file mode 100644
index 0000000..a6313a4
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_siginfo.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/siginfo.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/siginfo.cpp
+@@ -1349,7 +1349,7 @@ TypeHandle SigPointer::GetTypeHandleThro
+             {
+                 DO_INTERIOR_STACK_PROBE_FOR_NOTHROW_CHECK_THREAD((10+dwAllocaSize/PAGE_SIZE+1), NO_FORBIDGC_LOADER_USE_ThrowSO(););
+             }
+-            TypeHandle *thisinst = (TypeHandle*) _alloca(dwAllocaSize);
++            TypeHandle *thisinst = (TypeHandle*) Alloca(dwAllocaSize);
+ 
+             // Finally we gather up the type arguments themselves, loading at the level specified for generic arguments
+             for (unsigned i = 0; i < ntypars; i++)
+@@ -1636,7 +1636,7 @@ TypeHandle SigPointer::GetTypeHandleThro
+                     DO_INTERIOR_STACK_PROBE_FOR_NOTHROW_CHECK_THREAD((10+cAllocaSize/PAGE_SIZE+1), NO_FORBIDGC_LOADER_USE_ThrowSO(););
+                 }
+ 
+-                TypeHandle *retAndArgTypes = (TypeHandle*) _alloca(cAllocaSize);
++                TypeHandle *retAndArgTypes = (TypeHandle*) Alloca(cAllocaSize);
+                 bool fReturnTypeOrParameterNotLoaded = false;
+ 
+                 for (unsigned i = 0; i <= cArgs; i++)
diff --git a/coreclr-git/patches/patch-src_vm_stackbuildersink.cpp b/coreclr-git/patches/patch-src_vm_stackbuildersink.cpp
new file mode 100644
index 0000000..06675ad
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_stackbuildersink.cpp
@@ -0,0 +1,57 @@
+$NetBSD$
+
+--- src/vm/stackbuildersink.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/stackbuildersink.cpp
+@@ -294,7 +294,7 @@ void CallDescrWithObjectArray(OBJECTREF&
+     if (!ClrSafeInt<UINT32>::addition(cbAlloc, nStackBytes, cbAlloc))
+         COMPlusThrow(kArgumentException);
+ 
+-    pAlloc = (LPBYTE)_alloca(cbAlloc);
++    pAlloc = (LPBYTE)Alloca(cbAlloc);
+     pTransitionBlock = pAlloc + TransitionBlock::GetNegSpaceSize();
+ 
+     // cycle through the parameters and see if there are byrefs
+@@ -385,7 +385,7 @@ void CallDescrWithObjectArray(OBJECTREF&
+     int    ofs = 0;
+ 
+     // REVIEW: need to use actual arg count if VarArgs are supported
+-    ArgInfo* pArgInfoStart = (ArgInfo*) _alloca(nFixedArgs*sizeof(ArgInfo));
++    ArgInfo* pArgInfoStart = (ArgInfo*) Alloca(nFixedArgs*sizeof(ArgInfo));
+ 
+ #ifdef _DEBUG
+     // We expect to write useful data over every part of this so need
+@@ -434,7 +434,7 @@ void CallDescrWithObjectArray(OBJECTREF&
+                 numByRef ++;
+             }
+ 
+-            ByRefInfo *brInfo = (ByRefInfo *) _alloca(offsetof(ByRefInfo,data) + pArgInfo->dataSize);
++            ByRefInfo *brInfo = (ByRefInfo *) Alloca(offsetof(ByRefInfo,data) + pArgInfo->dataSize);
+             brInfo->argIndex = arg;
+             brInfo->typ = brType;
+             brInfo->typeHandle = ty;
+@@ -478,9 +478,9 @@ void CallDescrWithObjectArray(OBJECTREF&
+         if (pStructRetTypeMT->IsStructRequiringStackAllocRetBuf())
+         {
+             SIZE_T sz = pStructRetTypeMT->GetNumInstanceFieldBytes();
+-            pRetBufData = pRetBufStackData = _alloca(sz);
++            pRetBufData = pRetBufStackData = Alloca(sz);
+             memset(pRetBufData, 0, sz);
+-            pValueClasses = new (_alloca(sizeof(ValueClassInfo))) ValueClassInfo(pRetBufStackData, pStructRetTypeMT, pValueClasses);
++            pValueClasses = new (Alloca(sizeof(ValueClassInfo))) ValueClassInfo(pRetBufStackData, pStructRetTypeMT, pValueClasses);
+         }
+         else
+         {
+@@ -581,11 +581,11 @@ void CallDescrWithObjectArray(OBJECTREF&
+                     // We do not need to allocate a buffer if the argument is already passed by reference.
+                     if (!pArgInfo->byref && ArgIterator::IsArgPassedByRef(dataTypeHandle))
+                     {
+-                        PVOID pvArg = _alloca(dataSize);
++                        PVOID pvArg = Alloca(dataSize);
+                         pMT->UnBoxIntoUnchecked(pvArg, pArguments[i]);
+                         *(PVOID*)dataLocation = pvArg;
+ 
+-                        pValueClasses = new (_alloca(sizeof(ValueClassInfo))) ValueClassInfo(pvArg, pMT, pValueClasses);
++                        pValueClasses = new (Alloca(sizeof(ValueClassInfo))) ValueClassInfo(pvArg, pMT, pValueClasses);
+                     }
+                     else
+ #endif
diff --git a/coreclr-git/patches/patch-src_vm_stringliteralmap.cpp b/coreclr-git/patches/patch-src_vm_stringliteralmap.cpp
new file mode 100644
index 0000000..ff056de
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_stringliteralmap.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/stringliteralmap.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/stringliteralmap.cpp
+@@ -448,7 +448,7 @@ static void LogStringLiteral(__in_z cons
+ 
+     int length = pStringData->GetCharCount();
+     length = min(length, 100);
+-    WCHAR *szString = (WCHAR *)_alloca((length + 1) * sizeof(WCHAR));
++    WCHAR *szString = (WCHAR *)Alloca((length + 1) * sizeof(WCHAR));
+     memcpyNoGCRefs((void*)szString, (void*)pStringData->GetStringBuffer(), length * sizeof(WCHAR));
+     szString[length] = '\0';
+     LOG((LF_APPDOMAIN, LL_INFO10000, "String literal \"%S\" %s to Global map, size %d bytes\n", szString, action, pStringData->GetCharCount()));
diff --git a/coreclr-git/patches/patch-src_vm_threads.cpp b/coreclr-git/patches/patch-src_vm_threads.cpp
new file mode 100644
index 0000000..4ec22dc
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_threads.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/threads.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/threads.cpp
+@@ -2847,7 +2847,7 @@ DWORD __stdcall Thread::intermediateThre
+     if (m_offset_counter * offset_multiplier > PAGE_SIZE)
+         m_offset_counter = 0;
+ 
+-    (void)_alloca(m_offset_counter * offset_multiplier);
++    (void)Alloca(m_offset_counter * offset_multiplier);
+ 
+     intermediateThreadParam* param = (intermediateThreadParam*)arg;
+ 
+@@ -7661,7 +7661,7 @@ __declspec(noinline) void AllocateSomeSt
+     const size_t size = 0x400;
+ #endif  //_TARGET_X86_
+ 
+-    INT8* mem = (INT8*)_alloca(size);
++    INT8* mem = (INT8*)Alloca(size);
+     // Actually touch the memory we just allocated so the compiler can't
+     // optimize it away completely.
+     // NOTE: this assumes the stack grows down (towards 0).
diff --git a/coreclr-git/patches/patch-src_vm_threadsuspend.cpp b/coreclr-git/patches/patch-src_vm_threadsuspend.cpp
new file mode 100644
index 0000000..9ea0858
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_threadsuspend.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/threadsuspend.cpp.orig	2016-02-08 23:48:23.000000000 +0000
++++ src/vm/threadsuspend.cpp
+@@ -4275,7 +4275,7 @@ void __stdcall Thread::RedirectedHandled
+             // Free the context struct if we already have one cached
+             if (pThread->GetSavedRedirectContext())
+             {
+-                CONTEXT* pCtxTemp = (CONTEXT*)_alloca(sizeof(CONTEXT));
++                CONTEXT* pCtxTemp = (CONTEXT*)Alloca(sizeof(CONTEXT));
+                 memcpy(pCtxTemp, pCtx, sizeof(CONTEXT));
+                 delete pCtx;
+                 pCtx = pCtxTemp;
+@@ -6736,7 +6736,7 @@ void Thread::SetSafeEvent()
+  * WaitSuspendEventsHelper
+  *
+  * This function is a simple helper function for WaitSuspendEvents.  It is needed
+- * because of the EX_TRY macro.  This macro does an alloca(), which allocates space
++ * because of the EX_TRY macro.  This macro does an Alloca(), which allocates space
+  * off the stack, not free'ing it.  Thus, doing a EX_TRY in a loop can easily result
+  * in a stack overflow error.  By factoring out the EX_TRY into a separate function,
+  * we recover that stack space.
diff --git a/coreclr-git/patches/patch-src_vm_util.cpp b/coreclr-git/patches/patch-src_vm_util.cpp
new file mode 100644
index 0000000..7cf4e8e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_util.cpp
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- src/vm/util.cpp.orig	2016-02-13 00:18:27.000000000 +0000
++++ src/vm/util.cpp
+@@ -3913,7 +3913,7 @@ INT32 InternalCasingHelper::InvariantToL
+     __lszInWide = WszMultiByteToWideChar(CP_UTF8, 0, szInSave, -1, 0, 0);
+     if (__lszInWide > MAKE_MAX_LENGTH)
+          RaiseException(EXCEPTION_INT_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
+-    szInWide = (LPWSTR) alloca(__lszInWide*sizeof(WCHAR));
++    szInWide = (LPWSTR) Alloca(__lszInWide*sizeof(WCHAR));
+     if (szInWide == NULL) {
+         if (fAllowThrow) {
+             COMPlusThrowOM();
+@@ -4066,8 +4066,8 @@ HRESULT GetFileVersion(                 
+     }
+ 
+     // Allocate the buffer for the version info structure
+-    // _alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
+-    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(_alloca(bufSize));
++    // Alloca() can't return NULL -- raises STATUS_STACK_OVERFLOW.
++    BYTE* pVersionInfoBuffer = reinterpret_cast< BYTE* >(Alloca(bufSize));
+ 
+     ret = GetFileVersionInfoW(wszFilePath, dwHandle, bufSize, pVersionInfoBuffer);
+     if (!ret)
diff --git a/coreclr-git/patches/patch-src_vm_win32threadpool.cpp b/coreclr-git/patches/patch-src_vm_win32threadpool.cpp
new file mode 100644
index 0000000..0f68f8f
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_win32threadpool.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/vm/win32threadpool.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/win32threadpool.cpp
+@@ -2088,7 +2088,7 @@ DWORD __stdcall ThreadpoolMgr::intermedi
+     if (offset_counter * offset_multiplier > PAGE_SIZE)
+         offset_counter = 0;
+ 
+-    (void)_alloca(offset_counter * offset_multiplier);
++    (void)Alloca(offset_counter * offset_multiplier);
+ 
+     intermediateThreadParam* param = (intermediateThreadParam*)arg;
+ 
+@@ -4539,7 +4539,7 @@ DWORD __stdcall ThreadpoolMgr::GateThrea
+                                                   prevCPUInfo.usageBufferSize))
+         return 0;
+ 
+-    prevCPUInfo.usageBuffer = (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION *)alloca(prevCPUInfo.usageBufferSize);
++    prevCPUInfo.usageBuffer = (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION *)Alloca(prevCPUInfo.usageBufferSize);
+     if (prevCPUInfo.usageBuffer == NULL)
+         return 0;
+ 
diff --git a/coreclr-git/patches/patch-src_vm_zapsig.cpp b/coreclr-git/patches/patch-src_vm_zapsig.cpp
new file mode 100644
index 0000000..9e48300
--- /dev/null
+++ b/coreclr-git/patches/patch-src_vm_zapsig.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/vm/zapsig.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/vm/zapsig.cpp
+@@ -915,7 +915,7 @@ MethodDesc *ZapSig::DecodeMethod(Module 
+         if (!ClrSafeInt<SIZE_T>::multiply(nargs, sizeof(TypeHandle), cbMem/* passed by ref */))
+             ThrowHR(COR_E_OVERFLOW);
+                         
+-        TypeHandle * pInst = (TypeHandle*) _alloca(cbMem);
++        TypeHandle * pInst = (TypeHandle*) Alloca(cbMem);
+ 
+         for (DWORD i = 0; i < nargs; i++)
+         {
diff --git a/coreclr-git/patches/patch-src_zap_zapcode.cpp b/coreclr-git/patches/patch-src_zap_zapcode.cpp
new file mode 100644
index 0000000..4cadf7f
--- /dev/null
+++ b/coreclr-git/patches/patch-src_zap_zapcode.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/zap/zapcode.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/zap/zapcode.cpp
+@@ -1902,7 +1902,7 @@ void ZapHelperThunk::Save(ZapWriter * pZ
+     DWORD pad = GetSize() - sizeof(DWORD);
+     if (pad > 0)
+     {
+-        void * pPad = _alloca(pad);
++        void * pPad = Alloca(pad);
+         memset(pPad, DEFAULT_CODE_BUFFER_INIT, pad);
+         pZapWriter->Write(pPad, pad);
+     }
diff --git a/coreclr-git/patches/patch-src_zap_zapper.cpp b/coreclr-git/patches/patch-src_zap_zapper.cpp
new file mode 100644
index 0000000..3bf45a3
--- /dev/null
+++ b/coreclr-git/patches/patch-src_zap_zapper.cpp
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- src/zap/zapper.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/zap/zapper.cpp
+@@ -1711,10 +1711,10 @@ IAssemblyName *Zapper::GetAssemblyFusion
+                                           &md,
+                                           NULL));
+ 
+-    szName = (LPWSTR) _alloca(cbName * sizeof(WCHAR));
+-    md.szLocale = (LPWSTR) _alloca(md.cbLocale * sizeof(WCHAR));
+-    md.rProcessor = (DWORD *) _alloca(md.ulProcessor * sizeof(DWORD));
+-    md.rOS = (OSINFO *) _alloca(md.ulOS * sizeof(OSINFO));
++    szName = (LPWSTR) Alloca(cbName * sizeof(WCHAR));
++    md.szLocale = (LPWSTR) Alloca(md.cbLocale * sizeof(WCHAR));
++    md.rProcessor = (DWORD *) Alloca(md.ulProcessor * sizeof(DWORD));
++    md.rOS = (OSINFO *) Alloca(md.ulOS * sizeof(OSINFO));
+ 
+     IfFailThrow(pImport->GetAssemblyProps(a,
+                                           &pbPublicKeyToken, &cbPublicKeyToken, NULL,
+@@ -1788,10 +1788,10 @@ IAssemblyName *Zapper::GetAssemblyRefFus
+                                              NULL, NULL,
+                                              NULL));
+ 
+-    szName = (LPWSTR) _alloca(cbName * sizeof(WCHAR));
+-    md.szLocale = (LPWSTR) _alloca(md.cbLocale * sizeof(WCHAR));
+-    md.rProcessor = (DWORD *) _alloca(md.ulProcessor * sizeof(DWORD));
+-    md.rOS = (OSINFO *) _alloca(md.ulOS * sizeof(OSINFO));
++    szName = (LPWSTR) Alloca(cbName * sizeof(WCHAR));
++    md.szLocale = (LPWSTR) Alloca(md.cbLocale * sizeof(WCHAR));
++    md.rProcessor = (DWORD *) Alloca(md.ulProcessor * sizeof(DWORD));
++    md.rOS = (OSINFO *) Alloca(md.ulOS * sizeof(OSINFO));
+ 
+     IfFailThrow(pImport->GetAssemblyRefProps(ar,
+                                              &pbPublicKeyOrToken, &cbPublicKeyOrToken,


Home | Main Index | Thread Index | Old Index