public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Andrew Fish <afish@apple.com>
Cc: Mike Kinney <michael.d.kinney@intel.com>,
	 "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Liming Gao <liming.gao@intel.com>
Subject: Re: [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
Date: Fri, 19 May 2017 17:56:20 +0100	[thread overview]
Message-ID: <CAKv+Gu9GnXub_0EJ=V3=ybrsyAfPMdEbcjTziyG6mKDN9pN4qA@mail.gmail.com> (raw)
In-Reply-To: <208C5E91-D18A-4442-AA6B-AFDC1455D9E5@apple.com>

On 19 May 2017 at 17:46, Andrew Fish <afish@apple.com> wrote:
>
> On May 19, 2017, at 5:49 AM, Ard Biesheuvel <ard.biesheuvel@linaro.org>
> wrote:
>
> On 19 May 2017 at 07:52, Michael Kinney <michael.d.kinney@intel.com> wrote:
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=561
>
> Update BaseTools/Conf/tools_def.template to add the define
>
> -D NO_MSABI_VAARGS
>
> To CC_FLAGS for X64 XCODE5 builds.
>
> The llvm/clang compiler used in XCODE5 builds supports the
> _ms_ versions of the vararg builtins, but the compiler
> generates build errors.
>
> The recommendation from the XCODE5 experts is to never use
> the _ms_ version of the vararg builtins.  The define
> NO_MSABI_VARARGS is already supported in MdePkg/Include/Base.h
> and forces the use the standard vararg builtins.
>
>
> Are such builds compliant with the UEFI spec?
>
>
> Ard I think you are confusing implementation and architecture. The UEFI Spec
> quotes an ABI, and __builtin_ms_* is a non standard compiler extension.
>
> Clang was designed to be a cross compiler and for X64 (x86_64) we set the
> arch to clang via -target x86_64-pc-win32-macho. Basically this tells clang
> it is an x86_64 (X64) arch, with a Windows ABI (EFI ABI), and produce a
> Mach-O Executable (for debugging). So the default var args builtin does the
> right thing for the EFI ABI, and __builtin_ms_* is not supported. The
> x86_64-pc-win32-macho triple is only used for EFI and when I talked to the
> clang folks they were like why do you need __builtin_ms_* when it is the
> same as __builtin_*, please fix your include files.
>

Thanks for clarifying. What confused me is the use of NO_MSABI_VAARGS,
which to a casual reader may seem to force a varargs ABI different
from the MS one, which is exactly what it is used for in libraries
such as OpensslLib IIRC.

In any case, if the clang target setting already fully defines the
varargs flavor of __builtin_va_xxx calls, then I suppose the resulting
code should be compliant. It may still be worthwhile to rename the
preprocessor macro to something more intuitive, but I won't insist.

Thanks,
Ard.


  reply	other threads:[~2017-05-19 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19  6:52 [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Michael Kinney
2017-05-19  6:52 ` [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS Michael Kinney
2017-05-19 12:49   ` Ard Biesheuvel
2017-05-19 16:46     ` Andrew Fish
2017-05-19 16:56       ` Ard Biesheuvel [this message]
2017-05-19  6:52 ` [Patch 2/2] BaseTools: Clean up tools_def.template for XCODE5 Michael Kinney
2017-05-19 21:36 ` [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Andrew Fish
2017-05-22  4:13 ` Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKv+Gu9GnXub_0EJ=V3=ybrsyAfPMdEbcjTziyG6mKDN9pN4qA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox