From patchwork Tue Mar 11 11:28:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Martin X-Patchwork-Id: 26019 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFADA202E1 for ; Tue, 11 Mar 2014 11:29:10 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf20311741pdb.0 for ; Tue, 11 Mar 2014 04:29:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=UGRfkTwAqfI+1nE2jC73nT9nSX/XxhN5IWBocKigpU4=; b=R0zFd96Ii7aYwSErO+TqZCTyHaO0TV2vNCc/I92C02yZX0ySkaMpeXYnhqCZ2YylpS INEwtcWVs6Jj/ccmGo+quAWQ/tbYvkr+uxlvW7lwW4OG7AsTQAUF/3nOzO3Kc9AExwNu qG6tvJO/p4zOtII3tU5Vo1W+NFPBgl2u3aZKAu1vIHKZK/1f47taPsUtXh+W1cQszbU4 J5xrZYkI++PwSP5PVMWQHr3QbouQRxEkOOGU8K/L/GGUnvrh8FgD3eSU9wECneCucGyV VYF03FK8/tMT41up01bWHBQ2E/wIZ6HhNFNHqhVdJOdQVv/Uemwswg+bkRS3fnSvPSSE aMaw== X-Gm-Message-State: ALoCoQmeVbFzNEMbXYU9uVZbor+2fh+A1XbF4O5kaD32aYKE6KsW4dresrjiRYrSto/RJYYdCcZz X-Received: by 10.66.142.131 with SMTP id rw3mr16097936pab.18.1394537350056; Tue, 11 Mar 2014 04:29:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.101 with SMTP id s92ls2570512qgd.82.gmail; Tue, 11 Mar 2014 04:29:09 -0700 (PDT) X-Received: by 10.59.7.170 with SMTP id dd10mr27113229ved.12.1394537349886; Tue, 11 Mar 2014 04:29:09 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id tt2si6322929vdc.139.2014.03.11.04.29.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Mar 2014 04:29:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so8408496veb.14 for ; Tue, 11 Mar 2014 04:29:09 -0700 (PDT) X-Received: by 10.52.242.167 with SMTP id wr7mr284861vdc.32.1394537349771; Tue, 11 Mar 2014 04:29:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp197417vck; Tue, 11 Mar 2014 04:29:09 -0700 (PDT) X-Received: by 10.43.51.65 with SMTP id vh1mr33307918icb.24.1394537349153; Tue, 11 Mar 2014 04:29:09 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id jv2si31148543icc.115.2014.03.11.04.29.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Mar 2014 04:29:09 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WNKri-00051g-HE; Tue, 11 Mar 2014 11:28:58 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WNKrh-00051Y-9H for edk2-devel@lists.sourceforge.net; Tue, 11 Mar 2014 11:28:57 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of arm.com designates 217.140.96.21 as permitted sender) client-ip=217.140.96.21; envelope-from=olivier.martin@arm.com; helo=cam-smtp0.cambridge.arm.com; Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1WNKrf-0002VV-G0 for edk2-devel@lists.sourceforge.net; Tue, 11 Mar 2014 11:28:57 +0000 Received: from e102605-lin.cambridge.arm.com (e102605-lin.cambridge.arm.com [10.1.193.42]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s2BBSkZG018517; Tue, 11 Mar 2014 11:28:46 GMT From: Olivier Martin To: edk2-devel@lists.sourceforge.net Date: Tue, 11 Mar 2014 11:28:43 +0000 Message-Id: <1394537323-30104-1-git-send-email-olivier.martin@arm.com> X-Mailer: git-send-email 1.8.5 X-Spam-Score: -0.7 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 0.8 UPPERCASE_50_75 message body is 50-75% uppercase X-Headers-End: 1WNKrf-0002VV-G0 Subject: [edk2] [PATCH] BaseTools: Added support to use GCC on Windows host (WINGCC) X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: olivier.martin@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 WINGCC EDK2 toolchain enables building EDK2 with GCC toolchain on Windows host machine. It currently only supports ARM and AARCH64 architectures. Change-Id: I49eb3103137e5dd73c24a9596d25d4899ca76cfc Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin --- BaseTools/Conf/build_rule.template | 10 ++-- BaseTools/Conf/tools_def.template | 97 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 5 deletions(-) diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template index 1259251..b2fb32e 100644 --- a/BaseTools/Conf/build_rule.template +++ b/BaseTools/Conf/build_rule.template @@ -133,7 +133,7 @@ "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst} - + "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} @@ -219,7 +219,7 @@ "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST) - + # $(OBJECT_FILES_LIST) has wrong paths for cygwin "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OBJECT_FILES) @@ -243,7 +243,7 @@ "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) --end-group $(DLINK2_FLAGS) "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst} - + "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) --end-group $(DLINK2_FLAGS) @@ -273,7 +273,7 @@ "$(DLINK)" $(DLINK_FLAGS) --start-group $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) --end-group $(DLINK2_FLAGS) - + "$(DLINK)" $(DLINK_FLAGS) --start-group $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) --end-group $(DLINK2_FLAGS) @@ -294,7 +294,7 @@ $(DEBUG_DIR)(+)$(MODULE_NAME).efi - + "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS) $(CP) ${dst} $(OUTPUT_DIR) $(CP) ${dst} $(BIN_DIR) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 8f5507d..02d728f 100644 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -594,6 +594,12 @@ DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G # Required to build platforms or ACPI tables: # Intel(r) ACPI Compiler v20101013 from # http://www.acpica.org/downloads/previous_releases.php +# WINGCC -win64- Requires: +# Windows GNU GCC toolchain, 4.8.0 +# Optional: +# Required to build platforms or ACPI tables: +# Intel(r) ACPI Compiler (iasl.exe) v20101013 from +# http://www.acpica.org/downloads/previous_releases.php # * Commented out - All versions of VS2005 use the same standard install directory # #################################################################################### @@ -5908,6 +5914,97 @@ RELEASE_ARMLINUXGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEBUG_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0 RELEASE_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable +#################################################################################### +# +# GCC for Windows host +# +#################################################################################### +*_WINGCC_*_*_FAMILY = GCC +*_WINGCC_*_*_BUILDRULEFAMILY = WINGCC + +*_WINGCC_*_MAKE_PATH = make +*_WINGCC_*_MAKE_FLAGS = --no-print-directory + +################## +# ASL definitions +################## +*_WINGCC_*_ASL_PATH = DEF(WIN_IASL_BIN) +*_WINGCC_*_ASL_FLAGS = -tc -li +*_WINGCC_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS) +*_WINGCC_*_ASLPP_FLAGS = $(ARCHCC_FLAGS) +*_WINGCC_*_ASLCC_FLAGS = $(ARCHCC_FLAGS) + +################## +# ARM definitions +################## + +*_WINGCC_ARM_CC_PATH = ENV(WINGCC_ARM_PREFIX)gcc +*_WINGCC_ARM_SLINK_PATH = ENV(WINGCC_ARM_PREFIX)ar +*_WINGCC_ARM_DLINK_PATH = ENV(WINGCC_ARM_PREFIX)ld +*_WINGCC_ARM_ASM_PATH = ENV(WINGCC_ARM_PREFIX)as +*_WINGCC_ARM_PP_PATH = ENV(WINGCC_ARM_PREFIX)gcc +*_WINGCC_ARM_VFRPP_PATH = ENV(WINGCC_ARM_PREFIX)gcc +*_WINGCC_ARM_ASLCC_PATH = ENV(WINGCC_ARM_PREFIX)gcc +*_WINGCC_ARM_ASLDLINK_PATH = ENV(WINGCC_ARM_PREFIX)ld +*_WINGCC_ARM_ASLPP_PATH = ENV(WINGCC_ARM_PREFIX)gcc + +# +# Use default values, or override in DSC file +# +*_WINGCC_ARM_ARCHCC_FLAGS = -mthumb +*_WINGCC_ARM_ARCHASM_FLAGS = +*_WINGCC_ARM_ARCHDLINK_FLAGS = +*_WINGCC_ARM_PLATFORM_FLAGS = -march=armv7-a +*_WINGCC_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h +*_WINGCC_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS) +*_WINGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) +*_WINGCC_ARM_SLINK_FLAGS = -cr +*_WINGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm +*_WINGCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm + + DEBUG_WINGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g +RELEASE_WINGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian + + DEBUG_WINGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -O0 -mno-unaligned-access +RELEASE_WINGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -Wno-unused-but-set-variable -mno-unaligned-access + +###################### +# AArch64 definitions +###################### +# AARCH64 64bit ARM GNU/Linux GCC (ARM Architecture 64) + +*_WINGCC_AARCH64_CC_PATH = ENV(WINGCC_AARCH64_PREFIX)gcc +*_WINGCC_AARCH64_SLINK_PATH = ENV(WINGCC_AARCH64_PREFIX)ar +*_WINGCC_AARCH64_DLINK_PATH = ENV(WINGCC_AARCH64_PREFIX)ld +*_WINGCC_AARCH64_ASM_PATH = ENV(WINGCC_AARCH64_PREFIX)as +*_WINGCC_AARCH64_PP_PATH = ENV(WINGCC_AARCH64_PREFIX)gcc +*_WINGCC_AARCH64_VFRPP_PATH = ENV(WINGCC_AARCH64_PREFIX)gcc +*_WINGCC_AARCH64_ASLCC_PATH = ENV(WINGCC_AARCH64_PREFIX)gcc +*_WINGCC_AARCH64_ASLDLINK_PATH = ENV(WINGCC_AARCH64_PREFIX)ld +*_WINGCC_AARCH64_ASLPP_PATH = ENV(WINGCC_AARCH64_PREFIX)gcc + +# +# Use default values, or override in DSC file +# +*_WINGCC_AARCH64_ARCHCC_FLAGS = +*_WINGCC_AARCH64_ARCHASM_FLAGS = +*_WINGCC_AARCH64_ARCHDLINK_FLAGS = +*_WINGCC_AARCH64_PLATFORM_FLAGS = +*_WINGCC_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h +*_WINGCC_AARCH64_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS) +*_WINGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) +*_WINGCC_AARCH64_SLINK_FLAGS = -cr +*_WINGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf64-littleaarch64 +*_WINGCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) + + DEBUG_WINGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g +RELEASE_WINGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian + + DEBUG_WINGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -O0 +RELEASE_WINGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable + + + ################# # ASM 16 linker defintions #################