mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-06-14 04:16:15 -07:00
Sync up new BaseTools to EDK201911 stable release
This patch synced up the BaseTools to EDK201911. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
## @file
|
||||
# Download iasl executable tool from a nuget.org package
|
||||
# - package contains different binaries based on host
|
||||
# Add the folder with the tool to the path
|
||||
#
|
||||
# This is only downloaded for scope cibuild thus
|
||||
# should have no impact on the asl compiler used by any
|
||||
# given platform to build.
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
"id": "iasl-ci-1",
|
||||
"scope": "cibuild",
|
||||
"type": "nuget",
|
||||
"name": "iasl",
|
||||
"source": "https://api.nuget.org/v3/index.json",
|
||||
"version": "20190215.0.0",
|
||||
"flags": ["set_path", "host_specific"]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
## @file
|
||||
# Download nasm x86 assembler executable tool from a nuget.org package
|
||||
# - package contains different binaries based on host
|
||||
# Put on the tool on the path
|
||||
#
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
"id": "nasm-1",
|
||||
"scope": "edk2-build",
|
||||
"type": "nuget",
|
||||
"name": "mu_nasm",
|
||||
"source": "https://api.nuget.org/v3/index.json",
|
||||
"version": "2.14.02",
|
||||
"flags": ["set_path", "host_specific"]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
## @file
|
||||
# Set this folder on the path for all linux builds
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
"scope": "global-nix",
|
||||
"flags": ["set_path"]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
## @file
|
||||
# Add this folder to the path on Windows
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
"scope": "global-win",
|
||||
"flags": ["set_path"]
|
||||
}
|
||||
@@ -166,7 +166,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
Package.
|
||||
</xs:documentation>
|
||||
<xs:documentation xml:lang="en-us">
|
||||
Each Distribution Package is uniquely identified by it's
|
||||
Each Distribution Package is uniquely identified by its
|
||||
GUID and Version number.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
@@ -363,7 +363,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
Modules.
|
||||
</xs:documentation>
|
||||
<xs:documentation xml:lang="en-us">
|
||||
Each package is uniquely identified by it's GUID and Version number.
|
||||
Each package is uniquely identified by its GUID and Version number.
|
||||
Backward compatible releases of a package need only change the version number, while non-backward
|
||||
compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
|
||||
</xs:documentation>
|
||||
@@ -1168,7 +1168,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
<xs:element name="ModuleSurfaceArea">
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en-us">
|
||||
Each module is uniquely identified by it's GUID and Version number.
|
||||
Each module is uniquely identified by its GUID and Version number.
|
||||
Backward compatible releases of a module need only change the version number, while non-backward
|
||||
compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
|
||||
</xs:documentation>
|
||||
@@ -3092,7 +3092,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
<xs:documentation xml:lang="en-us">
|
||||
The Patch PCD is a #define that is set at build time, and that
|
||||
can be modified within a binary file. Additional information, such as the offset location of the
|
||||
value, along with it's length may need to be provided.
|
||||
value, along with its length may need to be provided.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:enumeration>
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
<OutputFile>
|
||||
$(OUTPUT_DIR)(+)$(MODULE_NAME).lib
|
||||
|
||||
<Command.MSFT, Command.INTEL>
|
||||
<Command.MSFT, Command.INTEL, Command.CLANGPDB>
|
||||
"$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} @$(OBJECT_FILES_LIST)
|
||||
|
||||
<Command.GCC>
|
||||
@@ -291,6 +291,9 @@
|
||||
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK2_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)
|
||||
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)
|
||||
|
||||
<Command.CLANGPDB>
|
||||
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
|
||||
|
||||
<Command.GCC>
|
||||
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) -Wl,--start-group,@$(STATIC_LIBRARY_FILES_LIST),--end-group $(CC_FLAGS) $(DLINK2_FLAGS)
|
||||
"$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
|
||||
@@ -321,7 +324,7 @@
|
||||
"$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
|
||||
|
||||
|
||||
[Static-Library-File.USER_DEFINED]
|
||||
[Static-Library-File.USER_DEFINED, Static-Library-File.HOST_APPLICATION]
|
||||
<InputFile>
|
||||
*.lib
|
||||
|
||||
@@ -331,7 +334,7 @@
|
||||
<OutputFile>
|
||||
$(DEBUG_DIR)(+)$(MODULE_NAME)
|
||||
|
||||
<Command.MSFT, Command.INTEL>
|
||||
<Command.MSFT, Command.INTEL, Command.CLANGPDB>
|
||||
"$(DLINK)" $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)
|
||||
|
||||
<Command.GCC>
|
||||
@@ -355,7 +358,7 @@
|
||||
<OutputFile>
|
||||
$(OUTPUT_DIR)(+)$(MODULE_NAME).efi
|
||||
|
||||
<Command.MSFT, Command.INTEL, Command.RVCT>
|
||||
<Command.MSFT, Command.INTEL, Command.RVCT, Command.CLANGPDB>
|
||||
"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
|
||||
$(CP) ${dst} $(DEBUG_DIR)
|
||||
$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
|
||||
@@ -460,9 +463,14 @@
|
||||
|
||||
<Command.GCC>
|
||||
"$(ASLCC)" -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
||||
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS)
|
||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||
|
||||
|
||||
<Command.CLANGPDB>
|
||||
"$(ASLCC)" -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
||||
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||
|
||||
<Command.XCODE>
|
||||
"$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
|
||||
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||
@@ -622,21 +630,19 @@
|
||||
<InputFile>
|
||||
*.hpk
|
||||
|
||||
<OutputFile.MSFT, OutputFile.INTEL, OutputFile.GCC>
|
||||
<OutputFile.MSFT, OutputFile.INTEL, OutputFile.GCC, OutputFile.CLANGPDB>
|
||||
$(OUTPUT_DIR)(+)$(MODULE_NAME)hii.lib
|
||||
|
||||
<OutputFile.XCODE, OutputFile.RVCT>
|
||||
$(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
|
||||
|
||||
<Command.MSFT, Command.INTEL>
|
||||
<Command.MSFT, Command.INTEL, Command.CLANGPDB>
|
||||
"$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiipackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
|
||||
"$(RC)" /Fo${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
|
||||
|
||||
<Command.GCC>
|
||||
"$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
|
||||
"$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
|
||||
|
||||
|
||||
<Command.XCODE, Command.RVCT>
|
||||
GenFw -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (c) 2019, Linaro Ltd. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
*.dec
|
||||
*.dsc.inc
|
||||
*.dsc
|
||||
*.fdf
|
||||
*.inf
|
||||
*.h
|
||||
*.vfr
|
||||
*.c
|
||||
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (c) 2019, Linaro Ltd. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
*.efi -diff
|
||||
*.EFI -diff
|
||||
*.bin -diff
|
||||
*.BIN -diff
|
||||
*.raw -diff
|
||||
*.RAW -diff
|
||||
*.bmp -diff
|
||||
*.BMP -diff
|
||||
*.dec diff=ini
|
||||
*.dsc diff=ini
|
||||
*.dsc.inc diff=ini
|
||||
*.fdf diff=ini
|
||||
*.fdf.inc diff=ini
|
||||
*.inf diff=ini
|
||||
@@ -4,9 +4,18 @@
|
||||
# Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
# Copyright (c) Microsoft Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
#
|
||||
# Increase this version tag any time you want user to get warning about updating this
|
||||
# file in the Conf dir. By default it does not do update existing conf dirs.
|
||||
#
|
||||
# 2.00 - Initial version with changes for CI
|
||||
# - Change RC path to use plugin
|
||||
#
|
||||
#!VERSION=2.00
|
||||
|
||||
IDENTIFIER = Default TOOL_CHAIN_CONF
|
||||
|
||||
@@ -55,35 +64,48 @@ DEFINE VS2015x86_BIN = ENV(VS2015_PREFIX)Vc\bin
|
||||
DEFINE VS2015x86_DLL = ENV(VS2015_PREFIX)Common7\IDE;DEF(VS2015x86_BIN)
|
||||
DEFINE VS2015x86_BINX64 = DEF(VS2015x86_BIN)\x86_amd64
|
||||
|
||||
DEFINE VS2017_BIN = ENV(VS2017_PREFIX)bin
|
||||
DEFINE VS2017_HOST = x86
|
||||
DEFINE VS2017_BIN_HOST = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\DEF(VS2017_HOST)
|
||||
DEFINE VS2017_BIN_IA32 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x86
|
||||
DEFINE VS2017_BIN_X64 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64
|
||||
DEFINE VS2017_BIN_ARM = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm
|
||||
DEFINE VS2017_BIN_AARCH64 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm64
|
||||
DEFINE VS_HOST = x86
|
||||
|
||||
DEFINE WINSDK_BIN = ENV(WINSDK_PREFIX)
|
||||
DEFINE WINSDKx86_BIN = ENV(WINSDKx86_PREFIX)
|
||||
DEFINE VS2017_BIN = ENV(VS2017_PREFIX)bin
|
||||
DEFINE VS2017_BIN_HOST = DEF(VS2017_BIN)\HostDEF(VS_HOST)\DEF(VS_HOST)
|
||||
DEFINE VS2017_BIN_IA32 = DEF(VS2017_BIN)\HostDEF(VS_HOST)\x86
|
||||
DEFINE VS2017_BIN_X64 = DEF(VS2017_BIN)\HostDEF(VS_HOST)\x64
|
||||
DEFINE VS2017_BIN_ARM = DEF(VS2017_BIN)\HostDEF(VS_HOST)\arm
|
||||
DEFINE VS2017_BIN_AARCH64 = DEF(VS2017_BIN)\HostDEF(VS_HOST)\arm64
|
||||
|
||||
DEFINE VS2019_BIN = ENV(VS2019_PREFIX)bin
|
||||
DEFINE VS2019_BIN_HOST = DEF(VS2019_BIN)\HostDEF(VS_HOST)\DEF(VS_HOST)
|
||||
DEFINE VS2019_BIN_IA32 = DEF(VS2019_BIN)\HostDEF(VS_HOST)\x86
|
||||
DEFINE VS2019_BIN_X64 = DEF(VS2019_BIN)\HostDEF(VS_HOST)\x64
|
||||
DEFINE VS2019_BIN_ARM = DEF(VS2019_BIN)\HostDEF(VS_HOST)\arm
|
||||
DEFINE VS2019_BIN_AARCH64 = DEF(VS2019_BIN)\HostDEF(VS_HOST)\arm64
|
||||
|
||||
#
|
||||
# Resource compiler
|
||||
#
|
||||
DEFINE RC_PATH = ENV(WINSDK_PATH_FOR_RC_EXE)\rc.exe
|
||||
|
||||
DEFINE WINSDK_BIN = ENV(WINSDK_PREFIX)
|
||||
DEFINE WINSDKx86_BIN = ENV(WINSDKx86_PREFIX)
|
||||
|
||||
# Microsoft Visual Studio 2010
|
||||
DEFINE WINSDK7_BIN = ENV(WINSDK7_PREFIX)
|
||||
DEFINE WINSDK7x86_BIN = ENV(WINSDK7x86_PREFIX)
|
||||
DEFINE WINSDK7_BIN = ENV(WINSDK7_PREFIX)
|
||||
DEFINE WINSDK7x86_BIN = ENV(WINSDK7x86_PREFIX)
|
||||
|
||||
# Microsoft Visual Studio 2012 Update 1 (required for rc.exe that was not included in the initial release)
|
||||
DEFINE WINSDK71_BIN = ENV(WINSDK71_PREFIX)
|
||||
DEFINE WINSDK71x86_BIN = ENV(WINSDK71x86_PREFIX)
|
||||
DEFINE WINSDK71_BIN = ENV(WINSDK71_PREFIX)
|
||||
DEFINE WINSDK71x86_BIN = ENV(WINSDK71x86_PREFIX)
|
||||
|
||||
# Microsoft Visual Studio 2013 Professional Edition
|
||||
DEFINE WINSDK8_BIN = ENV(WINSDK8_PREFIX)x86\
|
||||
DEFINE WINSDK8x86_BIN = ENV(WINSDK8x86_PREFIX)x64
|
||||
DEFINE WINSDK8_BIN = ENV(WINSDK8_PREFIX)x86\
|
||||
DEFINE WINSDK8x86_BIN = ENV(WINSDK8x86_PREFIX)x64
|
||||
|
||||
# Microsoft Visual Studio 2015 Professional Edition
|
||||
DEFINE WINSDK81_BIN = ENV(WINSDK81_PREFIX)x86\
|
||||
DEFINE WINSDK81x86_BIN = ENV(WINSDK81x86_PREFIX)x64
|
||||
DEFINE WINSDK81_BIN = ENV(WINSDK81_PREFIX)x86\
|
||||
DEFINE WINSDK81x86_BIN = ENV(WINSDK81x86_PREFIX)x64
|
||||
|
||||
# Microsoft Visual Studio 2017 Professional Edition
|
||||
DEFINE WINSDK10_BIN = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
|
||||
# Microsoft Visual Studio 2017/2019 Professional Edition
|
||||
DEFINE WINSDK10_BIN = ENV(WINSDK10_PREFIX)DEF(VS_HOST)
|
||||
|
||||
# These defines are needed for certain Microsoft Visual Studio tools that
|
||||
# are used by other toolchains. An example is that ICC on Windows normally
|
||||
@@ -218,6 +240,17 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
|
||||
# Note:
|
||||
# Building of XIP firmware images for ARM/ARM64 is not currently supported (only applications).
|
||||
# /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
|
||||
# VS2019 -win32- Requires:
|
||||
# Microsoft Visual Studio 2019 version 16.2 or later
|
||||
# Optional:
|
||||
# Required to build EBC drivers:
|
||||
# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
|
||||
# Required to build platforms or ACPI tables:
|
||||
# Intel(r) ACPI Compiler (iasl.exe) from
|
||||
# https://acpica.org/downloads
|
||||
# Note:
|
||||
# Building of XIP firmware images for ARM/ARM64 is not currently supported (only applications).
|
||||
# /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
|
||||
# GCC48 -Linux,Windows- Requires:
|
||||
# GCC 4.8 targeting x86_64-linux-gnu, aarch64-linux-gnu, or arm-linux-gnueabi
|
||||
# Optional:
|
||||
@@ -249,6 +282,15 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
|
||||
# Required to build platforms or ACPI tables:
|
||||
# Intel(r) ACPI Compiler from
|
||||
# https://acpica.org/downloads
|
||||
# CLANGPDB -Linux, Windows, Mac- Requires:
|
||||
# Clang 9 or above from http://releases.llvm.org/
|
||||
# Optional:
|
||||
# Required to compile nasm source:
|
||||
# nasm compiler from
|
||||
# NASM -- http://www.nasm.us/
|
||||
# Required to build platforms or ACPI tables:
|
||||
# Intel(r) ACPI Compiler from
|
||||
# https://acpica.org/downloads
|
||||
# VS2008x86 -win64- Requires:
|
||||
# Microsoft Visual Studio 2008 (x86)
|
||||
# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
|
||||
@@ -331,8 +373,8 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
|
||||
# *_*_EBC_SLINK_PATH = C:\Program Files\Intel\EBC\Bin\link.exe
|
||||
#
|
||||
# *_*_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
|
||||
# *_*_EBC_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h
|
||||
# *_*_EBC_CC_FLAGS = /nologo /FAcs /c /W3 /WX /FI$(DEST_DIR_DEBUG)/AutoGen.h
|
||||
# *_*_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||
# *_*_EBC_CC_FLAGS = /nologo /FAcs /c /W3 /WX /FIAutoGen.h
|
||||
# *_*_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /MACHINE:EBC /OPT:REF /NODEFAULTLIB /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
|
||||
#
|
||||
####################################################################################
|
||||
@@ -1538,7 +1580,7 @@ NOOPT_VS2015x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
||||
|
||||
*_VS2017_*_MAKE_PATH = DEF(VS2017_BIN_HOST)\nmake.exe
|
||||
*_VS2017_*_MAKE_FLAG = /nologo
|
||||
*_VS2017_*_RC_PATH = DEF(WINSDK10_BIN)\rc.exe
|
||||
*_VS2017_*_RC_PATH = DEF(RC_PATH)
|
||||
|
||||
*_VS2017_*_MAKE_FLAGS = /nologo
|
||||
*_VS2017_*_SLINK_FLAGS = /NOLOGO /LTCG
|
||||
@@ -1691,6 +1733,169 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
||||
*_VS2017_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
|
||||
*_VS2017_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
|
||||
|
||||
####################################################################################
|
||||
# VS2019 - Microsoft Visual Studio 2019 with Intel ASL
|
||||
# ASL - Intel ACPI Source Language Compiler (iasl.exe)
|
||||
####################################################################################
|
||||
# VS2019 - Microsoft Visual Studio 2017 professional Edition with Intel ASL
|
||||
*_VS2019_*_*_FAMILY = MSFT
|
||||
*_VS2019_*_*_DLL = DEF(VS2019_BIN_HOST)
|
||||
|
||||
*_VS2019_*_MAKE_PATH = DEF(VS2019_BIN_HOST)\nmake.exe
|
||||
*_VS2019_*_MAKE_FLAG = /nologo
|
||||
*_VS2019_*_RC_PATH = DEF(RC_PATH)
|
||||
|
||||
*_VS2019_*_MAKE_FLAGS = /nologo
|
||||
*_VS2019_*_SLINK_FLAGS = /NOLOGO /LTCG
|
||||
*_VS2019_*_APP_FLAGS = /nologo /E /TC
|
||||
*_VS2019_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||
*_VS2019_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||
*_VS2019_*_DLINK2_FLAGS = /WHOLEARCHIVE
|
||||
*_VS2019_*_ASM16_PATH = DEF(VS2019_BIN_IA32)\ml.exe
|
||||
|
||||
##################
|
||||
# ASL definitions
|
||||
##################
|
||||
*_VS2019_*_ASL_PATH = DEF(WIN_IASL_BIN)
|
||||
*_VS2019_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
|
||||
*_VS2019_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
|
||||
*_VS2019_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
|
||||
*_VS2019_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
|
||||
*_VS2019_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
|
||||
|
||||
##################
|
||||
# IA32 definitions
|
||||
##################
|
||||
*_VS2019_IA32_CC_PATH = DEF(VS2019_BIN_IA32)\cl.exe
|
||||
*_VS2019_IA32_VFRPP_PATH = DEF(VS2019_BIN_IA32)\cl.exe
|
||||
*_VS2019_IA32_ASLCC_PATH = DEF(VS2019_BIN_IA32)\cl.exe
|
||||
*_VS2019_IA32_ASLPP_PATH = DEF(VS2019_BIN_IA32)\cl.exe
|
||||
*_VS2019_IA32_SLINK_PATH = DEF(VS2019_BIN_IA32)\lib.exe
|
||||
*_VS2019_IA32_DLINK_PATH = DEF(VS2019_BIN_IA32)\link.exe
|
||||
*_VS2019_IA32_ASLDLINK_PATH= DEF(VS2019_BIN_IA32)\link.exe
|
||||
*_VS2019_IA32_APP_PATH = DEF(VS2019_BIN_IA32)\cl.exe
|
||||
*_VS2019_IA32_PP_PATH = DEF(VS2019_BIN_IA32)\cl.exe
|
||||
*_VS2019_IA32_ASM_PATH = DEF(VS2019_BIN_IA32)\ml.exe
|
||||
|
||||
*_VS2019_IA32_MAKE_FLAGS = /nologo
|
||||
DEBUG_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
||||
RELEASE_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
||||
NOOPT_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
||||
|
||||
DEBUG_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||
RELEASE_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||
NOOPT_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||
|
||||
DEBUG_VS2019_IA32_NASM_FLAGS = -Ox -f win32 -g
|
||||
RELEASE_VS2019_IA32_NASM_FLAGS = -Ox -f win32
|
||||
NOOPT_VS2019_IA32_NASM_FLAGS = -O0 -f win32 -g
|
||||
|
||||
DEBUG_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
|
||||
RELEASE_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
|
||||
NOOPT_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
|
||||
|
||||
##################
|
||||
# X64 definitions
|
||||
##################
|
||||
*_VS2019_X64_CC_PATH = DEF(VS2019_BIN_X64)\cl.exe
|
||||
*_VS2019_X64_PP_PATH = DEF(VS2019_BIN_X64)\cl.exe
|
||||
*_VS2019_X64_APP_PATH = DEF(VS2019_BIN_X64)\cl.exe
|
||||
*_VS2019_X64_VFRPP_PATH = DEF(VS2019_BIN_X64)\cl.exe
|
||||
*_VS2019_X64_ASLCC_PATH = DEF(VS2019_BIN_X64)\cl.exe
|
||||
*_VS2019_X64_ASLPP_PATH = DEF(VS2019_BIN_X64)\cl.exe
|
||||
*_VS2019_X64_ASM_PATH = DEF(VS2019_BIN_X64)\ml64.exe
|
||||
*_VS2019_X64_SLINK_PATH = DEF(VS2019_BIN_X64)\lib.exe
|
||||
*_VS2019_X64_DLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
|
||||
*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
|
||||
|
||||
DEBUG_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
||||
RELEASE_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
||||
NOOPT_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
||||
|
||||
DEBUG_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||
RELEASE_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||
NOOPT_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||
|
||||
DEBUG_VS2019_X64_NASM_FLAGS = -Ox -f win64 -g
|
||||
RELEASE_VS2019_X64_NASM_FLAGS = -Ox -f win64
|
||||
NOOPT_VS2019_X64_NASM_FLAGS = -O0 -f win64 -g
|
||||
|
||||
DEBUG_VS2019_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
|
||||
RELEASE_VS2019_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
|
||||
NOOPT_VS2019_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
|
||||
|
||||
#################
|
||||
# ARM definitions
|
||||
#################
|
||||
*_VS2019_ARM_CC_PATH = DEF(VS2019_BIN_ARM)\cl.exe
|
||||
*_VS2019_ARM_VFRPP_PATH = DEF(VS2019_BIN_ARM)\cl.exe
|
||||
*_VS2019_ARM_SLINK_PATH = DEF(VS2019_BIN_ARM)\lib.exe
|
||||
*_VS2019_ARM_DLINK_PATH = DEF(VS2019_BIN_ARM)\link.exe
|
||||
*_VS2019_ARM_APP_PATH = DEF(VS2019_BIN_ARM)\cl.exe
|
||||
*_VS2019_ARM_PP_PATH = DEF(VS2019_BIN_ARM)\cl.exe
|
||||
*_VS2019_ARM_ASM_PATH = DEF(VS2019_BIN_ARM)\armasm.exe
|
||||
*_VS2019_ARM_ASLCC_PATH = DEF(VS2019_BIN_ARM)\cl.exe
|
||||
*_VS2019_ARM_ASLPP_PATH = DEF(VS2019_BIN_ARM)\cl.exe
|
||||
*_VS2019_ARM_ASLDLINK_PATH = DEF(VS2019_BIN_ARM)\link.exe
|
||||
|
||||
*_VS2019_ARM_MAKE_FLAGS = /nologo
|
||||
DEBUG_VS2019_ARM_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw /Oi-
|
||||
RELEASE_VS2019_ARM_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /Oi-
|
||||
NOOPT_VS2019_ARM_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /Oi-
|
||||
|
||||
DEBUG_VS2019_ARM_ASM_FLAGS = /nologo /g
|
||||
RELEASE_VS2019_ARM_ASM_FLAGS = /nologo
|
||||
NOOPT_VS2019_ARM_ASM_FLAGS = /nologo
|
||||
|
||||
DEBUG_VS2019_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
|
||||
RELEASE_VS2019_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
|
||||
NOOPT_VS2019_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
|
||||
|
||||
#####################
|
||||
# AARCH64 definitions
|
||||
#####################
|
||||
*_VS2019_AARCH64_CC_PATH = DEF(VS2019_BIN_AARCH64)\cl.exe
|
||||
*_VS2019_AARCH64_VFRPP_PATH = DEF(VS2019_BIN_AARCH64)\cl.exe
|
||||
*_VS2019_AARCH64_SLINK_PATH = DEF(VS2019_BIN_AARCH64)\lib.exe
|
||||
*_VS2019_AARCH64_DLINK_PATH = DEF(VS2019_BIN_AARCH64)\link.exe
|
||||
*_VS2019_AARCH64_APP_PATH = DEF(VS2019_BIN_AARCH64)\cl.exe
|
||||
*_VS2019_AARCH64_PP_PATH = DEF(VS2019_BIN_AARCH64)\cl.exe
|
||||
*_VS2019_AARCH64_ASM_PATH = DEF(VS2019_BIN_AARCH64)\armasm64.exe
|
||||
*_VS2019_AARCH64_ASLCC_PATH = DEF(VS2019_BIN_AARCH64)\cl.exe
|
||||
*_VS2019_AARCH64_ASLPP_PATH = DEF(VS2019_BIN_AARCH64)\cl.exe
|
||||
*_VS2019_AARCH64_ASLDLINK_PATH = DEF(VS2019_BIN_AARCH64)\link.exe
|
||||
|
||||
*_VS2019_AARCH64_MAKE_FLAGS = /nologo
|
||||
DEBUG_VS2019_AARCH64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw /Oi-
|
||||
RELEASE_VS2019_AARCH64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /Oi-
|
||||
NOOPT_VS2019_AARCH64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /Oi-
|
||||
|
||||
DEBUG_VS2019_AARCH64_ASM_FLAGS = /nologo /g
|
||||
RELEASE_VS2019_AARCH64_ASM_FLAGS = /nologo
|
||||
NOOPT_VS2019_AARCH64_ASM_FLAGS = /nologo
|
||||
|
||||
DEBUG_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /DEBUG
|
||||
RELEASE_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /MERGE:.rdata=.data
|
||||
NOOPT_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /DEBUG
|
||||
|
||||
##################
|
||||
# EBC definitions
|
||||
##################
|
||||
*_VS2019_EBC_*_FAMILY = INTEL
|
||||
|
||||
*_VS2019_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
|
||||
*_VS2019_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
|
||||
*_VS2019_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
|
||||
*_VS2019_EBC_SLINK_PATH = DEF(VS2019_BIN_IA32)\link.exe
|
||||
*_VS2019_EBC_DLINK_PATH = DEF(VS2019_BIN_IA32)\link.exe
|
||||
|
||||
*_VS2019_EBC_MAKE_FLAGS = /nologo
|
||||
*_VS2019_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||
*_VS2019_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
|
||||
*_VS2019_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||
*_VS2019_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
|
||||
*_VS2019_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
|
||||
|
||||
####################################################################################
|
||||
# GCC Common
|
||||
####################################################################################
|
||||
@@ -1724,13 +1929,13 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _Ref
|
||||
DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
|
||||
DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
|
||||
DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
|
||||
DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
|
||||
DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
|
||||
DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
|
||||
DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h
|
||||
DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h
|
||||
DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
|
||||
DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h
|
||||
DEFINE GCC_ASLCC_FLAGS = -x c
|
||||
DEFINE GCC_WINDRES_FLAGS = -J rc -O coff
|
||||
DEFINE GCC_DTCPP_FLAGS = -E -x assembler-with-cpp -imacros $(DEST_DIR_DEBUG)/AutoGen.h -nostdinc -undef
|
||||
DEFINE GCC_DTCPP_FLAGS = -E -x assembler-with-cpp -imacros AutoGen.h -nostdinc -undef
|
||||
DEFINE GCC_IA32_RC_FLAGS = -I binary -O elf32-i386 -B i386 --rename-section .data=.hii
|
||||
DEFINE GCC_X64_RC_FLAGS = -I binary -O elf64-x86-64 -B i386 --rename-section .data=.hii
|
||||
DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
|
||||
@@ -2516,6 +2721,99 @@ DEFINE CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH6
|
||||
RELEASE_CLANG38_AARCH64_CC_FLAGS = DEF(CLANG38_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
|
||||
RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
|
||||
|
||||
####################################################################################
|
||||
#
|
||||
# CLANGPDB - This configuration is used to compile under Windows/Linux/Mac to produce
|
||||
# PE/COFF binaries using LLVM/Clang/LLD with Link Time Optimization enabled
|
||||
#
|
||||
####################################################################################
|
||||
*_CLANGPDB_*_*_FAMILY = GCC
|
||||
*_CLANGPDB_*_*_BUILDRULEFAMILY = CLANGPDB
|
||||
*_CLANGPDB_*_MAKE_PATH = ENV(CLANG_HOST_BIN)make
|
||||
*_CLANGPDB_*_*_DLL = ENV(CLANGPDB_DLL)
|
||||
*_CLANGPDB_*_ASL_PATH = DEF(UNIX_IASL_BIN)
|
||||
|
||||
*_CLANGPDB_*_APP_FLAGS =
|
||||
*_CLANGPDB_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
|
||||
*_CLANGPDB_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
|
||||
*_CLANGPDB_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
|
||||
|
||||
DEFINE CLANGPDB_IA32_PREFIX = ENV(CLANG_BIN)
|
||||
DEFINE CLANGPDB_X64_PREFIX = ENV(CLANG_BIN)
|
||||
|
||||
DEFINE CLANGPDB_IA32_TARGET = -target i686-unknown-windows
|
||||
DEFINE CLANGPDB_X64_TARGET = -target x86_64-unknown-windows
|
||||
|
||||
DEFINE CLANGPDB_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-microsoft-enum-forward-reference
|
||||
DEFINE CLANGPDB_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-implicit-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -fms-compatibility -mno-stack-arg-probe
|
||||
|
||||
###########################
|
||||
# CLANGPDB IA32 definitions
|
||||
###########################
|
||||
*_CLANGPDB_IA32_CC_PATH = DEF(CLANGPDB_IA32_PREFIX)clang
|
||||
*_CLANGPDB_IA32_SLINK_PATH = DEF(CLANGPDB_IA32_PREFIX)llvm-lib
|
||||
*_CLANGPDB_IA32_DLINK_PATH = DEF(CLANGPDB_IA32_PREFIX)lld-link
|
||||
*_CLANGPDB_IA32_ASLDLINK_PATH = DEF(CLANGPDB_IA32_PREFIX)lld-link
|
||||
*_CLANGPDB_IA32_ASM_PATH = DEF(CLANGPDB_IA32_PREFIX)clang
|
||||
*_CLANGPDB_IA32_PP_PATH = DEF(CLANGPDB_IA32_PREFIX)clang
|
||||
*_CLANGPDB_IA32_VFRPP_PATH = DEF(CLANGPDB_IA32_PREFIX)clang
|
||||
*_CLANGPDB_IA32_ASLCC_PATH = DEF(CLANGPDB_IA32_PREFIX)clang
|
||||
*_CLANGPDB_IA32_ASLPP_PATH = DEF(CLANGPDB_IA32_PREFIX)clang
|
||||
*_CLANGPDB_IA32_RC_PATH = DEF(CLANGPDB_IA32_PREFIX)llvm-rc
|
||||
|
||||
*_CLANGPDB_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto DEF(CLANGPDB_IA32_TARGET)
|
||||
*_CLANGPDB_IA32_ASM_FLAGS = DEF(GCC_ASM_FLAGS) -m32 -march=i386 DEF(CLANGPDB_IA32_TARGET)
|
||||
*_CLANGPDB_IA32_OBJCOPY_FLAGS =
|
||||
*_CLANGPDB_IA32_NASM_FLAGS = -f win32
|
||||
*_CLANGPDB_IA32_PP_FLAGS = DEF(GCC_PP_FLAGS) DEF(CLANGPDB_IA32_TARGET)
|
||||
*_CLANGPDB_IA32_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGPDB_IA32_TARGET)
|
||||
*_CLANGPDB_IA32_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGPDB_IA32_TARGET)
|
||||
|
||||
DEBUG_CLANGPDB_IA32_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586 DEF(CLANGPDB_IA32_TARGET) -gcodeview
|
||||
DEBUG_CLANGPDB_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
||||
DEBUG_CLANGPDB_IA32_DLINK2_FLAGS =
|
||||
|
||||
RELEASE_CLANGPDB_IA32_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586 DEF(CLANGPDB_IA32_TARGET)
|
||||
RELEASE_CLANGPDB_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /MERGE:.rdata=.data /lldmap
|
||||
RELEASE_CLANGPDB_IA32_DLINK2_FLAGS =
|
||||
|
||||
NOOPT_CLANGPDB_IA32_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m32 -O0 -march=i586 DEF(CLANGPDB_IA32_TARGET) -gcodeview
|
||||
NOOPT_CLANGPDB_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
||||
NOOPT_CLANGPDB_IA32_DLINK2_FLAGS =
|
||||
|
||||
##########################
|
||||
# CLANGWIN X64 definitions
|
||||
##########################
|
||||
*_CLANGPDB_X64_CC_PATH = DEF(CLANGPDB_X64_PREFIX)clang
|
||||
*_CLANGPDB_X64_SLINK_PATH = DEF(CLANGPDB_X64_PREFIX)llvm-lib
|
||||
*_CLANGPDB_X64_DLINK_PATH = DEF(CLANGPDB_X64_PREFIX)lld-link
|
||||
*_CLANGPDB_X64_ASLDLINK_PATH = DEF(CLANGPDB_X64_PREFIX)lld-link
|
||||
*_CLANGPDB_X64_ASM_PATH = DEF(CLANGPDB_X64_PREFIX)clang
|
||||
*_CLANGPDB_X64_PP_PATH = DEF(CLANGPDB_X64_PREFIX)clang
|
||||
*_CLANGPDB_X64_VFRPP_PATH = DEF(CLANGPDB_X64_PREFIX)clang
|
||||
*_CLANGPDB_X64_ASLCC_PATH = DEF(CLANGPDB_X64_PREFIX)clang
|
||||
*_CLANGPDB_X64_ASLPP_PATH = DEF(CLANGPDB_X64_PREFIX)clang
|
||||
*_CLANGPDB_X64_RC_PATH = DEF(CLANGPDB_IA32_PREFIX)llvm-rc
|
||||
|
||||
*_CLANGPDB_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64 -fno-lto DEF(CLANGPDB_X64_TARGET)
|
||||
*_CLANGPDB_X64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) -m64 DEF(CLANGPDB_X64_TARGET)
|
||||
*_CLANGPDB_X64_OBJCOPY_FLAGS =
|
||||
*_CLANGPDB_X64_NASM_FLAGS = -f win64
|
||||
*_CLANGPDB_X64_PP_FLAGS = DEF(GCC_PP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
||||
*_CLANGPDB_X64_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
||||
*_CLANGPDB_X64_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
||||
|
||||
DEBUG_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -Oz -flto DEF(CLANGPDB_X64_TARGET) -gcodeview
|
||||
DEBUG_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
||||
DEBUG_CLANGPDB_X64_DLINK2_FLAGS =
|
||||
|
||||
RELEASE_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -Oz -flto DEF(CLANGPDB_X64_TARGET)
|
||||
RELEASE_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /MERGE:.rdata=.data /lldmap
|
||||
RELEASE_CLANGPDB_X64_DLINK2_FLAGS =
|
||||
|
||||
NOOPT_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -O0 DEF(CLANGPDB_X64_TARGET) -gcodeview
|
||||
NOOPT_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
||||
NOOPT_CLANGPDB_X64_DLINK2_FLAGS =
|
||||
|
||||
|
||||
#
|
||||
@@ -2590,11 +2888,11 @@ RELEASE_XCODE5_X64_DLINK_FLAGS = -arch x86_64 -u _$(IMAGE_ENTRY_POINT) -e _
|
||||
NOOPT_XCODE5_X64_ASM_FLAGS = -arch x86_64 -g
|
||||
RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64
|
||||
*_XCODE5_X64_NASM_FLAGS = -f macho64
|
||||
*_XCODE5_*_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
|
||||
*_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
|
||||
*_XCODE5_*_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h
|
||||
*_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(MODULE_NAME)StrDefs.h
|
||||
|
||||
DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -gdwarf -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -gdwarf -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -Wno-unused-const-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
|
||||
####################################################################################
|
||||
@@ -2630,7 +2928,7 @@ RELEASE_RVCT_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS)
|
||||
|
||||
*_RVCT_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)
|
||||
*_RVCT_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E --preinclude AutoGen.h
|
||||
*_RVCT_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
|
||||
*_RVCT_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(MODULE_NAME)StrDefs.h
|
||||
*_RVCT_ARM_MAKE_PATH = nmake /NOLOGO
|
||||
*_RVCT_ARM_SLINK_FLAGS = --partial -o
|
||||
DEBUG_RVCT_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g
|
||||
@@ -2671,7 +2969,7 @@ RELEASE_RVCTLINUX_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAG
|
||||
|
||||
*_RVCTLINUX_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)
|
||||
*_RVCTLINUX_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
|
||||
*_RVCTLINUX_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
|
||||
*_RVCTLINUX_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(MODULE_NAME)StrDefs.h
|
||||
*_RVCTLINUX_ARM_SLINK_FLAGS = --partial -o
|
||||
DEBUG_RVCTLINUX_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g
|
||||
RELEASE_RVCTLINUX_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2
|
||||
@@ -2718,7 +3016,7 @@ RELEASE_RVCTCYGWIN_ARM_DLINK_FLAGS = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS)
|
||||
|
||||
*_RVCTCYGWIN_ARM_ASM_FLAGS = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)
|
||||
*_RVCTCYGWIN_ARM_PP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
|
||||
*_RVCTCYGWIN_ARM_VFRPP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`
|
||||
*_RVCTCYGWIN_ARM_VFRPP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude `cygpath -m $(MODULE_NAME)StrDefs.h`
|
||||
*_RVCTCYGWIN_ARM_MAKE_PATH = make
|
||||
*_RVCTCYGWIN_ARM_SLINK_FLAGS = "$(SLINKPATH_FLAG)" --partial -o
|
||||
DEBUG_RVCTCYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# @file Edk2ToolsBuild.py
|
||||
# Invocable class that builds the basetool c files.
|
||||
#
|
||||
# Supports VS2017, VS2019, and GCC5
|
||||
##
|
||||
# Copyright (c) Microsoft Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
import argparse
|
||||
from edk2toolext import edk2_logging
|
||||
from edk2toolext.environment import self_describing_environment
|
||||
from edk2toolext.base_abstract_invocable import BaseAbstractInvocable
|
||||
from edk2toollib.utility_functions import RunCmd
|
||||
from edk2toollib.windows.locate_tools import QueryVcVariables
|
||||
|
||||
|
||||
class Edk2ToolsBuild(BaseAbstractInvocable):
|
||||
|
||||
def ParseCommandLineOptions(self):
|
||||
''' parse arguments '''
|
||||
ParserObj = argparse.ArgumentParser()
|
||||
ParserObj.add_argument("-t", "--tool_chain_tag", dest="tct", default="VS2017",
|
||||
help="Set the toolchain used to compile the build tools")
|
||||
args = ParserObj.parse_args()
|
||||
self.tool_chain_tag = args.tct
|
||||
|
||||
def GetWorkspaceRoot(self):
|
||||
''' Return the workspace root for initializing the SDE '''
|
||||
|
||||
# this is the bastools dir...not the traditional EDK2 workspace root
|
||||
return os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
def GetActiveScopes(self):
|
||||
''' return tuple containing scopes that should be active for this process '''
|
||||
|
||||
# for now don't use scopes
|
||||
return ('global',)
|
||||
|
||||
def GetLoggingLevel(self, loggerType):
|
||||
''' Get the logging level for a given type (return Logging.Level)
|
||||
base == lowest logging level supported
|
||||
con == Screen logging
|
||||
txt == plain text file logging
|
||||
md == markdown file logging
|
||||
'''
|
||||
if(loggerType == "con"):
|
||||
return logging.ERROR
|
||||
else:
|
||||
return logging.DEBUG
|
||||
|
||||
def GetLoggingFolderRelativeToRoot(self):
|
||||
''' Return a path to folder for log files '''
|
||||
return "BaseToolsBuild"
|
||||
|
||||
def GetVerifyCheckRequired(self):
|
||||
''' Will call self_describing_environment.VerifyEnvironment if this returns True '''
|
||||
return True
|
||||
|
||||
def GetLoggingFileName(self, loggerType):
|
||||
''' Get the logging file name for the type.
|
||||
Return None if the logger shouldn't be created
|
||||
|
||||
base == lowest logging level supported
|
||||
con == Screen logging
|
||||
txt == plain text file logging
|
||||
md == markdown file logging
|
||||
'''
|
||||
return "BASETOOLS_BUILD"
|
||||
|
||||
def WritePathEnvFile(self, OutputDir):
|
||||
''' Write a PyTool path env file for future PyTool based edk2 builds'''
|
||||
content = '''##
|
||||
# Set shell variable EDK_TOOLS_BIN to this folder
|
||||
#
|
||||
# Autogenerated by Edk2ToolsBuild.py
|
||||
#
|
||||
# Copyright (c), Microsoft Corporation
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
"id": "You-Built-BaseTools",
|
||||
"scope": "edk2-build",
|
||||
"flags": ["set_shell_var", "set_path"],
|
||||
"var_name": "EDK_TOOLS_BIN"
|
||||
}
|
||||
'''
|
||||
with open(os.path.join(OutputDir, "basetoolsbin_path_env.yaml"), "w") as f:
|
||||
f.write(content)
|
||||
|
||||
def Go(self):
|
||||
logging.info("Running Python version: " + str(sys.version_info))
|
||||
|
||||
(build_env, shell_env) = self_describing_environment.BootstrapEnvironment(
|
||||
self.GetWorkspaceRoot(), self.GetActiveScopes())
|
||||
|
||||
# # Bind our current execution environment into the shell vars.
|
||||
ph = os.path.dirname(sys.executable)
|
||||
if " " in ph:
|
||||
ph = '"' + ph + '"'
|
||||
shell_env.set_shell_var("PYTHON_HOME", ph)
|
||||
# PYTHON_COMMAND is required to be set for using edk2 python builds.
|
||||
pc = sys.executable
|
||||
if " " in pc:
|
||||
pc = '"' + pc + '"'
|
||||
shell_env.set_shell_var("PYTHON_COMMAND", pc)
|
||||
|
||||
if self.tool_chain_tag.lower().startswith("vs"):
|
||||
|
||||
# # Update environment with required VC vars.
|
||||
interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB"]
|
||||
interesting_keys.extend(
|
||||
["LIBPATH", "Path", "UniversalCRTSdkDir", "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath"])
|
||||
interesting_keys.extend(
|
||||
["WindowsSdkDir", "WindowsSdkVerBinPath", "WindowsSDKVersion", "VCToolsInstallDir"])
|
||||
vc_vars = QueryVcVariables(
|
||||
interesting_keys, 'x86', vs_version=self.tool_chain_tag.lower())
|
||||
for key in vc_vars.keys():
|
||||
logging.debug(f"Var - {key} = {vc_vars[key]}")
|
||||
if key.lower() == 'path':
|
||||
shell_env.insert_path(vc_vars[key])
|
||||
else:
|
||||
shell_env.set_shell_var(key, vc_vars[key])
|
||||
|
||||
self.OutputDir = os.path.join(
|
||||
shell_env.get_shell_var("EDK_TOOLS_PATH"), "Bin", "Win32")
|
||||
|
||||
# compiled tools need to be added to path because antlr is referenced
|
||||
shell_env.insert_path(self.OutputDir)
|
||||
|
||||
# Actually build the tools.
|
||||
ret = RunCmd('nmake.exe', None,
|
||||
workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
|
||||
if ret != 0:
|
||||
raise Exception("Failed to build.")
|
||||
|
||||
self.WritePathEnvFile(self.OutputDir)
|
||||
return ret
|
||||
|
||||
elif self.tool_chain_tag.lower().startswith("gcc"):
|
||||
ret = RunCmd("make", "-C .", workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
|
||||
if ret != 0:
|
||||
raise Exception("Failed to build.")
|
||||
|
||||
self.OutputDir = os.path.join(
|
||||
shell_env.get_shell_var("EDK_TOOLS_PATH"), "Source", "C", "bin")
|
||||
|
||||
self.WritePathEnvFile(self.OutputDir)
|
||||
return ret
|
||||
|
||||
logging.critical("Tool Chain not supported")
|
||||
return -1
|
||||
|
||||
|
||||
def main():
|
||||
Edk2ToolsBuild().Invoke()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -937,7 +937,7 @@ Arguments:
|
||||
|
||||
Fv - Address of the Fv in memory
|
||||
Key - Should be 0 to get the first file. After that, it should be
|
||||
passed back in without modifying it's contents to retrieve
|
||||
passed back in without modifying its contents to retrieve
|
||||
subsequent files.
|
||||
File - Output file pointer
|
||||
File == NULL - invalid parameter
|
||||
@@ -1323,7 +1323,7 @@ Arguments:
|
||||
SectionsStart - Address of the start of the FFS sections array
|
||||
TotalSectionsSize - Total size of all the sections
|
||||
Key - Should be 0 to get the first section. After that, it should be
|
||||
passed back in without modifying it's contents to retrieve
|
||||
passed back in without modifying its contents to retrieve
|
||||
subsequent files.
|
||||
Section - Output section pointer
|
||||
(Section == NULL) -> invalid parameter
|
||||
|
||||
@@ -791,6 +791,7 @@ Returns:
|
||||
FILE *PeMapFile;
|
||||
CHAR8 Line [MAX_LINE_LEN];
|
||||
CHAR8 KeyWord [MAX_LINE_LEN];
|
||||
CHAR8 KeyWord2 [MAX_LINE_LEN];
|
||||
CHAR8 FunctionName [MAX_LINE_LEN];
|
||||
EFI_PHYSICAL_ADDRESS FunctionAddress;
|
||||
UINT32 FunctionType;
|
||||
@@ -805,6 +806,7 @@ Returns:
|
||||
UINT32 TextVirtualAddress;
|
||||
UINT32 DataVirtualAddress;
|
||||
EFI_PHYSICAL_ADDRESS LinkTimeBaseAddress;
|
||||
BOOLEAN IsUseClang;
|
||||
|
||||
//
|
||||
// Init local variable
|
||||
@@ -932,6 +934,7 @@ Returns:
|
||||
// Output Functions information into Fv Map file
|
||||
//
|
||||
LinkTimeBaseAddress = 0;
|
||||
IsUseClang = FALSE;
|
||||
while (fgets (Line, MAX_LINE_LEN, PeMapFile) != NULL) {
|
||||
//
|
||||
// Skip blank line
|
||||
@@ -946,6 +949,12 @@ Returns:
|
||||
if (FunctionType == 0) {
|
||||
sscanf (Line, "%s", KeyWord);
|
||||
if (stricmp (KeyWord, "Address") == 0) {
|
||||
sscanf (Line, "%s %s", KeyWord, KeyWord2);
|
||||
if (stricmp (KeyWord2, "Size") == 0) {
|
||||
IsUseClang = TRUE;
|
||||
FunctionType = 1;
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// function list
|
||||
//
|
||||
@@ -967,11 +976,20 @@ Returns:
|
||||
// Printf Function Information
|
||||
//
|
||||
if (FunctionType == 1) {
|
||||
sscanf (Line, "%s %s %llx %s", KeyWord, FunctionName, &TempLongAddress, FunctionTypeName);
|
||||
FunctionAddress = (UINT64) TempLongAddress;
|
||||
if (FunctionTypeName [1] == '\0' && (FunctionTypeName [0] == 'f' || FunctionTypeName [0] == 'F')) {
|
||||
fprintf (FvMapFile, " 0x%010llx ", (unsigned long long) (ImageBaseAddress + FunctionAddress - LinkTimeBaseAddress));
|
||||
fprintf (FvMapFile, "%s\n", FunctionName);
|
||||
if (IsUseClang) {
|
||||
sscanf (Line, "%llx %s %s %s", &TempLongAddress, KeyWord, KeyWord2, FunctionTypeName);
|
||||
FunctionAddress = (UINT64) TempLongAddress;
|
||||
if (FunctionTypeName [0] == '_' ) {
|
||||
fprintf (FvMapFile, " 0x%010llx ", (unsigned long long) (ImageBaseAddress + FunctionAddress - LinkTimeBaseAddress));
|
||||
fprintf (FvMapFile, "%s\n", FunctionTypeName);
|
||||
}
|
||||
} else {
|
||||
sscanf (Line, "%s %s %llx %s", KeyWord, FunctionName, &TempLongAddress, FunctionTypeName);
|
||||
FunctionAddress = (UINT64) TempLongAddress;
|
||||
if (FunctionTypeName [1] == '\0' && (FunctionTypeName [0] == 'f' || FunctionTypeName [0] == 'F')) {
|
||||
fprintf (FvMapFile, " 0x%010llx ", (unsigned long long) (ImageBaseAddress + FunctionAddress - LinkTimeBaseAddress));
|
||||
fprintf (FvMapFile, "%s\n", FunctionName);
|
||||
}
|
||||
}
|
||||
} else if (FunctionType == 2) {
|
||||
sscanf (Line, "%s %s %llx %s", KeyWord, FunctionName, &TempLongAddress, FunctionTypeName);
|
||||
|
||||
@@ -1017,8 +1017,46 @@ WriteSections64 (
|
||||
} else if (mEhdr->e_machine == EM_AARCH64) {
|
||||
|
||||
switch (ELF_R_TYPE(Rel->r_info)) {
|
||||
INT64 Offset;
|
||||
|
||||
case R_AARCH64_LD64_GOT_LO12_NC:
|
||||
//
|
||||
// Convert into an ADD instruction - see R_AARCH64_ADR_GOT_PAGE below.
|
||||
//
|
||||
*(UINT32 *)Targ &= 0x3ff;
|
||||
*(UINT32 *)Targ |= 0x91000000 | ((Sym->st_value & 0xfff) << 10);
|
||||
break;
|
||||
|
||||
case R_AARCH64_ADR_GOT_PAGE:
|
||||
//
|
||||
// This relocation points to the GOT entry that contains the absolute
|
||||
// address of the symbol we are referring to. Since EDK2 only uses
|
||||
// fully linked binaries, we can avoid the indirection, and simply
|
||||
// refer to the symbol directly. This implies having to patch the
|
||||
// subsequent LDR instruction (covered by a R_AARCH64_LD64_GOT_LO12_NC
|
||||
// relocation) into an ADD instruction - this is handled above.
|
||||
//
|
||||
Offset = (Sym->st_value - (Rel->r_offset & ~0xfff)) >> 12;
|
||||
|
||||
*(UINT32 *)Targ &= 0x9000001f;
|
||||
*(UINT32 *)Targ |= ((Offset & 0x1ffffc) << (5 - 2)) | ((Offset & 0x3) << 29);
|
||||
|
||||
/* fall through */
|
||||
|
||||
case R_AARCH64_ADR_PREL_PG_HI21:
|
||||
//
|
||||
// In order to handle Cortex-A53 erratum #843419, the LD linker may
|
||||
// convert ADRP instructions into ADR instructions, but without
|
||||
// updating the static relocation type, and so we may end up here
|
||||
// while the instruction in question is actually ADR. So let's
|
||||
// just disregard it: the section offset check we apply below to
|
||||
// ADR instructions will trigger for its R_AARCH64_xxx_ABS_LO12_NC
|
||||
// companion instruction as well, so it is safe to omit it here.
|
||||
//
|
||||
if ((*(UINT32 *)Targ & BIT31) == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// AArch64 PG_H21 relocations are typically paired with ABS_LO12
|
||||
// relocations, where a PC-relative reference with +/- 4 GB range is
|
||||
@@ -1037,7 +1075,6 @@ WriteSections64 (
|
||||
// Attempt to convert the ADRP into an ADR instruction.
|
||||
// This is only possible if the symbol is within +/- 1 MB.
|
||||
//
|
||||
INT64 Offset;
|
||||
|
||||
// Decode the ADRP instruction
|
||||
Offset = (INT32)((*(UINT32 *)Targ & 0xffffe0) << 8);
|
||||
@@ -1212,6 +1249,8 @@ WriteRelocations64 (
|
||||
case R_AARCH64_LDST32_ABS_LO12_NC:
|
||||
case R_AARCH64_LDST64_ABS_LO12_NC:
|
||||
case R_AARCH64_LDST128_ABS_LO12_NC:
|
||||
case R_AARCH64_ADR_GOT_PAGE:
|
||||
case R_AARCH64_LD64_GOT_LO12_NC:
|
||||
//
|
||||
// No fixups are required for relative relocations, provided that
|
||||
// the relative offsets between sections have been preserved in
|
||||
|
||||
@@ -653,7 +653,11 @@ PeCoffConvertImageToXip (
|
||||
//
|
||||
// Make the size of raw data in section header alignment.
|
||||
//
|
||||
SectionHeader->SizeOfRawData = (SectionHeader->Misc.VirtualSize + PeHdr->Pe32.OptionalHeader.FileAlignment - 1) & (~(PeHdr->Pe32.OptionalHeader.FileAlignment - 1));
|
||||
SectionSize = (SectionHeader->Misc.VirtualSize + PeHdr->Pe32.OptionalHeader.FileAlignment - 1) & (~(PeHdr->Pe32.OptionalHeader.FileAlignment - 1));
|
||||
if (SectionSize < SectionHeader->SizeOfRawData) {
|
||||
SectionHeader->SizeOfRawData = SectionSize;
|
||||
}
|
||||
|
||||
SectionHeader->PointerToRawData = SectionHeader->VirtualAddress;
|
||||
}
|
||||
|
||||
@@ -999,7 +1003,7 @@ Returns:
|
||||
CopyMem (
|
||||
FileBuffer + SectionHeader->PointerToRawData,
|
||||
(VOID*) (UINTN) (ImageContext.ImageAddress + SectionHeader->VirtualAddress),
|
||||
SectionHeader->SizeOfRawData
|
||||
SectionHeader->SizeOfRawData < SectionHeader->Misc.VirtualSize ? SectionHeader->SizeOfRawData : SectionHeader->Misc.VirtualSize
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1111,6 +1115,7 @@ Returns:
|
||||
time_t InputFileTime;
|
||||
time_t OutputFileTime;
|
||||
struct stat Stat_Buf;
|
||||
BOOLEAN ZeroDebugFlag;
|
||||
|
||||
SetUtilityName (UTILITY_NAME);
|
||||
|
||||
@@ -1158,6 +1163,7 @@ Returns:
|
||||
NegativeAddr = FALSE;
|
||||
InputFileTime = 0;
|
||||
OutputFileTime = 0;
|
||||
ZeroDebugFlag = FALSE;
|
||||
|
||||
if (argc == 1) {
|
||||
Error (NULL, 0, 1001, "Missing options", "No input options.");
|
||||
@@ -1197,6 +1203,9 @@ Returns:
|
||||
goto Finish;
|
||||
}
|
||||
ModuleType = argv[1];
|
||||
if (mOutImageType == FW_ZERO_DEBUG_IMAGE) {
|
||||
ZeroDebugFlag = TRUE;
|
||||
}
|
||||
if (mOutImageType != FW_TE_IMAGE) {
|
||||
mOutImageType = FW_EFI_IMAGE;
|
||||
}
|
||||
@@ -1220,6 +1229,9 @@ Returns:
|
||||
}
|
||||
|
||||
if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--terse") == 0)) {
|
||||
if (mOutImageType == FW_ZERO_DEBUG_IMAGE) {
|
||||
ZeroDebugFlag = TRUE;
|
||||
}
|
||||
mOutImageType = FW_TE_IMAGE;
|
||||
argc --;
|
||||
argv ++;
|
||||
@@ -1241,7 +1253,12 @@ Returns:
|
||||
}
|
||||
|
||||
if ((stricmp (argv[0], "-z") == 0) || (stricmp (argv[0], "--zero") == 0)) {
|
||||
mOutImageType = FW_ZERO_DEBUG_IMAGE;
|
||||
if (mOutImageType == FW_DUMMY_IMAGE) {
|
||||
mOutImageType = FW_ZERO_DEBUG_IMAGE;
|
||||
}
|
||||
if (mOutImageType == FW_TE_IMAGE || mOutImageType == FW_EFI_IMAGE) {
|
||||
ZeroDebugFlag = TRUE;
|
||||
}
|
||||
argc --;
|
||||
argv ++;
|
||||
continue;
|
||||
@@ -2588,7 +2605,7 @@ Returns:
|
||||
//
|
||||
// Zero Time/Data field
|
||||
//
|
||||
ZeroDebugData (FileBuffer, FALSE);
|
||||
ZeroDebugData (FileBuffer, ZeroDebugFlag);
|
||||
|
||||
if (mOutImageType == FW_TE_IMAGE) {
|
||||
if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type &~0xFF)) {
|
||||
|
||||
@@ -41,21 +41,21 @@
|
||||
typedef signed char INT8;
|
||||
#else
|
||||
//
|
||||
// Assume standard AARCH64 alignment.
|
||||
// Use ANSI C 2000 stdint.h integer width declarations
|
||||
//
|
||||
typedef unsigned long long UINT64;
|
||||
typedef long long INT64;
|
||||
typedef unsigned int UINT32;
|
||||
typedef int INT32;
|
||||
typedef unsigned short UINT16;
|
||||
typedef unsigned short CHAR16;
|
||||
typedef short INT16;
|
||||
typedef unsigned char BOOLEAN;
|
||||
typedef unsigned char UINT8;
|
||||
typedef char CHAR8;
|
||||
typedef signed char INT8;
|
||||
#include <stdint.h>
|
||||
typedef uint8_t BOOLEAN;
|
||||
typedef int8_t INT8;
|
||||
typedef uint8_t UINT8;
|
||||
typedef int16_t INT16;
|
||||
typedef uint16_t UINT16;
|
||||
typedef int32_t INT32;
|
||||
typedef uint32_t UINT32;
|
||||
typedef int64_t INT64;
|
||||
typedef uint64_t UINT64;
|
||||
typedef char CHAR8;
|
||||
typedef uint16_t CHAR16;
|
||||
|
||||
#define UINT8_MAX 0xff
|
||||
#endif
|
||||
|
||||
///
|
||||
|
||||
@@ -151,7 +151,7 @@ typedef struct {
|
||||
|
||||
///
|
||||
/// _CR - returns a pointer to the structure
|
||||
/// from one of it's elements.
|
||||
/// from one of its elements.
|
||||
///
|
||||
#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
## @file
|
||||
# GNU/Linux makefile for 'LzmaCompress' module build.
|
||||
#
|
||||
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
MAKEROOT ?= ..
|
||||
|
||||
APPNAME = LzmaCompress
|
||||
|
||||
LIBS = -lCommon
|
||||
|
||||
SDK_C = Sdk/C
|
||||
|
||||
OBJECTS = \
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
LzmaUtil.c -- Test application for LZMA compression
|
||||
2018-04-30 : Igor Pavlov : Public domain
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "Sdk/C/LzmaEnc.h"
|
||||
#include "Sdk/C/Bra.h"
|
||||
#include "CommonLib.h"
|
||||
#include "ParseInf.h"
|
||||
|
||||
#define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)
|
||||
|
||||
@@ -36,10 +37,14 @@ const char *kCantReadMessage = "Can not read input file";
|
||||
const char *kCantWriteMessage = "Can not write output file";
|
||||
const char *kCantAllocateMessage = "Can not allocate memory";
|
||||
const char *kDataErrorMessage = "Data error";
|
||||
const char *kInvalidParamValMessage = "Invalid parameter value";
|
||||
|
||||
static Bool mQuietMode = False;
|
||||
static CONVERTER_TYPE mConType = NoConverter;
|
||||
|
||||
UINT64 mDictionarySize = 28;
|
||||
UINT64 mCompressionMode = 2;
|
||||
|
||||
#define UTILITY_NAME "LzmaCompress"
|
||||
#define UTILITY_MAJOR_VERSION 0
|
||||
#define UTILITY_MINOR_VERSION 2
|
||||
@@ -58,6 +63,8 @@ void PrintHelp(char *buffer)
|
||||
" -v, --verbose: increase output messages\n"
|
||||
" -q, --quiet: reduce output messages\n"
|
||||
" --debug [0-9]: set debug level\n"
|
||||
" -a: set compression mode 0 = fast, 1 = normal, default: 1 (normal)\n"
|
||||
" d: sets Dictionary size - [0, 27], default: 24 (16MB)\n"
|
||||
" --version: display the program version and exit\n"
|
||||
" -h, --help: display this help text\n"
|
||||
);
|
||||
@@ -87,7 +94,7 @@ void PrintVersion(char *buffer)
|
||||
sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
|
||||
}
|
||||
|
||||
static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize)
|
||||
static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, CLzmaEncProps *props)
|
||||
{
|
||||
SRes res;
|
||||
size_t inSize = (size_t)fileSize;
|
||||
@@ -95,10 +102,6 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file
|
||||
Byte *outBuffer = 0;
|
||||
Byte *filteredStream = 0;
|
||||
size_t outSize;
|
||||
CLzmaEncProps props;
|
||||
|
||||
LzmaEncProps_Init(&props);
|
||||
LzmaEncProps_Normalize(&props);
|
||||
|
||||
if (inSize != 0) {
|
||||
inBuffer = (Byte *)MyAlloc(inSize);
|
||||
@@ -151,7 +154,7 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file
|
||||
|
||||
res = LzmaEncode(outBuffer + LZMA_HEADER_SIZE, &outSizeProcessed,
|
||||
mConType != NoConverter ? filteredStream : inBuffer, inSize,
|
||||
&props, outBuffer, &outPropsSize, 0,
|
||||
props, outBuffer, &outPropsSize, 0,
|
||||
NULL, &g_Alloc, &g_Alloc);
|
||||
|
||||
if (res != SZ_OK)
|
||||
@@ -246,6 +249,10 @@ int main2(int numArgs, const char *args[], char *rs)
|
||||
const char *outputFile = "file.tmp";
|
||||
int param;
|
||||
UInt64 fileSize;
|
||||
CLzmaEncProps props;
|
||||
|
||||
LzmaEncProps_Init(&props);
|
||||
LzmaEncProps_Normalize(&props);
|
||||
|
||||
FileSeqInStream_CreateVTable(&inStream);
|
||||
File_Construct(&inStream.file);
|
||||
@@ -280,6 +287,28 @@ int main2(int numArgs, const char *args[], char *rs)
|
||||
// parameter compatibility with other build tools.
|
||||
//
|
||||
param++;
|
||||
} else if (strcmp(args[param], "-a") == 0) {
|
||||
AsciiStringToUint64(args[param + 1],FALSE,&mCompressionMode);
|
||||
if ((mCompressionMode == 0)||(mCompressionMode == 1)){
|
||||
props.algo = (int)mCompressionMode;
|
||||
param++;
|
||||
continue;
|
||||
} else {
|
||||
return PrintError(rs, kInvalidParamValMessage);
|
||||
}
|
||||
} else if (strcmp(args[param], "d") == 0) {
|
||||
AsciiStringToUint64(args[param + 1],FALSE,&mDictionarySize);
|
||||
if (mDictionarySize <= 27) {
|
||||
if (mDictionarySize == 0) {
|
||||
props.dictSize = 0;
|
||||
} else {
|
||||
props.dictSize = (1 << mDictionarySize);
|
||||
}
|
||||
param++;
|
||||
continue;
|
||||
} else {
|
||||
return PrintError(rs, kInvalidParamValMessage);
|
||||
}
|
||||
} else if (
|
||||
strcmp(args[param], "-h") == 0 ||
|
||||
strcmp(args[param], "--help") == 0
|
||||
@@ -335,7 +364,7 @@ int main2(int numArgs, const char *args[], char *rs)
|
||||
if (!mQuietMode) {
|
||||
printf("Encoding\n");
|
||||
}
|
||||
res = Encode(&outStream.vt, &inStream.vt, fileSize);
|
||||
res = Encode(&outStream.vt, &inStream.vt, fileSize, &props);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
## @file
|
||||
# Windows makefile for 'LzmaCompress' module build.
|
||||
#
|
||||
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
!INCLUDE ..\Makefiles\ms.common
|
||||
|
||||
APPNAME = LzmaCompress
|
||||
|
||||
#LIBS = $(LIB_PATH)\Common.lib
|
||||
LIBS = $(LIB_PATH)\Common.lib
|
||||
|
||||
SDK_C = Sdk\C
|
||||
|
||||
|
||||
@@ -1,163 +1,163 @@
|
||||
# @file NmakeSubdirs.py
|
||||
# This script support parallel build for nmake in windows environment.
|
||||
# It supports Python2.x and Python3.x both.
|
||||
#
|
||||
# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
|
||||
#
|
||||
# Import Modules
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import argparse
|
||||
import threading
|
||||
import time
|
||||
import os
|
||||
import subprocess
|
||||
import multiprocessing
|
||||
import copy
|
||||
import sys
|
||||
__prog__ = 'NmakeSubdirs'
|
||||
__version__ = '%s Version %s' % (__prog__, '0.10 ')
|
||||
__copyright__ = 'Copyright (c) 2018, Intel Corporation. All rights reserved.'
|
||||
__description__ = 'Replace for NmakeSubdirs.bat in windows ,support parallel build for nmake.\n'
|
||||
|
||||
cpu_count = multiprocessing.cpu_count()
|
||||
output_lock = threading.Lock()
|
||||
def RunCommand(WorkDir=None, *Args, **kwargs):
|
||||
if WorkDir is None:
|
||||
WorkDir = os.curdir
|
||||
if "stderr" not in kwargs:
|
||||
kwargs["stderr"] = subprocess.STDOUT
|
||||
if "stdout" not in kwargs:
|
||||
kwargs["stdout"] = sys.stdout
|
||||
p = subprocess.Popen(Args, cwd=WorkDir, stderr=kwargs["stderr"], stdout=kwargs["stdout"])
|
||||
stdout, stderr = p.communicate()
|
||||
message = ""
|
||||
if stdout is not None:
|
||||
message = stdout.decode(encoding='utf-8', errors='ignore') #for compatibility in python 2 and 3
|
||||
|
||||
if p.returncode != 0:
|
||||
raise RuntimeError("Error while execute command \'{0}\' in direcotry {1}\n{2}".format(" ".join(Args), WorkDir, message))
|
||||
|
||||
output_lock.acquire(True)
|
||||
print("execute command \"{0}\" in directory {1}".format(" ".join(Args), WorkDir))
|
||||
print(message)
|
||||
output_lock.release()
|
||||
|
||||
return p.returncode, stdout
|
||||
|
||||
class TaskUnit(object):
|
||||
def __init__(self, func, args, kwargs):
|
||||
self.func = func
|
||||
self.args = args
|
||||
self.kwargs = kwargs
|
||||
|
||||
def __eq__(self, other):
|
||||
return id(self).__eq__(id(other))
|
||||
|
||||
def run(self):
|
||||
return self.func(*self.args, **self.kwargs)
|
||||
|
||||
def __str__(self):
|
||||
para = list(self.args)
|
||||
para.extend("{0}={1}".format(k, v)for k, v in self.kwargs.items())
|
||||
|
||||
return "{0}({1})".format(self.func.__name__, ",".join(para))
|
||||
|
||||
class ThreadControl(object):
|
||||
|
||||
def __init__(self, maxthread):
|
||||
self._processNum = maxthread
|
||||
self.pending = []
|
||||
self.running = []
|
||||
self.pendingLock = threading.Lock()
|
||||
self.runningLock = threading.Lock()
|
||||
self.error = False
|
||||
self.errorLock = threading.Lock()
|
||||
self.errorMsg = "errorMsg"
|
||||
|
||||
def addTask(self, func, *args, **kwargs):
|
||||
self.pending.append(TaskUnit(func, args, kwargs))
|
||||
|
||||
def waitComplete(self):
|
||||
self._schedule.join()
|
||||
|
||||
def startSchedule(self):
|
||||
self._schedule = threading.Thread(target=self.Schedule)
|
||||
self._schedule.start()
|
||||
|
||||
def Schedule(self):
|
||||
for i in range(self._processNum):
|
||||
task = threading.Thread(target=self.startTask)
|
||||
task.daemon = False
|
||||
self.running.append(task)
|
||||
|
||||
self.runningLock.acquire(True)
|
||||
for thread in self.running:
|
||||
thread.start()
|
||||
self.runningLock.release()
|
||||
|
||||
while len(self.running) > 0:
|
||||
time.sleep(0.1)
|
||||
if self.error:
|
||||
print("subprocess not exit sucessfully")
|
||||
print(self.errorMsg)
|
||||
|
||||
def startTask(self):
|
||||
while True:
|
||||
if self.error:
|
||||
break
|
||||
self.pendingLock.acquire(True)
|
||||
if len(self.pending) == 0:
|
||||
self.pendingLock.release()
|
||||
break
|
||||
task = self.pending.pop(0)
|
||||
self.pendingLock.release()
|
||||
try:
|
||||
task.run()
|
||||
except RuntimeError as e:
|
||||
if self.error: break
|
||||
self.errorLock.acquire(True)
|
||||
self.error = True
|
||||
self.errorMsg = str(e)
|
||||
time.sleep(0.1)
|
||||
self.errorLock.release()
|
||||
break
|
||||
|
||||
self.runningLock.acquire(True)
|
||||
self.running.remove(threading.currentThread())
|
||||
self.runningLock.release()
|
||||
|
||||
def Run():
|
||||
curdir = os.path.abspath(os.curdir)
|
||||
if len(args.subdirs) == 1:
|
||||
args.jobs = 1
|
||||
if args.jobs == 1:
|
||||
try:
|
||||
for dir in args.subdirs:
|
||||
RunCommand(os.path.join(curdir, dir), "nmake", args.target, stdout=sys.stdout, stderr=subprocess.STDOUT)
|
||||
except RuntimeError:
|
||||
exit(1)
|
||||
else:
|
||||
controller = ThreadControl(args.jobs)
|
||||
for dir in args.subdirs:
|
||||
controller.addTask(RunCommand, os.path.join(curdir, dir), "nmake", args.target)
|
||||
controller.startSchedule()
|
||||
controller.waitComplete()
|
||||
if controller.error:
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(prog=__prog__, description=__description__ + __copyright__, conflict_handler='resolve')
|
||||
|
||||
parser.add_argument("target", help="the target for nmake")
|
||||
parser.add_argument("subdirs", nargs="+", help="the relative dir path of makefile")
|
||||
parser.add_argument("--jobs", type=int, dest="jobs", default=cpu_count, help="thread number")
|
||||
parser.add_argument('--version', action='version', version=__version__)
|
||||
args = parser.parse_args()
|
||||
Run()
|
||||
|
||||
# @file NmakeSubdirs.py
|
||||
# This script support parallel build for nmake in windows environment.
|
||||
# It supports Python2.x and Python3.x both.
|
||||
#
|
||||
# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
|
||||
#
|
||||
# Import Modules
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import argparse
|
||||
import threading
|
||||
import time
|
||||
import os
|
||||
import subprocess
|
||||
import multiprocessing
|
||||
import copy
|
||||
import sys
|
||||
__prog__ = 'NmakeSubdirs'
|
||||
__version__ = '%s Version %s' % (__prog__, '0.10 ')
|
||||
__copyright__ = 'Copyright (c) 2018, Intel Corporation. All rights reserved.'
|
||||
__description__ = 'Replace for NmakeSubdirs.bat in windows ,support parallel build for nmake.\n'
|
||||
|
||||
cpu_count = multiprocessing.cpu_count()
|
||||
output_lock = threading.Lock()
|
||||
def RunCommand(WorkDir=None, *Args, **kwargs):
|
||||
if WorkDir is None:
|
||||
WorkDir = os.curdir
|
||||
if "stderr" not in kwargs:
|
||||
kwargs["stderr"] = subprocess.STDOUT
|
||||
if "stdout" not in kwargs:
|
||||
kwargs["stdout"] = subprocess.PIPE
|
||||
p = subprocess.Popen(Args, cwd=WorkDir, stderr=kwargs["stderr"], stdout=kwargs["stdout"])
|
||||
stdout, stderr = p.communicate()
|
||||
message = ""
|
||||
if stdout is not None:
|
||||
message = stdout.decode(encoding='utf-8', errors='ignore') #for compatibility in python 2 and 3
|
||||
|
||||
if p.returncode != 0:
|
||||
raise RuntimeError("Error while execute command \'{0}\' in direcotry {1}\n{2}".format(" ".join(Args), WorkDir, message))
|
||||
|
||||
output_lock.acquire(True)
|
||||
print("execute command \"{0}\" in directory {1}".format(" ".join(Args), WorkDir))
|
||||
print(message)
|
||||
output_lock.release()
|
||||
|
||||
return p.returncode, stdout
|
||||
|
||||
class TaskUnit(object):
|
||||
def __init__(self, func, args, kwargs):
|
||||
self.func = func
|
||||
self.args = args
|
||||
self.kwargs = kwargs
|
||||
|
||||
def __eq__(self, other):
|
||||
return id(self).__eq__(id(other))
|
||||
|
||||
def run(self):
|
||||
return self.func(*self.args, **self.kwargs)
|
||||
|
||||
def __str__(self):
|
||||
para = list(self.args)
|
||||
para.extend("{0}={1}".format(k, v)for k, v in self.kwargs.items())
|
||||
|
||||
return "{0}({1})".format(self.func.__name__, ",".join(para))
|
||||
|
||||
class ThreadControl(object):
|
||||
|
||||
def __init__(self, maxthread):
|
||||
self._processNum = maxthread
|
||||
self.pending = []
|
||||
self.running = []
|
||||
self.pendingLock = threading.Lock()
|
||||
self.runningLock = threading.Lock()
|
||||
self.error = False
|
||||
self.errorLock = threading.Lock()
|
||||
self.errorMsg = "errorMsg"
|
||||
|
||||
def addTask(self, func, *args, **kwargs):
|
||||
self.pending.append(TaskUnit(func, args, kwargs))
|
||||
|
||||
def waitComplete(self):
|
||||
self._schedule.join()
|
||||
|
||||
def startSchedule(self):
|
||||
self._schedule = threading.Thread(target=self.Schedule)
|
||||
self._schedule.start()
|
||||
|
||||
def Schedule(self):
|
||||
for i in range(self._processNum):
|
||||
task = threading.Thread(target=self.startTask)
|
||||
task.daemon = False
|
||||
self.running.append(task)
|
||||
|
||||
self.runningLock.acquire(True)
|
||||
for thread in self.running:
|
||||
thread.start()
|
||||
self.runningLock.release()
|
||||
|
||||
while len(self.running) > 0:
|
||||
time.sleep(0.1)
|
||||
if self.error:
|
||||
print("subprocess not exit successfully")
|
||||
print(self.errorMsg)
|
||||
|
||||
def startTask(self):
|
||||
while True:
|
||||
if self.error:
|
||||
break
|
||||
self.pendingLock.acquire(True)
|
||||
if len(self.pending) == 0:
|
||||
self.pendingLock.release()
|
||||
break
|
||||
task = self.pending.pop(0)
|
||||
self.pendingLock.release()
|
||||
try:
|
||||
task.run()
|
||||
except RuntimeError as e:
|
||||
if self.error: break
|
||||
self.errorLock.acquire(True)
|
||||
self.error = True
|
||||
self.errorMsg = str(e)
|
||||
time.sleep(0.1)
|
||||
self.errorLock.release()
|
||||
break
|
||||
|
||||
self.runningLock.acquire(True)
|
||||
self.running.remove(threading.currentThread())
|
||||
self.runningLock.release()
|
||||
|
||||
def Run():
|
||||
curdir = os.path.abspath(os.curdir)
|
||||
if len(args.subdirs) == 1:
|
||||
args.jobs = 1
|
||||
if args.jobs == 1:
|
||||
try:
|
||||
for dir in args.subdirs:
|
||||
RunCommand(os.path.join(curdir, dir), "nmake", args.target, stdout=sys.stdout, stderr=subprocess.STDOUT)
|
||||
except RuntimeError:
|
||||
exit(1)
|
||||
else:
|
||||
controller = ThreadControl(args.jobs)
|
||||
for dir in args.subdirs:
|
||||
controller.addTask(RunCommand, os.path.join(curdir, dir), "nmake", args.target)
|
||||
controller.startSchedule()
|
||||
controller.waitComplete()
|
||||
if controller.error:
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(prog=__prog__, description=__description__ + __copyright__, conflict_handler='resolve')
|
||||
|
||||
parser.add_argument("target", help="the target for nmake")
|
||||
parser.add_argument("subdirs", nargs="+", help="the relative dir path of makefile")
|
||||
parser.add_argument("--jobs", type=int, dest="jobs", default=cpu_count, help="thread number")
|
||||
parser.add_argument('--version', action='version', version=__version__)
|
||||
args = parser.parse_args()
|
||||
Run()
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user