From: "Shi, Steven" <steven.shi@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
"Gao, Liming" <liming.gao@intel.com>,
"Carsey, Jaben" <jaben.carsey@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"afish@apple.com" <afish@apple.com>
Subject: Re: [PATCH 2/4] BaseTools-Conf:Introduce CLANG38 new toolchain for x86
Date: Wed, 3 Aug 2016 08:22:52 +0000 [thread overview]
Message-ID: <06C8AB66E78EE34A949939824ABE2B31033845F5@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <CAKv+Gu81gZaYjRC1kSsr2NqQG1TvFf04L+vwTov6C8DNdYPnkw@mail.gmail.com>
Hello Ard,
>
> Hello Steven,
>
> On 3 August 2016 at 08:48, Shi, Steven <steven.shi@intel.com> wrote:
> > This adds support for LLVM 3.8.x in LTO mode for IA32 and X64.
> > CLANG38 enable LLVM Link Time Optimization (LTO) and code size
> > optimization flag (-Oz) by default for aggressive code size
> > improvement. CLANG38 X64 code is small code model + PIE.
> >
> > CLANG LTO needs PIE in link flags to generate PIE code correctly,
> > otherwise the PIE is not really enabled. (e.g. OvmfPkgX64 will
> > hang in 64bits SEC at high address because of small model code
> > displacement overflow).
> >
>
> This is probably caused by the same issue I am addressing with the
> series I sent out yesterday, to pass the CC flags to the DLINK
> command.
>
> The reason is that code is generated by the link pass, so it needs to
> see the same -fpie -mcmodel=small options that we passed to the
> compiler as wel.
>
> Could you check whether replacing '-Wl,-pie' with -fpie does the trick
> as well? As I mentioned before, creating a PIE executable at link time
> is not the same as generatic position independent code at compile time
> (whether it is via $(CC) or via $(DLINK)). The PIE executable will
> contain a .rela section that partially overlaps with other absolute
> relocations, so it is best to avoid it.
[Steven]: I just tried it. No, replacing '-Wl,-pie' with -fpie cannot works for clang38. With -fpie in link flags, the OvmfPkgX64 still hang in 64bits SEC at high address.
>
> Some more comments below
>
> > +*_CLANG38_IA32_OBJCOPY_PATH = DEF(GCC5_IA32_PREFIX)objcopy
>
> Why are you using the GCC5 prefix here? A clang user may not set GCC5_BIN
>
[Steven]: OK, I will remove the GCC5 prefix.
> > +*_CLANG38_IA32_ASLCC_FLAGS = -x c -Os -m32
> DEF(CLANG38_IA32_TARGET) -flto
>
> Does LTO make any sense for ACPI tables?
>
[Steven]: OK, I will follow GCC5 to disable the LTO for ASLCC flags.
Thanks
Steven
next prev parent reply other threads:[~2016-08-03 8:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 6:48 [PATCH 0/4] Introduce CLANG38 toolchain in edk2 Shi, Steven
2016-08-03 6:48 ` [PATCH 1/4] BaseTools-Conf:Remove short dash in ar flag for LLVM Shi, Steven
2016-08-03 7:30 ` Ard Biesheuvel
2016-08-03 6:48 ` [PATCH 2/4] BaseTools-Conf:Introduce CLANG38 new toolchain for x86 Shi, Steven
2016-08-03 7:37 ` Ard Biesheuvel
2016-08-03 8:22 ` Shi, Steven [this message]
2016-08-03 6:48 ` [PATCH 3/4] ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin Shi, Steven
2016-08-03 6:48 ` [PATCH 4/4] ShellPkg-UefiShellCommandLib: Add EFIAPI in VA_List library function Shi, Steven
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=06C8AB66E78EE34A949939824ABE2B31033845F5@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