From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=98.137.64.202; helo=sonic303-21.consmr.mail.gq1.yahoo.com; envelope-from=nruslan_devel@yahoo.com; receiver=edk2-devel@lists.01.org Received: from sonic303-21.consmr.mail.gq1.yahoo.com (sonic303-21.consmr.mail.gq1.yahoo.com [98.137.64.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E9E17223DB78E for ; Thu, 8 Feb 2018 23:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1518160328; bh=qXinNnWbhqnLXq55aNRY+1j+LeeNEfyodHPFX/ot50c=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=tESJQ2Y14p8HPpAgw317zq3SBtz6dfUFPiXCQRWHSdup/Kq3LosGOHLSEOwOuD/7Kb43ycfWWo1R46JNp/FMMr/a3ea08M/17yuq3ZuscV3VpNYLK33cFiV36lv7tHhiRZ1fDWP0vSteKGEWqOVVWcm5EEc4o6UCcLRYkSSZ+UC1f3QG4H/HgBITn92YsYdFAxH9oEpI1CKPWI5QcWXe/1lvxjg4mcmSx4DIrWrSPftdq00VGKAu2zj7ZA2zYcgPBzOpOIPG895UJi3S7dO1y6kOOH2zD3W5u8QbwvW0ZNlNnOTd/NRT75wXjrzNCRFbs7AoLQKFbsXvDawUmOyM3g== X-YMail-OSG: U9NhVYwVM1n7lsvm.w4B.nUJpdhS9Hz5SgrZD64oa0Tr74mb3tHYGHrJU8z1Fj9 SjJpACPdD9.EZOVCbZya7GTYcWZc5zf.8MlAQDphekGG1l3KNAUy39M6pQ5LZXvk8oYbYTljCs1F GQ6ejRo5fgPehcXOLbVQJr4vDddcINVebzT7EPCg9cAGoWuuWxtl9USysXHMMnQsRLRdLYdJlfAc S5KGrf6929YzG4ciZjeAKl_oF0rF5VPpD.oqsv.NsP52BxSoMCVHXOy8lS7r86WNc_DRzafkRq2j AnNjpfVyC0ATKgSyLoGxjrJSbPKABJy02NgcpLDubN6_jkDK8TEw1kBnRfhbrAwK65yTu_lGV0wr qqLoj1vxzNKq6nttQQEg7oywdPtz4iLOlvsMOm_bNU05zw5hOKOqx.Py7KsV5HSqd_uTuEYirfbq BsKjtInba4kkRR.KWh4fEyozTTj7dd6dyqYiYhx0y98nmZ2t9LYK_Ki0ObMAaOGnCOQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Fri, 9 Feb 2018 07:12:08 +0000 Date: Fri, 9 Feb 2018 07:12:07 +0000 (UTC) From: Ruslan Nikolaev Reply-To: Ruslan Nikolaev To: "edk2-devel@lists.01.org" Message-ID: <409605137.4680848.1518160327442@mail.yahoo.com> In-Reply-To: <113792737.4648564.1518159755787@mail.yahoo.com> References: <774033816.4534639.1518139941905.ref@mail.yahoo.com> <774033816.4534639.1518139941905@mail.yahoo.com> <339D4678-56CB-4195-AD81-9AE7D0CA2B13@apple.com> <113792737.4648564.1518159755787@mail.yahoo.com> MIME-Version: 1.0 X-Mailer: WebService/1.1.11316 YahooMailNeo Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: Patch to fix EFIAPI definition X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2018 07:06:24 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, what I was implying is that if MdePkg (Ia32) headers are included in = some UEFI program which itself is compiled with some custom register-based = calling convention, current EFIAPI definition is insufficient. Current definition with cdecl attribute merely forces caller stack clean-u= p in gcc/clang for Ia32 So, if I build with '-mrtd' option (a callee cleans up the stack) current = EFIAPI definition will take care of it. However, if in addition to that I s= pecify -mregparm=3D1,2,3 to pass some parameters in registers, cdecl will n= ot take care of it. EFIAPI for Ia32 wants all parameters in the stack. Therefore, it should be= reasonable to specify regparm(0) as part of EFIAPI definition as well, so = that regardless of mregparm parameter the compiler will generate correct co= de.=20 On Friday, February 9, 2018 1:59 AM, Andrew Fish wro= te: =20 =20 On Feb 8, 2018, at 5:32 PM, Ruslan Nikolaev wrot= e: I submitted a bug report and a patch: https://bugzilla.tianocore.org/show_= bug.cgi?id=3D870 It is very straight-forward. Can someone review it, and, hopefully, commit= the change? Ruslan, Was there an example of how to code this? Sorry if I missed it, I'm gettin= g a lot of email these days. Also what is you usage model? Clang is very cross compiler friendly and yo= u can specify a triple to support the ABI you need. To get EFI supported on= macOS tools we ended up open sourcing a triple to support the EFIAPI. If y= ou look in=C2=A0https://github.com/tianocore/edk2/blob/master/BaseTools/Con= f/tools_def.template=C2=A0you will see that you can use Xcode to build EFIA= PI if you pass=C2=A0-target x86_64-pc-win32-macho.=C2=A0 I guess I'm asking the question if you really need to support multiple ABI= s with clang? The best way to solve this in clang is to make it support EFI= API. If you don't need multiple ABIs take a look at what we did with -targe= t x86_64-pc-win32-macho, which tells clang to build EFIABI, but output a ma= ch-O executable (we need the mach-O for our debugger). Basically with clang= you could upstream what you need into the compiler you are using for other= things... Thanks, Andrew Fish - Ruslan _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel =20 >>From afish@apple.com Thu Feb 8 23:11:24 2018 Return-Path: X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity