From patchwork Thu Jul 14 13:16:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 72008 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp74707qga; Thu, 14 Jul 2016 06:16:26 -0700 (PDT) X-Received: by 10.98.103.70 with SMTP id b67mr12559349pfc.30.1468502183096; Thu, 14 Jul 2016 06:16:23 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id h80si4247921pfj.46.2016.07.14.06.16.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 06:16:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C63401A1F31; Thu, 14 Jul 2016 06:17:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 B3E521A1F2F for ; Thu, 14 Jul 2016 06:17:03 -0700 (PDT) Received: by mail-wm0-x235.google.com with SMTP id f126so66403020wma.1 for ; Thu, 14 Jul 2016 06:16:17 -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:in-reply-to:references; bh=mbepiCrTsY64KQ7h5naqS480aE6ZMUUbq2jvo4txaww=; b=SKUSjr2l8IAFE6u7nTdFXlIn5pU3+jTe0+uts4eUwp8MiKYfSBePw7nLkbLnVY/WAQ 3+Lr5sNlT/5Xhqg90MmX65VTuk0vOJvMMFpSeQFI0Fnf43WxxoF66LNAfaNv5aDaN51S 1uonC9yYfbK9utmyYV9fUuuu0nvkBio/UtDb8= 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:in-reply-to :references; bh=mbepiCrTsY64KQ7h5naqS480aE6ZMUUbq2jvo4txaww=; b=Vxy3xYD4SX5rJojBm6DlbDTl8iB316h9nCczjVxtETlzTIeC7li7A4L5/3skfv0MoA zyvfjU/Vr3mMNHnz7ZJcLIzYny9pBavCp+ChxRmW0l3XcTQhr4/tToYB/c7TppwaZbFu Ff9D9P6TZUwaP4OCuggDzHoeTMIou35rGI5sOFvsReXTP6dO7BkplPEEM/XrQ8VjLFUL kjo7p65Kq5hie1u7r/7FO1hQLzk/2JOyYkfuNl+CpIGRRqZut4EW1qIdMy9sN0+kUvVx dwxIEnPSpftKh8Ssytn2F+PWDeMaPe8A5LJ3R9AXox2zu4jncFiH5o6y+gFPeawRzI8P OnTw== X-Gm-Message-State: ALyK8tKGploR8PWWwJhBVg+tjFinDhp/jsDm2Ecy2rdzxoQRgJs8EIq1zcLs8Cv6HbN6PDFx X-Received: by 10.28.125.5 with SMTP id y5mr32734488wmc.103.1468502176015; Thu, 14 Jul 2016 06:16:16 -0700 (PDT) Received: from localhost.localdomain ([188.203.148.129]) by smtp.gmail.com with ESMTPSA id q69sm43232902wmd.4.2016.07.14.06.16.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 06:16:15 -0700 (PDT) From: Ard Biesheuvel To: steven.shi@intel.com, yonghong.zhu@intel.com, liming.gao@intel.com, michael.d.kinney@intel.com, jordan.l.justen@intel.com, lersek@redhat.com, afish@apple.com, edk2-devel@lists.01.org Date: Thu, 14 Jul 2016 15:16:07 +0200 Message-Id: <1468502169-15248-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468502169-15248-1-git-send-email-ard.biesheuvel@linaro.org> References: <1468502169-15248-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 3/5] BaseTools/tools_def: enable O2 optimization for GCC X64 builds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Now that we switched to the __builtin_ms_va_list VA_LIST type for GCC/X64, we can trust the compiler to do the right thing even under optimization, and so we can enable -O2 optimization all the way back to GCC44. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- BaseTools/Conf/tools_def.template | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 2065fa34998f..3bff65b862a2 100644 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -4353,7 +4353,7 @@ DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables +DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -n -q --gc-sections -z common-page-size=0x20 DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) --entry ReferenceAcpiTable -u ReferenceAcpiTable DEFINE GCC44_IA32_X64_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map @@ -4601,13 +4601,15 @@ DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) *_GCC44_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64 *_GCC44_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64 *_GCC44_X64_ASM_FLAGS = DEF(GCC44_ASM_FLAGS) -m64 --64 -melf_x86_64 -*_GCC44_X64_CC_FLAGS = DEF(GCC44_X64_CC_FLAGS) *_GCC44_X64_DLINK_FLAGS = DEF(GCC44_X64_DLINK_FLAGS) *_GCC44_X64_DLINK2_FLAGS = DEF(GCC44_X64_DLINK2_FLAGS) *_GCC44_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) *_GCC44_X64_OBJCOPY_FLAGS = *_GCC44_X64_NASM_FLAGS = -f elf64 + DEBUG_GCC44_X64_CC_FLAGS = DEF(GCC44_X64_CC_FLAGS) +RELEASE_GCC44_X64_CC_FLAGS = DEF(GCC44_X64_CC_FLAGS) -O2 + #################################################################################### # # GCC 4.5 - This configuration is used to compile under Linux to produce @@ -4671,13 +4673,15 @@ DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) *_GCC45_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64 *_GCC45_X64_ASLDLINK_FLAGS = DEF(GCC45_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64 *_GCC45_X64_ASM_FLAGS = DEF(GCC45_ASM_FLAGS) -m64 --64 -melf_x86_64 -*_GCC45_X64_CC_FLAGS = DEF(GCC45_X64_CC_FLAGS) *_GCC45_X64_DLINK_FLAGS = DEF(GCC45_X64_DLINK_FLAGS) *_GCC45_X64_DLINK2_FLAGS = DEF(GCC45_X64_DLINK2_FLAGS) *_GCC45_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) *_GCC45_X64_OBJCOPY_FLAGS = *_GCC45_X64_NASM_FLAGS = -f elf64 + DEBUG_GCC45_X64_CC_FLAGS = DEF(GCC45_X64_CC_FLAGS) +RELEASE_GCC45_X64_CC_FLAGS = DEF(GCC45_X64_CC_FLAGS) -O2 + #################################################################################### # # GCC 4.6 - This configuration is used to compile under Linux to produce @@ -4750,7 +4754,7 @@ RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC46_X64_NASM_FLAGS = -f elf64 DEBUG_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-variable +RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -O2 -Wno-unused-but-set-variable ################## # GCC46 ARM definitions @@ -4855,7 +4859,7 @@ RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC47_X64_NASM_FLAGS = -f elf64 DEBUG_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-variable +RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -O2 -Wno-unused-but-set-variable ################## # GCC47 ARM definitions @@ -4987,7 +4991,7 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC48_X64_NASM_FLAGS = -f elf64 DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-variable +RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -O2 -Wno-unused-but-set-variable ################## # GCC48 ARM definitions @@ -5119,7 +5123,7 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC49_X64_NASM_FLAGS = -f elf64 DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable +RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -O2 -Wno-unused-but-set-variable ################## # GCC49 ARM definitions