Skip to content

Commit a7c88a2

Browse files
authored
Fix build on alpine arm64 (#102953)
1 parent 5cbc38c commit a7c88a2

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

src/coreclr/pgosupport.cmake

-6
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ function(add_pgo TargetName)
2424
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
2525
target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-generate)
2626
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fprofile-instr-generate")
27-
if(NOT LD_LLVM)
28-
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=gold")
29-
endif()
3027
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
3128
endif(CLR_CMAKE_HOST_WIN32)
3229
elseif(CLR_CMAKE_PGO_OPTIMIZE AND NOT CLR_CMAKE_ENABLE_SANITIZERS)
@@ -59,9 +56,6 @@ function(add_pgo TargetName)
5956
if(HAVE_LTO)
6057
target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-use=${ProfilePath} -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled)
6158
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fprofile-instr-use=${ProfilePath}")
62-
if(NOT LD_LLVM)
63-
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=gold")
64-
endif()
6559
add_compile_definitions(WITH_NATIVE_PGO)
6660
else(HAVE_LTO)
6761
message(WARNING "LTO is not supported, skipping profile guided optimizations")

src/coreclr/vm/arm64/cgencpu.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ inline TADDR GetMem(PCODE address, SIZE_T size, bool signExtend)
304304
}
305305
EX_CATCH
306306
{
307-
mem = NULL;
307+
mem = 0;
308308
_ASSERTE(!"Memory read within jitted Code Failed, this should not happen!!!!");
309309
}
310310
EX_END_CATCH(SwallowAllExceptions);

src/coreclr/vm/arm64/stubs.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
295295
context.X27 = unwoundstate->captureX19_X29[8] = baseState->captureX19_X29[8];
296296
context.X28 = unwoundstate->captureX19_X29[9] = baseState->captureX19_X29[9];
297297
context.Fp = unwoundstate->captureX19_X29[10] = baseState->captureX19_X29[10];
298-
context.Lr = NULL; // Filled by the unwinder
298+
context.Lr = 0; // Filled by the unwinder
299299

300300
context.Sp = baseState->captureSp;
301301
context.Pc = baseState->captureIp;
@@ -316,7 +316,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
316316
nonVolContextPtrs.X27 = &unwoundstate->captureX19_X29[8];
317317
nonVolContextPtrs.X28 = &unwoundstate->captureX19_X29[9];
318318
nonVolContextPtrs.Fp = &unwoundstate->captureX19_X29[10];
319-
nonVolContextPtrs.Lr = NULL; // Filled by the unwinder
319+
nonVolContextPtrs.Lr = 0; // Filled by the unwinder
320320

321321
#endif // DACCESS_COMPILE
322322

@@ -464,7 +464,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
464464
pRD->pCurrentContext->X27 = (DWORD64)(pUnwoundState->captureX19_X29[8]);
465465
pRD->pCurrentContext->X28 = (DWORD64)(pUnwoundState->captureX19_X29[9]);
466466
pRD->pCurrentContext->Fp = (DWORD64)(pUnwoundState->captureX19_X29[10]);
467-
pRD->pCurrentContext->Lr = NULL; // Unwind again to get Caller's PC
467+
pRD->pCurrentContext->Lr = 0; // Unwind again to get Caller's PC
468468

469469
pRD->pCurrentContextPointers->X19 = &pRD->pCurrentContext->X19;
470470
pRD->pCurrentContextPointers->X20 = &pRD->pCurrentContext->X20;
@@ -503,7 +503,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
503503
pRD->pCurrentContext->X27 = (DWORD64)(m_MachState.unwoundX19_X29[8]);
504504
pRD->pCurrentContext->X28 = (DWORD64)(m_MachState.unwoundX19_X29[9]);
505505
pRD->pCurrentContext->Fp = (DWORD64)(m_MachState.unwoundX19_X29[10]);
506-
pRD->pCurrentContext->Lr = NULL; // Unwind again to get Caller's PC
506+
pRD->pCurrentContext->Lr = 0; // Unwind again to get Caller's PC
507507
#else // __APPLE__
508508
pRD->pCurrentContext->X19 = *m_MachState.ptrX19_X29[0];
509509
pRD->pCurrentContext->X20 = *m_MachState.ptrX19_X29[1];
@@ -516,7 +516,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
516516
pRD->pCurrentContext->X27 = *m_MachState.ptrX19_X29[8];
517517
pRD->pCurrentContext->X28 = *m_MachState.ptrX19_X29[9];
518518
pRD->pCurrentContext->Fp = *m_MachState.ptrX19_X29[10];
519-
pRD->pCurrentContext->Lr = NULL; // Unwind again to get Caller's PC
519+
pRD->pCurrentContext->Lr = 0; // Unwind again to get Caller's PC
520520
#endif // __APPLE__
521521

522522
#if !defined(DACCESS_COMPILE)
@@ -531,7 +531,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
531531
pRD->pCurrentContextPointers->X27 = m_MachState.ptrX19_X29[8];
532532
pRD->pCurrentContextPointers->X28 = m_MachState.ptrX19_X29[9];
533533
pRD->pCurrentContextPointers->Fp = m_MachState.ptrX19_X29[10];
534-
pRD->pCurrentContextPointers->Lr = NULL; // Unwind again to get Caller's PC
534+
pRD->pCurrentContextPointers->Lr = 0; // Unwind again to get Caller's PC
535535
#endif
536536

537537
ClearRegDisplayArgumentAndScratchRegisters(pRD);

0 commit comments

Comments
 (0)