From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org, edk2-lists@mc2research.org,
jaben.carsey@intel.com
Cc: sigmaepsilon92@gmail.com, leif.lindholm@linaro.org,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 1/2] StdLib/LibC: avoid LTO code for compiler intrinsics
Date: Mon, 8 Aug 2016 13:12:20 +0200 [thread overview]
Message-ID: <1470654741-24203-1-git-send-email-ard.biesheuvel@linaro.org> (raw)
The softfloat routines and some other routines supplied by LibC
will satisfy references to compiler intrinsics that are emitted
by the compiler backend, which under LTO means that the link-time
code generation may emit references to symbols that have been
optimized away already.
Work around this by building the ARM and AARCH64 versions of LibC
and the softfloat library without LTO.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
StdLib/LibC/LibC.inf | 1 +
StdLib/LibC/Softfloat/Softfloat.inf | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/StdLib/LibC/LibC.inf b/StdLib/LibC/LibC.inf
index f13630648555..6039bb81c7dd 100644
--- a/StdLib/LibC/LibC.inf
+++ b/StdLib/LibC/LibC.inf
@@ -120,3 +120,4 @@ [LibraryClasses]
#
[BuildOptions]
MSFT:*_*_IA32_CC_FLAGS = /GL-
+ GCC:*_*_ARM_CC_FLAGS = -fno-lto
diff --git a/StdLib/LibC/Softfloat/Softfloat.inf b/StdLib/LibC/Softfloat/Softfloat.inf
index 99763bcb57ba..460406c38fa4 100644
--- a/StdLib/LibC/Softfloat/Softfloat.inf
+++ b/StdLib/LibC/Softfloat/Softfloat.inf
@@ -71,4 +71,4 @@ [Packages]
# Nasty things could happen if you do.
[BuildOptions]
- GCC:*_*_*_CC_FLAGS = -DSOFTFLOAT_FOR_GCC -Wno-enum-compare -fno-tree-vrp
+ GCC:*_*_*_CC_FLAGS = -DSOFTFLOAT_FOR_GCC -Wno-enum-compare -fno-tree-vrp -fno-lto
--
2.7.4
next reply other threads:[~2016-08-08 11:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 11:12 Ard Biesheuvel [this message]
2016-08-08 11:12 ` [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine compiler intrinsics Ard Biesheuvel
2016-08-08 14:56 ` Carsey, Jaben
2016-08-08 11:24 ` [PATCH 1/2] StdLib/LibC: avoid LTO code for " Michael Zimmermann
2016-08-08 14:56 ` Carsey, Jaben
2016-08-09 8:13 ` Ard Biesheuvel
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=1470654741-24203-1-git-send-email-ard.biesheuvel@linaro.org \
--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