On Mon, Oct 28, 2019 at 09:59:02 +0800, Abner Chang wrote: > BaseTools changes for building EDK2 RISC-V platform. > The changes made to build_rule.template is to avoid build errors > caused by GCC5 tool chain. > > Signed-off-by: Abner Chang <abner.ch...@hpe.com> > > Cc: Bob Feng <bob.c.f...@intel.com> > Cc: Liming Gao <liming....@intel.com> > Cc: Leif Lindholm <leif.lindh...@linaro.org> > Cc: Gilbert Chen <gilbert.c...@hpe.com> > --- > BaseTools/Source/C/Common/PeCoffLib.h | 9 + > BaseTools/Source/C/GenFw/elf_common.h | 62 +++++ > .../Source/C/Include/IndustryStandard/PeImage.h | 6 + > BaseTools/Source/C/Common/BasePeCoff.c | 15 +- > BaseTools/Source/C/Common/PeCoffLoaderEx.c | 86 +++++++ > BaseTools/Source/C/GenFv/GenFvInternalLib.c | 128 +++++++++- > BaseTools/Source/C/GenFw/Elf32Convert.c | 5 +- > BaseTools/Source/C/GenFw/Elf64Convert.c | 282 > ++++++++++++++++++++- > BaseTools/Conf/build_rule.template | 54 ++-- > BaseTools/Conf/tools_def.template | 64 ++++- > BaseTools/Source/Python/Common/DataType.py | 7 +- > BaseTools/Source/Python/Common/buildoptions.py | 6 +- > 12 files changed, 685 insertions(+), 39 deletions(-) >
> diff --git a/BaseTools/Conf/build_rule.template > b/BaseTools/Conf/build_rule.template > index db06d3a..57c3cf7 100755 > --- a/BaseTools/Conf/build_rule.template > +++ b/BaseTools/Conf/build_rule.template > @@ -1,6 +1,7 @@ > # > # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> > # Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR> > +# Portions Copyright (c) 2019, Hewlett Packard Enterprise Development LP. > All rights reserved.<BR> > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > > @@ -266,10 +267,10 @@ > <Command.GCC> > $(RM) ${dst} > "$(SLINK)" cr ${dst} $(SLINK_FLAGS) @$(OBJECT_FILES_LIST) > - > + There are a bunch of whitespace-only diffs in this file. Please get rid of them. (Or are you able to drop all of these changes after Mark's linker script fix?) / Leif > <Command.RVCT> > "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST) > - > + > <Command.RVCTCYGWIN> > # $(OBJECT_FILES_LIST) has wrong paths for cygwin > "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OBJECT_FILES) > @@ -304,8 +305,8 @@ > > <Command.XCODE> > "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) -filelist > $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS) > - > - > + > + > [Static-Library-File.SEC.AARCH64, Static-Library-File.PEI_CORE.AARCH64, > Static-Library-File.PEIM.AARCH64,Static-Library-File.SEC.ARM, > Static-Library-File.PEI_CORE.ARM, Static-Library-File.PEIM.ARM] > <InputFile> > *.lib > @@ -321,6 +322,21 @@ > "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst} > > > +[Static-Library-File.COMMON.RISCV64, Static-Library-File.COMMON.RISCV32] > + <InputFile> > + *.lib > + > + <ExtraDependency> > + $(MAKE_FILE) > + > + <OutputFile> > + $(DEBUG_DIR)(+)$(MODULE_NAME).dll > + > + <Command.GCC> > + "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) > @$(STATIC_LIBRARY_FILES_LIST) --end-group $(DLINK2_FLAGS) > + "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst} > + > + > [Static-Library-File.USER_DEFINED, Static-Library-File.HOST_APPLICATION] > <InputFile> > *.lib > @@ -346,8 +362,8 @@ > > <Command.XCODE> > "$(DLINK)" -o ${dst} $(DLINK_FLAGS) $(DLINK_SPATH) -filelist > $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS) > - > - > + > + > [Dynamic-Library-File] > <InputFile> > ?.dll > @@ -360,7 +376,7 @@ > $(CP) ${dst} $(DEBUG_DIR) > $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi > -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) > - -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) > + -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) > <Command.GCC> > $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug > $(OBJCOPY) --strip-unneeded -R .eh_frame ${src} > @@ -375,7 +391,7 @@ > $(CP) ${dst} $(DEBUG_DIR) > $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi > -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) > - > + > <Command.XCODE> > # tool to convert Mach-O to PE/COFF > "$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) ${src} > $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff > @@ -414,13 +430,13 @@ > <Command.MSFT, Command.INTEL> > Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i > $(INC_LIST) ${src} > "$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii > - Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii > + Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii > "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii > > <Command.GCC> > Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i > $(INC_LIST) ${src} > "$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii > - Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii > + Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii > "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii > > [C-Code-File.AcpiTable] > @@ -462,14 +478,14 @@ > "$(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 > "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll > $(GENFW_FLAGS) > - > - <Command.XCODE> > + > + <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 > "$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.pecoff > "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.pecoff > $(GENFW_FLAGS) > - > - > + > + > [Masm16-Code-File] > <InputFile> > ?.asm16, ?.Asm16, ?.ASM16, ?.s16, ?.S16 > @@ -492,14 +508,14 @@ > Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i > "$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) > $(INC) ${d_path}(+)${s_base}.iii > "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) > $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj --end-group > - > + > <Command.XCODE> > "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i > Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i > "$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) > $(INC) ${d_path}(+)${s_base}.iii > "$(SLINK)" $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj > otool -t $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib | hex2bin.py ${dst} > - > + > > [Nasm-to-Binary-Code-File] > <InputFile> > @@ -635,8 +651,8 @@ > <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) > - > - > + > + > diff --git a/BaseTools/Source/Python/Common/DataType.py > b/BaseTools/Source/Python/Common/DataType.py > index 8ae1bd2..0bc5d47 100644 > --- a/BaseTools/Source/Python/Common/DataType.py > +++ b/BaseTools/Source/Python/Common/DataType.py > @@ -3,6 +3,7 @@ > # > # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> > # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> > +# Portions Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development > LP. All rights reserved.<BR> > # SPDX-License-Identifier: BSD-2-Clause-Patent > > ## > @@ -52,7 +53,9 @@ TAB_ARCH_ARM = 'ARM' > TAB_ARCH_EBC = 'EBC' > TAB_ARCH_AARCH64 = 'AARCH64' > > -ARCH_SET_FULL = {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_ARM, TAB_ARCH_EBC, > TAB_ARCH_AARCH64, TAB_ARCH_COMMON} > +TAB_ARCH_RISCV64 = 'RISCV64' > + > +ARCH_SET_FULL = {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_ARM, TAB_ARCH_EBC, > TAB_ARCH_AARCH64, TAB_ARCH_RISCV64, TAB_ARCH_COMMON} > > SUP_MODULE_BASE = 'BASE' > SUP_MODULE_SEC = 'SEC' > @@ -532,4 +535,4 @@ PACK_CODE_BY_SIZE = {8:'=Q', > 0:'=B', > 16:""} > > -TAB_COMPILER_MSFT = 'MSFT' > \ No newline at end of file > +TAB_COMPILER_MSFT = 'MSFT' > \ No newline at end of file The above hunk shouldn't be there. / Leif -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51099): https://edk2.groups.io/g/devel/message/51099 Mute This Topic: https://groups.io/mt/38757535/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-