From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.7858.1585658534681107595 for ; Tue, 31 Mar 2020 05:42:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Wh7X967d; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585658533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lfXTB7q5fBb+Slh3PfI5ata3ZJ+6n9M/O0bMyzLSF14=; b=Wh7X967dxl8duqPt5t9wvXKjIiiy8GXvcKIpx8tuLR9jw6TJg31ZEkZvDrXcb6kUd1S29K eiTy5fYXwPuqktoXCaRhpSdxJly3kG/8CgK9B9mvduFn41edgD2HqPE178U5spYDXjNI7F nZ/faIdOmAf/yKwhEAPSfNOGPUqxC3E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-46-7pOhFHtbNYiljO_JWtF8Iw-1; Tue, 31 Mar 2020 08:42:09 -0400 X-MC-Unique: 7pOhFHtbNYiljO_JWtF8Iw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72875107ACCA; Tue, 31 Mar 2020 12:42:08 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-131.ams2.redhat.com [10.36.115.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 926C096B8B; Tue, 31 Mar 2020 12:42:07 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float. To: Ard Biesheuvel , edk2-devel-groups-io , macarl@microsoft.com References: <03f18a49-6bd6-e753-e1bf-7e061d13f200@redhat.com> <14537.1585603662366515487@groups.io> From: "Laszlo Ersek" Message-ID: <276d435b-4d94-0899-9710-1584d7baeb3c@redhat.com> Date: Tue, 31 Mar 2020 14:42:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/30/20 23:41, Ard Biesheuvel wrote: > On Mon, 30 Mar 2020 at 23:29, Matthew Carlson via 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