Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jem-patel committed Dec 8, 2022
1 parent 31530c6 commit e774704
Show file tree
Hide file tree
Showing 7 changed files with 455 additions and 35 deletions.
23 changes: 10 additions & 13 deletions external/buildscripts/build_win_no_cygwin.pl
Expand Up @@ -141,10 +141,10 @@
# sgen as default exe
copy("$monoroot/msvc/build/sgen/$archNameForBuild/bin/$configDirName/mono-sgen.exe", "$monoprefix/bin/mono.exe") or die ("failed copying mono-sgen.exe to mono.exe\n");
}
copy("$monoroot/msvc/build/boehm/$archNameForBuild/bin/$configDirName/MonoPosixHelper.dll", "$monoprefix/bin/.") or die ("failed copying MonoPosixHelper.dll\n");
copy("$monoroot/msvc/build/boehm/$archNameForBuild/bin/$configDirName/MonoPosixHelper.pdb", "$monoprefix/bin/.") or die ("failed copying MonoPosixHelper.pdb\n");
copy("$monoroot/msvc/build/boehm/$archNameForBuild/bin/$configDirName/MonoPosixHelper.dll", "$monoprefix/bin/.") or die ("failed copying MonoPosixHelper.dll\n");
copy("$monoroot/msvc/build/boehm/$archNameForBuild/bin/$configDirName/MonoPosixHelper.pdb", "$monoprefix/bin/.") or die ("failed copying MonoPosixHelper.pdb\n");
}
system("xcopy /y /f $addtoresultsdistdir\\bin\\*.* $monoprefix\\bin\\") eq 0 or die ("Failed copying $addtoresultsdistdir/bin to $monoprefix/bin\n");
}
Expand Down Expand Up @@ -231,13 +231,10 @@
{
copy("$monoprefix/bin/mono-2.0-sgen.dll", "$embedDirArchDestination/.") or die ("failed copying mono-2.0-sgen.dll\n");
copy("$monoprefix/bin/mono-2.0-sgen.pdb", "$embedDirArchDestination/.") or die ("failed copying mono-2.0-sgen.pdb\n");
}
copy("$monoprefix/bin/MonoPosixHelper.dll", "$embedDirArchDestination/.") or die ("failed copying MonoPosixHelper.dll\n");
copy("$monoprefix/bin/MonoPosixHelper.pdb", "$embedDirArchDestination/.") or die ("failed copying MonoPosixHelper.pdb\n");
copy("$monoprefix/bin/MonoPosixHelper.dll", "$embedDirArchDestination/.") or die ("failed copying MonoPosixHelper.dll\n");
copy("$monoprefix/bin/MonoPosixHelper.pdb", "$embedDirArchDestination/.") or die ("failed copying MonoPosixHelper.pdb\n");
if($targetArch ne 'ARM64')
{
# monodistribution directory setup
print(">>> Creating monodistribution directory\n");
Expand All @@ -250,11 +247,11 @@
copy("$monoprefix/bin/mono-sgen.exe", "$distDirArchBin/.") or die ("failed copying mono-sgen.exe\n");
copy("$monoprefix/bin/mono-bdwgc.exe", "$distDirArchBin/.") or die ("failed copying mono-bdwgc.exe\n");
copy("$monoprefix/bin/mono.exe", "$distDirArchBin/.") or die ("failed copying mono.exe\n");
copy("$monoprefix/bin/MonoPosixHelper.dll", "$distDirArchBin/.") or die ("failed copying MonoPosixHelper.dll\n");
copy("$monoprefix/bin/MonoPosixHelper.pdb", "$distDirArchBin/.") or die ("failed copying MonoPosixHelper.pdb\n");
}
copy("$monoprefix/bin/MonoPosixHelper.dll", "$distDirArchBin/.") or die ("failed copying MonoPosixHelper.dll\n");
copy("$monoprefix/bin/MonoPosixHelper.pdb", "$distDirArchBin/.") or die ("failed copying MonoPosixHelper.pdb\n");
# Output version information
print(">>> Creating version file : $versionsOutputFile\n");
open(my $fh, '>', $versionsOutputFile) or die "Could not open file '$versionsOutputFile' $!";
Expand Down
2 changes: 1 addition & 1 deletion mono/metadata/coree.c
Expand Up @@ -630,7 +630,7 @@ STDAPI MonoFixupCorEE(HMODULE ModuleHandle)
#if defined(_M_IA64)
ProcRva = (DWORD)((DWORD_PTR)PLabel - (DWORD_PTR)DosHeader);
*(PLabel)++ = *ExportFixup->ProcAddress.PLabel;
#elif defined(_M_AMD64)
#elif defined(_M_AMD64)
ProcRva = (DWORD)((DWORD_PTR)Trampoline - (DWORD_PTR)DosHeader);
/* mov r11, ExportFixup->ProcAddress */
*(Trampoline)++ = 0x49;
Expand Down
18 changes: 9 additions & 9 deletions mono/mini/mini-amd64.h
Expand Up @@ -71,19 +71,19 @@ typedef BOOLEAN (WINAPI* RtlDeleteFunctionTablePtr)(
// instead of RtlInstallFunctionTableCallback. This gives us the benefit to
// include all needed unwind upon registration.
typedef DWORD (NTAPI* RtlAddGrowableFunctionTablePtr)(
PVOID * DynamicTable,
PRUNTIME_FUNCTION FunctionTable,
DWORD EntryCount,
DWORD MaximumEntryCount,
ULONG_PTR RangeBase,
ULONG_PTR RangeEnd);
PVOID * DynamicTable,
PRUNTIME_FUNCTION FunctionTable,
DWORD EntryCount,
DWORD MaximumEntryCount,
ULONG_PTR RangeBase,
ULONG_PTR RangeEnd);

typedef VOID (NTAPI* RtlGrowFunctionTablePtr)(
PVOID DynamicTable,
DWORD NewEntryCount);
PVOID DynamicTable,
DWORD NewEntryCount);

typedef VOID (NTAPI* RtlDeleteGrowableFunctionTablePtr)(
PVOID DynamicTable);
PVOID DynamicTable);

#endif /* HOST_WIN32 */

Expand Down
9 changes: 2 additions & 7 deletions mono/mini/mini-arm64.h
Expand Up @@ -27,25 +27,20 @@

#define MONO_CONTEXT_SET_LLVM_EXC_REG(ctx, exc) do { (ctx)->regs [0] = (gsize)exc; } while (0)

/*
* __builtin_frame_address () is broken on some older gcc versions in the presence of
* frame pointer elimination, see bug #82095.
*/

#ifdef HOST_WIN32
#define MONO_INIT_CONTEXT_FROM_FUNC(ctx, func) do { \
guint64 stackptr; \
stackptr = ((guint64)_AddressOfReturnAddress () - sizeof (void*));\
MONO_CONTEXT_SET_IP ((ctx), (func)); \
MONO_CONTEXT_SET_BP ((ctx), stackptr); \
MONO_CONTEXT_SET_SP ((ctx), stackptr); \
} while (0)
} while (0)
#else
#define MONO_INIT_CONTEXT_FROM_FUNC(ctx,func) do { \
MONO_CONTEXT_SET_BP ((ctx), __builtin_frame_address (0)); \
MONO_CONTEXT_SET_SP ((ctx), __builtin_frame_address (0)); \
MONO_CONTEXT_SET_IP ((ctx), (func)); \
} while (0)
} while (0)
#endif /* HOST_WIN32 */

#define MONO_ARCH_INIT_TOP_LMF_ENTRY(lmf)
Expand Down
4 changes: 2 additions & 2 deletions mono/mini/mini-windows.c
Expand Up @@ -386,7 +386,7 @@ install_custom_handler (const char *handlers, size_t *handler_arg_len)
void
mono_runtime_install_handlers (void)
{
#if !defined(MONO_CROSS_COMPILE)
#ifndef MONO_CROSS_COMPILE
win32_seh_init();
win32_seh_set_handler(SIGFPE, mono_sigfpe_signal_handler);
win32_seh_set_handler(SIGILL, mono_crashing_signal_handler);
Expand Down Expand Up @@ -437,7 +437,7 @@ mono_runtime_install_custom_handlers_usage (void)
void
mono_runtime_cleanup_handlers (void)
{
#if !defined(MONO_CROSS_COMPILE)
#ifndef MONO_CROSS_COMPILE
win32_seh_cleanup();
#endif
}
Expand Down

0 comments on commit e774704

Please sign in to comment.