From: Ard Biesheuvel Date: Fri, 31 May 2019 20:46:30 +0000 (+0200) Subject: ArmPkg/ArmSoftFloatLib GCC4x: fix build failure X-Git-Tag: edk2-stable201905~27 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=371e7001e8d5753365f3b6cd05b17e32be62b4f3;ds=sidebyside ArmPkg/ArmSoftFloatLib GCC4x: fix build failure The upstream SoftFloat code that was recently incorporated into ArmSoftFloatLib uses some parameterization to tweak the inlining and optimization behavior for different compilers. The custom platform.h file that sets these parameters is based on the upstream version for Linux/ARM, but was updated to include the 'always_inline' GCC attribute into the INLINE macro, to ensure that all definitions that are marked as inline are not only inlined into their callers, but also to ensure that no version of the function is ever emitted into the object file. This works fine on recent GCC and Clang, but the latter part turns out to break on GCC 4.x, resulting duplicate definition linker errors. Fortunately, the synticatically more appriopriate 'static inline' works fine on both the recent and the older compilers, so let's switch to that instead. Reviewed-by: Leif Lindholm Signed-off-by: Ard Biesheuvel --- diff --git a/ArmPkg/Library/ArmSoftFloatLib/platform.h b/ArmPkg/Library/ArmSoftFloatLib/platform.h index 31e843463a..07800a9d5b 100644 --- a/ArmPkg/Library/ArmSoftFloatLib/platform.h +++ b/ArmPkg/Library/ArmSoftFloatLib/platform.h @@ -5,7 +5,7 @@ */ #define LITTLEENDIAN 1 -#define INLINE inline __attribute__((always_inline)) +#define INLINE static inline #define SOFTFLOAT_BUILTIN_CLZ 1 #define SOFTFLOAT_FAST_INT64 #include "opts-GCC.h"