From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web08.5879.1646216830289989572 for ; Wed, 02 Mar 2022 02:27:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRWwN3D2; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646216829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h1UfPBFUtsFlBB/D7GT3zB1BV8AZMIZ9OKKnsd8kdgg=; b=NRWwN3D2E98cKNUvObdP47u2ZX35A/OzSWv1BmWbGE8oSDzH3hWmfsG+pxz8zJCuMcxbKY LcSrXFe9ZmQzIwVRg1dm73H1L3ZkjeiRKQLWLsvf3kjLXlVvUqDq4LXcmsYIDo3kJaaq08 8Xwv1uc7rmn+FO/eLJeZSyNnxRR9lAI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-49-G2xYGPAjPR2wu79jiBGeIg-1; Wed, 02 Mar 2022 05:27:05 -0500 X-MC-Unique: G2xYGPAjPR2wu79jiBGeIg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74461801DDC; Wed, 2 Mar 2022 10:27:00 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B97D6FB03; Wed, 2 Mar 2022 10:26:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9D8591800605; Wed, 2 Mar 2022 11:10:14 +0100 (CET) Date: Wed, 2 Mar 2022 11:10:14 +0100 From: "Gerd Hoffmann" To: Kilian Kegel Cc: "devel@edk2.groups.io" , "jiewen.yao@intel.com" , "Gao, Liming" , "Lu, Xiaoyu1" , "Feng, Bob C" , 'Rebecca Cran' , 'James Bottomley' , 'Sami Mujawar' , "Justen, Jordan L" , "Aktas, Erdem" , 'Supreeth Venkatesh' , "Boeuf, Sebastien" , "Gao, Zhichao" , "Liu, Zhiguang" , 'Maciej Rabeda' , "Ma, Maurice" , 'Andrew Fish' , 'Ard Biesheuvel' , 'Tom Lendacky' , 'Peter Grehan' , 'Sean Brogan' , "Jiang, Guomin" , 'Bret Barkelew' , "Chen, Christine" , "You, Benjamin" , "Schaefer, Daniel" , "Kinney, Michael D" , "Xu, Wei6" , "Wang, Jian J" , "Wu, Jiaxin" , "Fu, Siyuan" , "Dong, Guo" , "kilian_kegel@hotmail.com" , "Chang, Abner" , 'Oliver Steffen' , 'Leif Lindholm' , 'Brijesh Singh' , "Xu, Min M" , "Ni, Ray" , 'Alexei Fedorov' , 'Julien Grall' , "Wang, Nickle" , 'Pawel Polawski' , 'Anthony Perard' Subject: Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics Message-ID: <20220302101014.rdh2aeksifrj3zqe@sirius.home.kraxel.org> References: <20220301071820.3135133-1-kraxel@redhat.com> <041201d82dda$1b1bd940$51538bc0$@byosoft.com.cn> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Mar 02, 2022 at 08:39:28AM +0000, Kilian Kegel wrote: > Hi Gerd, > > additionally I would suggest once more to adjust the DLINK_FLAGS in tools_def.txt to hold CompilerNameINTRIN32/64.LIB as a search library > as already introduced in https://edk2.groups.io/g/devel/message/86072?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Ckilian%2C20%2C2%2C0%2C87479913 > (here is the entire thread https://edk2.groups.io/g/devel/message/86334?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Cposterid%3A2193857%2C20%2C2%2C0%2C87479913) > > In that case you don’t need to take the IntrinsicLibrary into the .INF file, because the intrinsic library is in the compiler’s library search path. > That has annoyed UEFI developers world wide for more that a decade. Having to add the IntrinsicLibrary to the .inf file is annoying indeed. Just using the compiler intrinsics doesn't work in all cases though, so I see no way around providing our own intrinsics library. > With your solution can you compile + link the body of main() given below in a PEI driver on all targets? > Really? Nope. These patches simply move the existing intrinsics from ArmPkg and CryptoPkg as starting point. They are known to be incomplete. I expect we'll add more functions as needed in the future. We can surely debate if and how we can use the compiler's intrinsic library instead our own implementation for the cases where it works. Having a core intrinsics lib should actually make that kind changes easier, There will be one central place where you can tweak which intrinsic functions are provided by edk2, so coordinating that with DLINK_FLAGS updates should be easier than today. take care, Gerd