Skip to content

Commit

Permalink
Merge pull request dotnet#2474 from gkhanna79/FixArm64
Browse files Browse the repository at this point in the history
Arm64 build fixes
  • Loading branch information
gkhanna79 committed Jan 4, 2016
2 parents 0c8a1ba + 438268f commit 85f256e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,10 @@ if (WIN32)
add_compile_options($<$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>:/GL>)
add_compile_options($<$<OR:$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>,$<CONFIG:Checked>>:/O1>)

if (IS_64BIT_BUILD EQUAL 1)
if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
# The generator expression in the following command means that the /homeparams option is added only for debug builds
add_compile_options($<$<CONFIG:Debug>:/homeparams>) # Force parameters passed in registers to be written to the stack
endif (IS_64BIT_BUILD EQUAL 1)
endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)

# Linker flags
#
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if /i "%__BuildArch%" == "arm64" (

REM TODO, remove once the toolset is open.
if /i "%__BuildArch%" == "arm64" set PATH=%PATH%;%__ToolsetDir%\cpp\bin
if /i "%__BuildArch%" == "arm64" set LIB=%__ToolsetDir%\OS\lib
if /i "%__BuildArch%" == "arm64" set LIB=%__ToolsetDir%\OS\lib;%__ToolsetDir%\cpp\lib
if /i "%__BuildArch%" == "arm64" set INCLUDE=%__ToolsetDir%\cpp\inc;%__ToolsetDir%\OS\inc\Windows;%__ToolsetDir%\OS\inc\Windows\crt;%__ToolsetDir%\cpp\inc\vc;%__ToolsetDir%\OS\inc\win8;

if /i "%__BuildArch%" == "arm64" goto GenVSSolution
Expand Down
12 changes: 11 additions & 1 deletion src/gc/env/gcenv.base.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@ typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(void* lpThreadParameter);
extern "C" void __emit(const unsigned __int32 opcode);
#pragma intrinsic(__emit)
#define MemoryBarrier() { __emit(0xF3BF); __emit(0x8F5F); }


#elif defined(_ARM64_)

extern "C" void __yield(void);
#pragma intrinsic(__yield)
__forceinline void YieldProcessor() { __yield();}

extern "C" void __dmb(const unsigned __int32 _Type);
#pragma intrinsic(__dmb)
#define MemoryBarrier() { __dmb(_ARM64_BARRIER_SY); }

#elif defined(_AMD64_)

extern "C" VOID
Expand Down

0 comments on commit 85f256e

Please sign in to comment.