public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: devel@edk2.groups.io, Laszlo Ersek <lersek@redhat.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: Re: [PATCH] ArmPkg/ArmSoftFloatLib GCC4x: fix build failure
Date: Fri, 31 May 2019 22:12:32 +0100	[thread overview]
Message-ID: <20190531211232.h6giwqjzkqh4dqdn@bivouac.eciton.net> (raw)
In-Reply-To: <20190531210115.29818-1-ard.biesheuvel@linaro.org>

On Fri, May 31, 2019 at 11:01:15PM +0200, Ard Biesheuvel wrote:
> 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 in 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.

Oh yeah, I knew that, and completely missed it when reviewing.

This behaviour hasn't actually changed substantially in later versions
of GCC. I bet all that's saving us there is LTO :)

> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: "Gao, Liming" <liming.gao@intel.com>
> Cc: "Wang, Jian J" <jian.j.wang@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  ArmPkg/Library/ArmSoftFloatLib/platform.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Library/ArmSoftFloatLib/platform.h b/ArmPkg/Library/ArmSoftFloatLib/platform.h
> index 31e843463a38..07800a9d5b79 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"
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-05-31 21:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 21:01 [PATCH] ArmPkg/ArmSoftFloatLib GCC4x: fix build failure Ard Biesheuvel
2019-05-31 21:12 ` Leif Lindholm [this message]
2019-06-01  7:58   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190531211232.h6giwqjzkqh4dqdn@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox