From patchwork Wed Aug 6 14:02:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 34975 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7015B20523 for ; Wed, 6 Aug 2014 14:03:38 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id le20sf7084708vcb.1 for ; Wed, 06 Aug 2014 07:03:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:cc:subject:precedence :reply-to:list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type; bh=lkrznQiarYeidMp6PjCbF+PtKFvaGIxieYwrWVf2zMo=; b=PXC5iiI34AqA7GMfjaU/ohC+aIG73YzCmlMLybVYzSfVrTv3yMlYs8COWANPZE2xOo tkH+Vm1p2Z68cylT5O/87ZYnI4J6zxXufb6fzFZAWniFhhIr38VtnnJ0Vu+T4cu8qvdU sbSvNvKrtWKa56HgWihmG6Ty5bly5ddXogedqTLqKABMmCP83Ed/yg79z2BvLhktz4Q4 Y34/DUd+wqDAvPQLcZ8s9nx63aMYxPqfTdrHSxKLnRDt+n7V23BnkE+XCLSZnDI9R4jZ urpBe5/bQ8mrN/unIGNb3kyzNLhVYUIxxewO/NMQ1+xfbwx8PxcvBC7Qch8lP4NyaXfb QPQQ== X-Gm-Message-State: ALoCoQkix1yxAn7DdjX9RyaDRkvBPVKhj9TmpTTrh5u2TRAW8NWRecwHQKsSNrCd+i7qMwXb3BWC X-Received: by 10.236.61.36 with SMTP id v24mr5739906yhc.24.1407333818250; Wed, 06 Aug 2014 07:03:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.13 with SMTP id f13ls148962qge.65.gmail; Wed, 06 Aug 2014 07:03:38 -0700 (PDT) X-Received: by 10.52.146.176 with SMTP id td16mr813918vdb.81.1407333818141; Wed, 06 Aug 2014 07:03:38 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id d3si484646vck.42.2014.08.06.07.03.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Aug 2014 07:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so4023261vcb.15 for ; Wed, 06 Aug 2014 07:03:38 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr10836474vcn.16.1407333818044; Wed, 06 Aug 2014 07:03:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp27636vcb; Wed, 6 Aug 2014 07:03:37 -0700 (PDT) X-Received: by 10.51.17.2 with SMTP id ga2mr18941087igd.2.1407333816859; Wed, 06 Aug 2014 07:03:36 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id j11si12524638igf.27.2014.08.06.07.03.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 06 Aug 2014 07:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XF1oI-0006qY-Tr; Wed, 06 Aug 2014 14:03:22 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XF1oG-0006qT-T9 for edk2-devel@lists.sourceforge.net; Wed, 06 Aug 2014 14:03:20 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XF1oA-0003NG-2R for edk2-devel@lists.sourceforge.net; Wed, 06 Aug 2014 14:03:20 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76E31Ws000502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Aug 2014 10:03:02 -0400 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76E2xDM000680; Wed, 6 Aug 2014 10:03:00 -0400 Message-ID: <53E23593.1030206@redhat.com> Date: Wed, 06 Aug 2014 16:02:59 +0200 From: Laszlo Ersek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: edk2-devel@lists.sourceforge.net, "Mcdaniel, Daryl" , "Carsey, Jaben" References: <002201ce983c$d4bda0a0$7e38e1e0$@martin@arm.com> <66BD57653246D24E9698B0A6509545A886DF0F88@ORSMSX109.amr.corp.intel.com> <002801cf7f18$5cc12c20$16438460$@martin@arm.com> <004601cfafd0$9c7fe700$d57fb500$@martin@arm.com>, <66BD57653246D24E9698B0A6509545A897E8A1D9@ORSMSX109.amr.corp.intel.com> <0877601216922E4B83A7129715B5DA2BAC50E117CD@GEORGE.Emea.Arm.com> In-Reply-To: <0877601216922E4B83A7129715B5DA2BAC50E117CD@GEORGE.Emea.Arm.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -2.2 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1XF1oA-0003NG-2R Cc: "Mitchell, Mark L" , Harry Liebel Subject: Re: [edk2] StdLib: the long standing build error X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 On 08/06/14 00:31, Olivier Martin wrote: > Why do not put '*va_arg(ap, long double *) = res;' which seems to be the valid solution and add a #ifdef for the faulty toolchains. > I do not feel fair to keep a workaround by default when it blocks all the other toolchains. Would the attached patch work? (Actually, since it is very trivial, I'm quite sure it has been investigated before. So I'll reformulate: why isn't the attached approach acceptable?) Thanks Laszlo ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >From a69752d14f0b4cdfc9dd095a36464dc7b86cda65 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 6 Aug 2014 15:57:17 +0200 Subject: [PATCH] StdLib/LibC/Stdio: special case long double parsing on MSFT The Microsoft compiler does not really support (long double). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- StdLib/LibC/Stdio/Stdio.inf | 1 + StdLib/LibC/Stdio/vfscanf.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/StdLib/LibC/Stdio/Stdio.inf b/StdLib/LibC/Stdio/Stdio.inf index a61a558..8479dc0 100644 --- a/StdLib/LibC/Stdio/Stdio.inf +++ b/StdLib/LibC/Stdio/Stdio.inf @@ -145,3 +145,4 @@ # [BuildOptions] GCC:*_*_*_CC_FLAGS = -fno-builtin -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-format + MSFT:*_*_*_CC_FLAGS = /D MSFT_LONG_DOUBLE diff --git a/StdLib/LibC/Stdio/vfscanf.c b/StdLib/LibC/Stdio/vfscanf.c index 4f84a39..414c6f4 100644 --- a/StdLib/LibC/Stdio/vfscanf.c +++ b/StdLib/LibC/Stdio/vfscanf.c @@ -843,12 +843,15 @@ literal: goto match_failure; if ((flags & SUPPRESS) == 0) { if (flags & LONGDBL) { - long double **mp = (long double **)ap; long double res = strtold(buf, &p); +#if MSFT_LONG_DOUBLE + long double **mp = (long double **)ap; *(*mp) = res; ap += sizeof(long double *); -/*???*/ //*va_arg(ap, long double *) = res; +#else + *va_arg(ap, long double *) = res; +#endif } else if (flags & LONG) { double res = strtod(buf, &p); *va_arg(ap, double *) = res; -- 1.8.3.1