public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Shi, Steven" <steven.shi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] BaseTools-CLANG38: Add O3 in Dlink2 flag
Date: Thu, 18 Aug 2016 03:10:00 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A1155EC57C@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1471438897-32784-1-git-send-email-steven.shi@intel.com>

CLANG38 IA32 Arch also requires this change. 

> -----Original Message-----
> From: Shi, Steven
> Sent: Wednesday, August 17, 2016 9:02 PM
> To: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
> Cc: ard.biesheuvel@linaro.org; Shi, Steven <steven.shi@intel.com>
> Subject: [PATCH] BaseTools-CLANG38: Add O3 in Dlink2 flag
> 
> CLANG38 build fail after CC_FLAG is added in the link rule.
> This failure is because the CLANG38 enable the LTO through LLVMgold.so
> linker plugin, but the LLVMgold.so plugin cannot accept the clang -Oz
> CC flag as build option. After CC_FLAG is added in the link rule,
> the LLVMgold.so plugin reports linking error. LLVMgold.so only accept
> -O0 ~ -O3, and you can see it in the LLVM gold plugin source code
> in below:
> 
> http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_380/final/tools/gold/
> gold-plugin.cpp line173:
> 
> if (opt[1] < '0' || opt[1] > '3')
>    message(LDPL_FATAL, "Optimization level must be between 0 and 3");
> 
> Add -O3 in the *_CLANG38_X64_DLINK2_FLAGS to override the -Oz flag in
> *_CLANG38_X64_CC_FLAGS to pass LLVMgold.so linking.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Steven Shi <steven.shi@intel.com>
> ---
>  BaseTools/Conf/tools_def.template | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Conf/tools_def.template
> b/BaseTools/Conf/tools_def.template
> index 974656c..c8e80c9 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -5518,7 +5518,7 @@ RELEASE_CLANG38_IA32_CC_FLAGS       =
> DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -
>  DEBUG_CLANG38_X64_CC_FLAGS         = DEF(CLANG38_ALL_CC_FLAGS) -
> m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -
> fpie -Oz -flto DEF(CLANG38_X64_TARGET) -g
>  RELEASE_CLANG38_X64_CC_FLAGS       = DEF(CLANG38_ALL_CC_FLAGS) -
> m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -
> fpie -Oz -flto DEF(CLANG38_X64_TARGET)
>  *_CLANG38_X64_DLINK_FLAGS          = DEF(GCC5_IA32_X64_DLINK_FLAGS) -
> Wl,-Oz -Wl,-melf_x86_64 -Wl,--oformat=elf64-x86-64 -Wl,-pie -
> mcmodel=small
> -*_CLANG38_X64_DLINK2_FLAGS         = DEF(GCC5_X64_DLINK2_FLAGS)
> +*_CLANG38_X64_DLINK2_FLAGS         = DEF(GCC5_X64_DLINK2_FLAGS) -O3
>  *_CLANG38_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)
>  *_CLANG38_X64_OBJCOPY_FLAGS        =
>  *_CLANG38_X64_NASM_FLAGS           = -f elf64
> --
> 2.7.4



      reply	other threads:[~2016-08-18  3:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 13:01 [PATCH] BaseTools-CLANG38: Add O3 in Dlink2 flag Shi, Steven
2016-08-18  3:10 ` Gao, Liming [this message]

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=4A89E2EF3DFEDB4C8BFDE51014F606A1155EC57C@shsmsx102.ccr.corp.intel.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