From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C95901A1E18 for ; Mon, 8 Aug 2016 04:12:27 -0700 (PDT) Received: by mail-wm0-x22f.google.com with SMTP id q128so112218624wma.1 for ; Mon, 08 Aug 2016 04:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=pi9LE6H5R3AUfsaVN100WTXcKEC1WIUgYyUI5PatqHc=; b=CaS7M08ipGHvJOYjV0W/wm5U3IqjAp8uzQPQTpBGVoLv6+Gk5BcjWIa4adjwP3cBNr N813hThZ+emSin3siVY7HaLqEh5YV5oK1sUh1QSbZTHpTkFRFY8svxLufJepRh1U8Wxk 6rffPJzEQNbdOdx1H9X9nJKbDmmqX7439Yq8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pi9LE6H5R3AUfsaVN100WTXcKEC1WIUgYyUI5PatqHc=; b=SAMQT9s07XSmG8/bo5jnJnx+UWgC2vb/jerZPUkh9zV9Qza8qieQVLWFm1jNr1IU6O YvBbIwvdJw8BPJnkz21n+Rr5TowXii9sMi2JaZ4Ka4jXJmgPQD4A48in4ir1MRLsy3iJ AEhs8ETcGEbsYIT+adpxlD+R4i08GgDU3siQiyl6CW/U5KkMIwbGhp/kNVVhxogdPFVk fHRUt16tGZ9MwAnIppAhfMPEZ8csp31hppUZoCq4eZQ8zyjZSNBsJ79O3zL3YakFzJ5q ZUwubEPho+G2AnRtlrXLA9Bs8MHu2IWl0tLOsrV7GVKG+kgRG/AC2sHFXKbM98SpCr4c HAbg== X-Gm-Message-State: AEkoouvmw733aQBsSHpO+7hojBfbSP6Grgym66v+yVw+gJ1SLY4ihr+SDhCVzDrw3OyUbMPS X-Received: by 10.194.23.39 with SMTP id j7mr84311631wjf.4.1470654746186; Mon, 08 Aug 2016 04:12:26 -0700 (PDT) Received: from localhost.localdomain (222.red-88-1-55.dynamicip.rima-tde.net. [88.1.55.222]) by smtp.gmail.com with ESMTPSA id v203sm23149488wmv.2.2016.08.08.04.12.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Aug 2016 04:12:25 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, edk2-lists@mc2research.org, jaben.carsey@intel.com Cc: sigmaepsilon92@gmail.com, leif.lindholm@linaro.org, Ard Biesheuvel Date: Mon, 8 Aug 2016 13:12:20 +0200 Message-Id: <1470654741-24203-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [PATCH 1/2] StdLib/LibC: avoid LTO code for compiler intrinsics X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2016 11:12:28 -0000 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 --- 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