public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"lersek@redhat.com" <lersek@redhat.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"macarl@microsoft.com" <macarl@microsoft.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float.
Date: Tue, 31 Mar 2020 14:36:48 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5B9EF1F47@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <276d435b-4d94-0899-9710-1584d7baeb3c@redhat.com>

ARM and AARCH64 have a compiler intrinsic lib that is linked against all modules.

[LibraryClasses.ARM, LibraryClasses.AARCH64]
  #
  # It is not possible to prevent ARM compiler calls to generic intrinsic functions.
  # This library provides the instrinsic functions generated by a given compiler.
  # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
  #
  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

Can we use this same technique for IA32/X64 VS builds?

Mike


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On
> Behalf Of Laszlo Ersek
> Sent: Tuesday, March 31, 2020 5:42 AM
> To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; edk2-
> devel-groups-io <devel@edk2.groups.io>;
> macarl@microsoft.com
> Subject: Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib:
> Add FltUsedLib for float.
> 
> On 03/30/20 23:41, Ard Biesheuvel wrote:
> > On Mon, 30 Mar 2020 at 23:29, Matthew Carlson via
> Groups.Io
> > <macarl=microsoft.com@groups.io> wrote:
> >>
> >> So it's not required by OpenSSL, it's required by the
> compiler whenever floating point is used, which can be in
> multiple places. For example, this is used in mu_plus
> (the Microsoft UEFI value add to EDK2) by the
> OnScreenKeyboard driver as well as the UiToolKit driver.
> 
> OK, so this is the part that was not obvious to me. This
> is basically
> code that exists on top of edk2 (consumes edk2) *AND*
> uses floating
> point *internally*.
> 
> > If you happen to use BaseCryptLib or the intrinsic in a
> driver that happens to need crypto as well, it can break
> due to multiple.
> >>
> >> I do agree, this only applies to MSVC and requiring
> every platform to add a line in their DSC would be a
> situation I would prefer to avoid if possible. Is there a
> way to specify a library dependency only if a toolchain
> is being used?
> >
> > Yes, so this either belongs in one of the
> IntrinsicsLibs we have, or
> > in the various Entrypoint libraries we have for PEIMs,
> DXEs, etc.
> >
> > However, given that we are talking about static
> libraries here, adding
> > a source file that *only* defines __fltused (and
> nothing else) to any
> > library should also work, as the resulting object file
> will only be
> > incorporated by the linker if it is needed to satisfy a
> symbol
> > dependency, and so it can never cause a conflict if it
> is the only
> > symbol in the object.
> 
> IMO: if edk2 intends to support out-of-tree modules that
> themselves
> utilize floating point, *with or without* a dependency on
> OpensslLib,
> then we should add Ard's suggestion:
> 
>  [Sources]
> +  FloatUsed.c         | MSFT
> 
> to some of the "most core" edk2 library instances, i.e.
> those that *all*
> modules of the given module type inevitably depend on.
> The entry point
> libs look like a great idea to me.
> 
> That should link the _fltused external definition exactly
> once into all
> modules built with MSVC, regardless of whether each such
> module uses
> floating point or not.
> 
> Thanks
> Laszlo
> 
> 
> 


  reply	other threads:[~2020-03-31 14:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30  8:52 [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float Guomin Jiang
2020-03-30  9:02 ` [edk2-devel] " Ard Biesheuvel
2020-03-30 19:04   ` Laszlo Ersek
2020-03-30 21:27     ` Matthew Carlson
2020-03-30 21:41       ` Ard Biesheuvel
2020-03-31 12:42         ` Laszlo Ersek
2020-03-31 14:36           ` Michael D Kinney [this message]
2020-03-31 22:29             ` Laszlo Ersek
2020-03-31 22:57               ` Sean
2020-03-31 23:36                 ` Michael D Kinney
2020-04-01  6:42             ` Ard Biesheuvel
2020-04-01 16:38               ` Michael D Kinney
2020-04-14  5:02                 ` Ni, Ray
2020-04-14  7:01                   ` Guomin Jiang
2020-04-17  8:15                     ` Ard Biesheuvel
2020-04-23  2:36                       ` Guomin Jiang
     [not found]                   ` <16059D94172527B2.17445@groups.io>
2020-04-23  1:33                     ` Guomin Jiang
2020-04-23  3:31                       ` Ni, Ray
2020-04-23  4:04                         ` Guomin Jiang
2020-04-23  5:49                           ` Liming Gao
2020-04-24  5:07                             ` Guomin Jiang
2020-04-26 15:32                               ` Liming Gao
2020-04-27  2:32                                 ` Ni, Ray
2020-03-31  1:40     ` Guomin Jiang
2020-03-31  7:13       ` Ard Biesheuvel
2020-03-31 12:32         ` Laszlo Ersek
2020-03-30 16:55 ` [EXTERNAL] " Bret Barkelew

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=E92EE9817A31E24EB0585FDF735412F5B9EF1F47@ORSMSX113.amr.corp.intel.com \
    --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