]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmSoftFloatLib GCC4x: fix build failure
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 31 May 2019 20:46:30 +0000 (22:46 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 1 Jun 2019 07:57:32 +0000 (09:57 +0200)
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 <leif.lindholm@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Library/ArmSoftFloatLib/platform.h

index 31e843463a38bd8f8402b67cd2acb08511f7072d..07800a9d5b791da6e08af26ca1ce3dec52532b9e 100644 (file)
@@ -5,7 +5,7 @@
  */\r
 \r
 #define LITTLEENDIAN 1\r
-#define INLINE inline __attribute__((always_inline))\r
+#define INLINE static inline\r
 #define SOFTFLOAT_BUILTIN_CLZ 1\r
 #define SOFTFLOAT_FAST_INT64\r
 #include "opts-GCC.h"\r