From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=69.167.158.73; helo=host12.webserveralpha.com; envelope-from=edk2-lists@mc2research.org; receiver=edk2-devel@lists.01.org Received: from host12.webserveralpha.com (host12.webserveralpha.com [69.167.158.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B7A182034A8A2 for ; Fri, 19 Jan 2018 17:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mc2research.org; s=default; h=Content-Type:MIME-Version:Message-ID:Date: Subject:In-Reply-To:References:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zOxzJS+RK1FLIfRCbRZtZ+TDlD9v3wXbgpQNqi/1rZQ=; b=JIchBzdJi7EpNF4RK37J0Iwz6 YgmCtWiAvNBH7hVbLSBFrPHHXdkhGrx7zSZrKO4N9nRXRfHt15JgVEFuCShcBml8q028lryomfGhR tasFiGydst0SSKTRn1NeJpMTM/; Received: from mobile-166-176-186-97.mycingular.net ([166.176.186.97]:20432 helo=Willow) by host12.webserveralpha.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1eciJL-0000PU-1N; Fri, 19 Jan 2018 20:51:11 -0500 From: "Daryl McDaniel \(EDK2 Lists\)" To: "'Marco Guerri'" , References: <026e01d3907f$82953820$87bfa860$@mc2research.org> <1516296479.3148418.1240030384.210CDE2C@webmail.messagingengine.com> In-Reply-To: <1516296479.3148418.1240030384.210CDE2C@webmail.messagingengine.com> Date: Fri, 19 Jan 2018 17:51:10 -0800 Organization: Micronetics Message-ID: <03db01d39191$25dcd030$71967090$@mc2research.org> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQEapzMJMEVYFfH2Zup4fUlGhmstPQEOKqtOAWd86J6k2iQ4gA== X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host12.webserveralpha.com X-AntiAbuse: Original Domain - lists.01.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mc2research.org X-Get-Message-Sender-Via: host12.webserveralpha.com: authenticated_id: darylm@mc2research.com X-Authenticated-Sender: host12.webserveralpha.com: darylm@mc2research.com X-Source: X-Source-Args: X-Source-Dir: X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: [tianocore/edk2] Stdlib: Add calling convention to completion callbacks (#123) 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: Sat, 20 Jan 2018 01:45:50 -0000 Content-Language: en-us Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Marco, =20 The tools definitions for the newer versions of GCC must not be setting = the option to force the EFIAPI calling conventions. We relied upon the compiler option for StdLib in order to enhance = portability for POSIX sources. =20 I=E2=80=99ll research what the tools definitions are for the newer GCC = versions then readdress your patches. =20 Thank you, Daryl McDaniel =20 =20 From: Marco Guerri [mailto:marco.guerri.dev@fastmail.com]=20 Sent: Thursday, January 18, 2018 9:28 AM To: Daryl McDaniel (EDK2 Lists) ; = edk2-devel@lists.01.org Subject: Re: [tianocore/edk2] Stdlib: Add calling convention to = completion callbacks (#123) =20 Hi Daryl, =20 First, sorry for not having RTFM and submitting the patch via github. I = was planning to read your workflow during the weekend and re-submit via = the mailing list. =20 Second, I am using gcc. I tried gcc 4.8 and 5.2 and with both, my = applications using Stdlib badly hang. I dug a bit and discovered that = the signatures of the completion callbacks are missing EFIAPI, so = necessarily under Unix systems they are using the wrong ABI. When the = functions arguments are pointers, the machine ends up in a triple fault = I guess (I can clearly see that the first two integer parameters are = fetched from %rdi and %rsi, which is the SysV ABI). I was a bit = surprised to see this bug, as the buildscripts are pretty comprehensive = in terms of compilers support. Does this make sense to you? =20 Cheers, Marco =20 -- Marco Guerri marco.guerri.dev@fastmail.com =20 =20 =20 =20 On Thu, Jan 18, 2018, at 11:12 AM, Daryl McDaniel (EDK2 Lists) wrote: Marco, =20 Thank you for your submission. =20 Can you please tell me which compiler you are using? =20 Thank you, Daryl McDaniel =20 =20 From: Marco Guerri [mailto:notifications@github.com]=20 Sent: Wednesday, January 17, 2018 7:22 AM To: tianocore/edk2 > Cc: Subscribed > Subject: [tianocore/edk2] Stdlib: Add calling convention to completion = callbacks (#123) =20 When compiling in Unix environments, the ABI defaults to SysV. Callbacks are invoked directly by the system firmware so they must necessarily use MS ABI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marco Guerri marco.guerri.dev@fastmail.com = =20 _____ =20 =20 You can view, comment on, or merge this pull request online at: https://github.com/tianocore/edk2/pull/123 Commit Summary * Stdlib: Add calling convention to completion callbacks File Changes * M StdLib/EfiSocketLib/Ip4.c = (10) * M StdLib/EfiSocketLib/Socket.h = (24) * M StdLib/EfiSocketLib/Tcp4.c = (11) * M StdLib/EfiSocketLib/Tcp6.c = (3) * M StdLib/EfiSocketLib/Udp4.c = (30) * M StdLib/EfiSocketLib/Udp6.c = (20) Patch Links: * https://github.com/tianocore/edk2/pull/123.patch * https://github.com/tianocore/edk2/pull/123.diff =E2=80=94 You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub = , or mute the thread = . = =20 =20