From 82df618711c596d3b6164e790572c795b7ea4dcc Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 11 Aug 2016 20:13:31 +0200 Subject: [PATCH] MdePkg RVCT: add definition of UNREACHABLE The RVCT compiler in --gnu mode appears to simply strip of the __builtin prefix when it encounters calls to __builtin_xxx() functions, and so the __builtin_unreachable() we emit for GCC results in linker errors regarding undefined references against 'unreachable()'. So define UNREACHABLE() to a NOP instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Liming Gao --- MdePkg/Include/Arm/ProcessorBind.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MdePkg/Include/Arm/ProcessorBind.h b/MdePkg/Include/Arm/ProcessorBind.h index c2482c2f50..5ee7465c05 100644 --- a/MdePkg/Include/Arm/ProcessorBind.h +++ b/MdePkg/Include/Arm/ProcessorBind.h @@ -28,6 +28,13 @@ #pragma pack() #endif +// +// RVCT does not support the __builtin_unreachable() macro +// +#ifdef __ARMCC_VERSION +#define UNREACHABLE() +#endif + #if _MSC_EXTENSIONS // // use Microsoft* C complier dependent integer width types -- 2.39.2