Skip to content

Latest commit

 

History

History
225 lines (183 loc) · 11.6 KB

BaseToolsNotes.md

File metadata and controls

225 lines (183 loc) · 11.6 KB

UDK2018 BaseTools Notes

  1. Introduction
  2. New Features and Enhancements
  3. Bug Fixes
  4. Known Issues
  5. Notes
  6. Best Known Methonds

INTRODUCTION

This is the primary set of tools for processing EDK II content. It contains configuration templates and source files. The tools support a Makefile based EDK II build with no additional packages required--the compiler tool chain, an assembler and optional ACPI assembler are the only additional tools need to build the EDK II project.

Source code is divided into two types:

  1. Tools written in C (ANSI C) are primarily for tools that modify binary data structures.
  2. Tools based on Python (Python) are primarily for tools that parse or process text files.

NEW FEATURES AND ENHANCEMENTS

  1. Add /Gw to CC_FLAGS for Visual Studio 2013(VS2013) and Later tool chain tags
  2. Enhance the report to not show the empty section
  3. Update tools_def.template to remove old XCLANG and XCODE32
  4. Register MM module types with build tools
  5. Support python scripts in PREBUILD/POSTBUILD
  6. Add python script to run a makefile
  7. Add the missing -pie link option in GCC tool chain
  8. Extend FFS alignment to 16M
  9. Report build time measured by module of EDK II Build
  10. Add support for BIOS build with binary cache
  11. PI 1.6 to support FV extended header contain FV used size
  12. Parse map file generated by Xcode on Mac
  13. Guid.xref contain information from FILE statements in FDF
  14. Add Visual Studio 2017 (VS2017) tool chain in BaseTools tools_def.template
  15. GenFfs support to get alignment value from SectionFile
  16. Update Makefile to support FFS file generation
  17. Add PcdValueCommon logic into C source CommonLib
  18. Support Structure PCD value assignment in DEC/DSC
  19. Collect DynamicHii PCD values and assign it to VPD PCD Value
  20. Support Structure PCD value inherit between the different SKUs
  21. Report Structure PCD value and SKU, DefaultStore info
  22. Support PCD flexible values format
  23. Add DevicePath support for PCD values
  24. Not print SKUID info for PCD when it is only Single SKUID
  25. Enable MAX_CONCURRENT_THREAD_NUMBER = 0 feature
  26. Structure Pcd in CommandLine
  27. StructurePcd array Value support flexible format
  28. GNUmakefile: Move HOST_ARCH detection into common makefile
  29. GNUmakefile: Remove HOST_ARCH in every tool Makefile
  30. Add *B Flag for the field that from command line
  31. Add more error message when PcdValue is wrong
  32. Improve build performance of structure PCD value generation
  33. DSC Components section support flexible PCD
  34. Update --pcd parser to support flexible pcd format
  35. Detect structure pcd header file change.
  36. Add PackageDocumentTools into Scripts folder

BUG FIXES

  1. Copy "MODULE_UNI_FILE" file into OUTPUT directory
  2. Copy "TianoCore" userextensions into As Built Inf
  3. Fix the bug that use '|' or '||' in DSC file's Pcd value
  4. Fix the bug building the same INF more than once with -m option
  5. Fix FDF file parse !include file issue
  6. Fix the bug to correctly check Pcd type that in FDF file
  7. Fix the bug to use TabSpace between section tag in DEC file
  8. Not show *B when Pcd value in build option same with DEC
  9. Fix a bug for Mixed Pcd value display in the report
  10. Fix a bug to correct SourceFileList
  11. Fix the bug 'DSC DEFAULT' in report wrongly use FDF value
  12. Fix a bug Build directory should relative to WORKSPACE
  13. Fix the bug to re-build uni file for Library
  14. Fix the bug to collect source files per build rule family
  15. Fix a bug for single module build with GenC/GenMake option
  16. Update Makefile to work at absolute path
  17. Fixed the issue of Multiple Skus are always disables
  18. Generate correct VPD PCD value to store the default setting
  19. Fixed the issue of structure pcd filed sku inherit override
  20. Update SkuId checker to make sure it be valid UINT64 value
  21. Update Python Makefile to include the new added python files
  22. Fix a bug for different FV use same FILE statement Guid
  23. Fix the bug for QuarkPlatformPkg build failure
  24. Fix compile error on Visual Studio 2010 (VS2010)
  25. Fix Pcd value override issue caused by SKU inherit
  26. Fix GenFds increment build bug that missing cover command option's change
  27. Enhance binary file in [Binaries] section use relative path
  28. Update SKUID value to support both integer and Hex number
  29. Add DefaultStore section format Check
  30. CommonLib Fix Crash to write the last byte
  31. Combine the HiiPcd value if they link to same Variable
  32. Fixed build failure for the PCD value initialization
  33. Support multiple .h file
  34. Update Expression.py for string comparison and MACRO replace issue
  35. Correct the generate compress section process
  36. Add check for INF statement must be a .inf file
  37. GenFv: Update error message to describe PE image alignment
  38. Override the MAKE_FLAGS by BuildOptions in DSC
  39. Update GenFw to correct DebugEntry Offset when convert XIP image
  40. GUID format PCD value assignment fail in Structure PCD field
  41. Align WIN_CERTIFICATE_UEFI_GUID definition to MdePkg one
  42. Fix the bug for display incorrect *M flag in report
  43. Report error if flag in LABEL() invalid
  44. Fixed Pcd value override issue
  45. Correct Structure Pcd value in the report
  46. Fix the bug to search Fv.txt file relative to workspace
  47. Fix bug when converting iSCSI node
  48. Fix byte orders when handling 8-byte array
  49. Update DNS_DEVICE_PATH/URI_DEVICE_PATH definition
  50. Fix a bug for --pcd used in ConditionalStatement calculate
  51. Fix parse OFFSET_OF get wrong offset
  52. Get Pcd DatumType from DEC file for --pcd
  53. --hash --binary-destination generate wrong binary path
  54. Fix bug for VOID* DynamicDefault Pcd use Flexible format

KNOWN ISSUES

  1. Use multiple "!if" or "!endif" statements in external file will cause build break. An example that will break the build:

In one of DSC section, use the following !include statement such as:

    [Components]
    !include externalFile.txt
    !endif
    !endif

and in externalFile.txt, the content is:

    !if True
    !if True
    TestPkg1/TestModule1/Test1.Inf
  1. If you do not specify build target information both in command line and Conf\target.txt file, build tool will exit build immediately.

  2. PCD used in FDF conditional directive statement without SET statement define this PCD in FDF file will cause build break. An example as following:

In DEC file:

    [PcdsFixedAtBuild]
      gEfiPcdname.Pcdtoken|0x0|UINT32|0x11112222

IN DSC file:

    [PcdsFixedAtBuild]
      gEfiPcdname.Pcdtoken|0x0

IN FDF file:

    [FD.NT32]
    !if gEfiPcdname.Pcdtoken == 0x00000000
      XXXXXXXXXXX
    !endif

Another Example is:

    [FD.Nt32]
      BaseAddress   = 0x0|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFdBaseAddress
      !if gEfiNt32PkgTokenSpaceGuid.PcdWinNtFdBaseAddress
        xxxxx
      !endif
  1. If building with tool chain DDK3790 and ARCH X64, and HII resource is generated by Resource Compiler (RC) tool, build will break. But BaseTools project has added this support at revision 2656. The workaround is add WINDDK_BIN32 into %PATH%.

  2. The target path name cannot exceed 256 characters for nmake, long file path feature can only support pure binary build which does not generate Makefile.

  3. For --pcd option, after python option parser there doesn't have quote characters, so there exist some bugs for case about --pcd Pcd=Value and --pcd Pcd="Value", eg:--pcd Pcd="3" for UINT8 type PCD, current tool still set this pcd's value to number 3 but not string 3.

  4. For structure pcd field value assignment about flexible format support, because tool does not know the field's data type that defined in the definition file, it will cause some build errors. eg: the field is UINT8 type, but user set value to {1}, it will cause the build to break.

  5. Structure pcd field value assignment is not supported in DSC [Components] section, INF and FDF file.

  6. BaseTools C source file can't be compiled in the Visual Studio x64 command prompt.

NOTES

  1. Macros referenced in DSC/FDF files now requires the enclosure of "$()" to avoid ambiguity.

  2. EFI_SPECIFICATION_VERSION and PI_SPECIFICATION_VERSION are no longer public macro definitions in autogen code.

  3. The feature of CLM support increases the chances of two platform builds failure under one workspace. We need to avoid the concurrent build of different platforms under one workspace.

  4. The execution order prediction feature of BRG requires the new internal python tool named EOT. It requires the installation of ANTRL v3.0.1 in Python home for Python runtime support. The tool parses all the source files involved in the platform build and it may even take hours to complete the parse and generate the report.

  5. The blank setting for CAPSULE_FLAGS in [Capsule] section of FDF file is not supported. If no CAPSULE_FLAGS is set, CAPSULE_FLAGS need not be specified in [Capsule] section.

  6. The Global Macro is not allowed in EDK II INF except some predefined cases; see details in INF spec 1.26 chapter 2.2.6.

  7. The expression after !if, !ifdef, !elseif cannot be empty.

  8. The section header in FDF cannot contain macros.

  9. The name and value definition in define section must follow DSC spec.

  10. The type of a PCD defined in a DSC file should match the possible types for this PCD in the DEC file.

  11. For MACRO usage scope, please refer to meta-data file spec for details. Following is some general information.

   INF - [Defines] section or any statements contain <PATH> or [BuildOptions] section
   DEC - [Defines] section or any statements contain <PATH>
   DSC - [Defines] section or any statements contain <PATH> or [BuildOptions] or Conditional Directive statements
   FDF - Whole File
  1. VfrCompile tool adds data type check for Oneof and Numeric opcode. The valid data type for Oneof and Numeric question are UINT8, UINT16, UINT32 and UINT64.

BEST KNOWN METHODS

  1. When the build tools are updated, the build configuration template in $(WORKSPACE)\BaseTools\Conf\*.template may also be updated, which needs to be merged with local $(WORKSPACE)\Conf\*.txt to avoid some build error.

  2. To ensure the platform is clean rebuild without any previous build impact, the cached meta data information directory i.e.$(WORKSPACE)\Conf\.cache can be removed.

  3. In case of build failure due to access error of $(WORKSPACE)\Conf\.cache\build.db, the tip can be rebuilt again without any concurrent build process under the same workspace.

  4. When the different MACRO settings are used to enable the different drivers with same module GUID and driver name in two build times, the incremental build will not work well. The clean build is required for the second build.

  5. The EOT tool depends on ANTRL 3.0.1 runtime library and newer ANTRL release (e.g. 3.1.2) is not compatible with older release. So it is required to download ANTLR 3.0.1 from www.antlr.org and install python runtime library to the local python home.

  6. The notification function related features are not integrated to BRG output plain text report file. As the invocation of EOT (from BRG) generates Report.html under workspace directory. This HTML report file shows the details of the notification functions under each module if available.

  7. The Prebuild and Postbuild entry must be a tool that can be executed.