From 8e0b5e07b7aeef093fe2628aaf5a1fa2dbcf241d Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Mon, 5 Dec 2011 14:29:16 +0000 Subject: [PATCH] ArmPlatformPkg: Update pending patches with the latest BaseTools SyncUp - ARMLINUXGCC toolchain is now supported - ARMGCC: Set '0x0' for the linkage base address - Fixed Trim utility - Fixed support for !include in DSC files git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12819 6f19259b-4bc3-4df7-8a09-765794883524 --- .../patches/BaseTools-Pending-Patches.patch | 271 ------------------ 1 file changed, 271 deletions(-) diff --git a/ArmPlatformPkg/Documentation/patches/BaseTools-Pending-Patches.patch b/ArmPlatformPkg/Documentation/patches/BaseTools-Pending-Patches.patch index 2265ee1b2b..d82f564c01 100755 --- a/ArmPlatformPkg/Documentation/patches/BaseTools-Pending-Patches.patch +++ b/ArmPlatformPkg/Documentation/patches/BaseTools-Pending-Patches.patch @@ -1,274 +1,3 @@ -Index: BaseTools/Conf/build_rule.template -=================================================================== ---- BaseTools/Conf/build_rule.template (revision 12691) -+++ BaseTools/Conf/build_rule.template (working copy) -@@ -129,7 +129,7 @@ - "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} - "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst} - -- -+ - "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} - - -@@ -217,7 +217,7 @@ - - "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST) - -- -+ - # $(OBJECT_FILES_LIST) has wrong paths for cygwin - "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OBJECT_FILES) - -@@ -241,7 +241,7 @@ - "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS) - "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst} - -- -+ - "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS) - - -@@ -271,7 +271,7 @@ - - "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS) - -- -+ - "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS) - - -@@ -292,7 +292,7 @@ - - $(DEBUG_DIR)(+)$(MODULE_NAME).efi - -- -+ - "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS) - $(CP) ${dst} $(OUTPUT_DIR) - $(CP) ${dst} $(BIN_DIR) -@@ -536,7 +536,7 @@ - "$(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} - -- -+ - GenFw -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) - - -Index: BaseTools/Conf/tools_def.template -=================================================================== ---- BaseTools/Conf/tools_def.template (revision 12691) -+++ BaseTools/Conf/tools_def.template (working copy) -@@ -467,6 +467,7 @@ - # MSFT - Microsoft - # GCC - GNU GCC - # INTEL - INTEL -+# RVCT - ARM RealView Toolchain - #################################################################################### - #################################################################################### - # -@@ -4173,11 +4174,69 @@ - *_ARMGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h - - *_ARMGCC_ARM_SLINK_FLAGS = -rc --*_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -+*_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map - - DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -O0 - RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -Wno-unused - -+#################################################################################### -+# -+# ARM GNU/Linux GCC -+# -+#################################################################################### -+# ARMLINUXGCC - ARM version of the GCC cross compiler -+ -+*_ARMLINUXGCC_*_*_FAMILY = GCC -+*_ARMLINUXGCC_*_*_BUILDRULEFAMILY = ARMLINUXGCC -+ -+*_ARMLINUXGCC_*_MAKE_PATH = make -+*_ARMLINUXGCC_*_MAKE_FLAGS = --no-print-directory -+ -+################## -+# ASL definitions -+################## -+*_ARMLINUXGCC_*_ASL_PATH = DEF(UNIX_IASL_BIN) -+*_ARMLINUXGCC_*_ASL_FLAGS = DEF(IASL_FLAGS) -+*_ARMLINUXGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS) -+*_ARMLINUXGCC_*_ASLPP_FLAGS = -x c -E -P -+*_ARMLINUXGCC_*_ASLCC_FLAGS = -x c -+*_ARMLINUXGCC_*_ASLDLINK_FLAGS = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable -+ -+################## -+# ARM definitions -+################## -+ -+*_ARMLINUXGCC_ARM_ASLCC_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc -+*_ARMLINUXGCC_ARM_ASLDLINK_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-ld -+*_ARMLINUXGCC_ARM_ASLPP_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc -+ -+*_ARMLINUXGCC_ARM_CC_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc -+*_ARMLINUXGCC_ARM_SLINK_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-ar -+*_ARMLINUXGCC_ARM_DLINK_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-ld -+*_ARMLINUXGCC_ARM_ASM_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-as -+*_ARMLINUXGCC_ARM_PP_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc -+*_ARMLINUXGCC_ARM_VFRPP_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc -+ -+# -+# Use default values, or override in DSC file -+# -+*_ARMLINUXGCC_ARM_ARCHCC_FLAGS = -mthumb -+*_ARMLINUXGCC_ARM_ARCHASM_FLAGS = -+*_ARMLINUXGCC_ARM_ARCHDLINK_FLAGS = -+*_ARMLINUXGCC_ARM_PLATFORM_FLAGS = -march=armv7-a -+ -+ DEBUG_ARMLINUXGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g -+RELEASE_ARMLINUXGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -+ -+*_ARMLINUXGCC_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h -+*_ARMLINUXGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h -+ -+*_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc -+*_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -+ -+ DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -O0 -+RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable -+ - ################# - # ASM 16 linker defintions - ################# -Index: BaseTools/Source/Python/Workspace/MetaFileParser.py -=================================================================== ---- BaseTools/Source/Python/Workspace/MetaFileParser.py (revision 12691) -+++ BaseTools/Source/Python/Workspace/MetaFileParser.py (working copy) -@@ -1280,6 +1280,9 @@ - Records = IncludedFileTable.GetAll() - if Records: - self._Content[self._ContentIndex:self._ContentIndex] = Records -+ self._Content.pop(self._ContentIndex-1) -+ self._ValueList = None -+ self._ContentIndex -= 1 - - def __ProcessSkuId(self): - self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True) -Index: BaseTools/Source/Python/Workspace/WorkspaceDatabase.py -=================================================================== ---- BaseTools/Source/Python/Workspace/WorkspaceDatabase.py (revision 12691) -+++ BaseTools/Source/Python/Workspace/WorkspaceDatabase.py (working copy) -@@ -2319,7 +2319,7 @@ - # @param GlobalMacros Global macros used for replacement during file parsing - # @prarm RenewDb=False Create new database file if it's already there - # -- def __init__(self, DbPath, RenewDb=False): -+ def __init__(self, DbPath, RenewDb=False, DbSignature={}): - self._DbClosedFlag = False - if not DbPath: - DbPath = os.path.normpath(os.path.join(GlobalData.gWorkspace, self._DB_PATH_)) -@@ -2331,7 +2331,7 @@ - os.makedirs(DbDir) - - # remove db file in case inconsistency between db and file in file system -- if self._CheckWhetherDbNeedRenew(RenewDb, DbPath): -+ if self._CheckWhetherDbNeedRenew(RenewDb, DbPath, DbSignature): - os.remove(DbPath) - - # create db with optimized parameters -@@ -2367,7 +2367,38 @@ - # - # @return Bool value for whether need renew workspace databse - # -- def _CheckWhetherDbNeedRenew (self, force, DbPath): -+ def _CheckWhetherDbNeedRenew (self, force, DbPath, DbSignature): -+ DbDir = os.path.split(DbPath)[0] -+ MacroFilePath = os.path.normpath(os.path.join(DbDir, "build.mac")) -+ MacroMatch = False -+ if os.path.exists(MacroFilePath) and os.path.isfile(MacroFilePath): -+ LastMacros = None -+ try: -+ f = open(MacroFilePath,'r') -+ LastMacros = pickle.load(f) -+ f.close() -+ except IOError: -+ pass -+ except: -+ f.close() -+ -+ if LastMacros != None and type(LastMacros) is DictType: -+ if LastMacros == DbSignature: -+ MacroMatch = True -+ -+ if not MacroMatch: -+ # save command line macros to file -+ try: -+ f = open(MacroFilePath,'w') -+ pickle.dump(DbSignature, f, 2) -+ f.close() -+ except IOError: -+ pass -+ except: -+ f.close() -+ -+ force = True -+ - # if database does not exist, we need do nothing - if not os.path.exists(DbPath): return False - -Index: BaseTools/Source/Python/build/build.py -=================================================================== ---- BaseTools/Source/Python/build/build.py (revision 12691) -+++ BaseTools/Source/Python/build/build.py (working copy) -@@ -704,6 +704,8 @@ - # - def __init__(self, Target, WorkspaceDir, BuildOptions): - self.WorkspaceDir = WorkspaceDir -+ DbSignature = {'Target': Target, 'BuildOptions': BuildOptions } -+ - self.Target = Target - self.PlatformFile = BuildOptions.PlatformFile - self.ModuleFile = BuildOptions.ModuleFile -@@ -726,7 +728,7 @@ - if BuildOptions.DisableCache: - self.Db = WorkspaceDatabase(":memory:") - else: -- self.Db = WorkspaceDatabase(None, self.Reparse) -+ self.Db = WorkspaceDatabase(None, self.Reparse, DbSignature) - self.BuildDatabase = self.Db.BuildObject - self.Platform = None - self.LoadFixAddress = 0 -Index: BaseTools/Source/Python/Trim/Trim.py -=================================================================== ---- BaseTools/Source/Python/Trim/Trim.py (revision 12691) -+++ BaseTools/Source/Python/Trim/Trim.py (working copy) -@@ -37,7 +37,9 @@ - ## Regular expression for matching "#pragma pack" - gPragmaPattern = re.compile("^\s*#pragma\s+pack", re.MULTILINE) - ## Regular expression for matching HEX number --gHexNumberPattern = re.compile("0[xX]([0-9a-fA-F]+)") -+gHexNumberPattern = re.compile("(0[xX])([0-9a-fA-F]+)U?") -+## Regular expression for matching decimal number -+gDecNumberPattern = re.compile("([0-9]+)U?") - ## Regular expression for matching "Include ()" in asl file - gAslIncludePattern = re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.MULTILINE) - ## Regular expression for matching C style #include "XXX.asl" in asl file -@@ -169,10 +171,15 @@ - - # convert HEX number format if indicated - if ConvertHex: -- Line = gHexNumberPattern.sub(r"0\1h", Line) -+ Line = gHexNumberPattern.sub(r"0\2h", Line) -+ else: -+ Line = gHexNumberPattern.sub(r"\1\2", Line) - if TrimLong: - Line = gLongNumberPattern.sub(r"\1", Line) - -+ # convert Decimal number format -+ Line = gDecNumberPattern.sub(r"\1", Line) -+ - if LineNumber != None: - EdkLogger.verbose("Got line directive: line=%d" % LineNumber) - # in case preprocessor removed some lines, like blank or comment lines Index: BaseTools/Source/C/GenFv/GenFv.c =================================================================== --- BaseTools/Source/C/GenFv/GenFv.c (revision 12691)