UDK2018 BaseTools Notes
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:
- Tools written in C (ANSI C) are primarily for tools that modify binary data structures.
- Tools based on Python (Python) are primarily for tools that parse or process text files.
- Add
/Gw
toCC_FLAGS
for Visual Studio 2013(VS2013) and Later tool chain tags - Enhance the report to not show the empty section
- Update tools_def.template to remove old XCLANG and XCODE32
- Register
MM
module types with build tools - Support python scripts in
PREBUILD/POSTBUILD
- Add python script to run a makefile
- Add the missing
-pie
link option in GCC tool chain - Extend FFS alignment to 16M
- Report build time measured by module of EDK II Build
- Add support for BIOS build with binary cache
- PI 1.6 to support FV extended header contain FV used size
- Parse map file generated by Xcode on Mac
Guid.xref
contain information from FILE statements in FDF- Add Visual Studio 2017 (VS2017) tool chain in BaseTools tools_def.template
GenFfs
support to get alignment value from SectionFile- Update Makefile to support FFS file generation
- Add
PcdValueCommon
logic into C sourceCommonLib
- Support Structure PCD value assignment in DEC/DSC
- Collect
DynamicHii
PCD values and assign it to VPD PCD Value - Support Structure PCD value inherit between the different SKUs
- Report Structure PCD value and SKU,
DefaultStore
info - Support PCD flexible values format
- Add DevicePath support for PCD values
- Not print SKUID info for PCD when it is only Single SKUID
- Enable
MAX_CONCURRENT_THREAD_NUMBER = 0
feature - Structure Pcd in CommandLine
- StructurePcd array Value support flexible format
GNUmakefile:
MoveHOST_ARCH
detection into common makefileGNUmakefile:
RemoveHOST_ARCH
in every tool Makefile- Add
*B
Flag for the field that from command line - Add more error message when
PcdValue
is wrong - Improve build performance of structure PCD value generation
- DSC Components section support flexible PCD
- Update
--pcd
parser to support flexible pcd format - Detect structure pcd header file change.
- Add
PackageDocumentTools
into Scripts folder
- Copy "MODULE_UNI_FILE" file into OUTPUT directory
- Copy "TianoCore" userextensions into As Built Inf
- Fix the bug that use
'|'
or'||'
in DSC file's Pcd value - Fix the bug building the same INF more than once with
-m
option - Fix FDF file parse
!include
file issue - Fix the bug to correctly check Pcd type that in FDF file
- Fix the bug to use TabSpace between section tag in DEC file
- Not show
*B
when Pcd value in build option same with DEC - Fix a bug for Mixed Pcd value display in the report
- Fix a bug to correct
SourceFileList
- Fix the bug
'DSC DEFAULT'
in report wrongly use FDF value - Fix a bug Build directory should relative to WORKSPACE
- Fix the bug to re-build uni file for Library
- Fix the bug to collect source files per build rule family
- Fix a bug for single module build with
GenC/GenMake
option - Update Makefile to work at absolute path
- Fixed the issue of Multiple Skus are always disables
- Generate correct VPD PCD value to store the default setting
- Fixed the issue of structure pcd filed sku inherit override
- Update SkuId checker to make sure it be valid UINT64 value
- Update Python Makefile to include the new added python files
- Fix a bug for different FV use same FILE statement Guid
- Fix the bug for
QuarkPlatformPkg
build failure - Fix compile error on Visual Studio 2010 (VS2010)
- Fix Pcd value override issue caused by SKU inherit
- Fix
GenFds
increment build bug that missing cover command option's change - Enhance binary file in
[Binaries]
section use relative path - Update SKUID value to support both integer and Hex number
- Add
DefaultStore
section format Check CommonLib
Fix Crash to write the last byte- Combine the
HiiPcd
value if they link to same Variable - Fixed build failure for the PCD value initialization
- Support multiple .h file
- Update
Expression.py
for string comparison and MACRO replace issue - Correct the generate compress section process
- Add check for INF statement must be a .inf file
GenFv
: Update error message to describe PE image alignment- Override the MAKE_FLAGS by
BuildOptions
in DSC - Update
GenFw
to correctDebugEntry
Offset when convert XIP image - GUID format PCD value assignment fail in Structure PCD field
- Align
WIN_CERTIFICATE_UEFI_GUID
definition toMdePkg
one - Fix the bug for display incorrect
*M
flag in report - Report error if flag in
LABEL()
invalid - Fixed Pcd value override issue
- Correct Structure Pcd value in the report
- Fix the bug to search Fv.txt file relative to workspace
- Fix bug when converting iSCSI node
- Fix byte orders when handling 8-byte array
- Update
DNS_DEVICE_PATH/URI_DEVICE_PATH
definition - Fix a bug for
--pcd
used inConditionalStatement
calculate - Fix parse
OFFSET_OF
get wrong offset - Get Pcd
DatumType
from DEC file for--pcd
--hash --binary-destination
generate wrong binary path- Fix bug for
VOID*
DynamicDefault
Pcd use Flexible format
- 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
-
If you do not specify build target information both in command line and Conf\target.txt file, build tool will exit build immediately.
-
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
-
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%
. -
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.
-
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. -
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. -
Structure pcd field value assignment is not supported in DSC
[Components]
section, INF and FDF file. -
BaseTools C source file can't be compiled in the Visual Studio x64 command prompt.
-
Macros referenced in DSC/FDF files now requires the enclosure of
"$()"
to avoid ambiguity. -
EFI_SPECIFICATION_VERSION
andPI_SPECIFICATION_VERSION
are no longer public macro definitions in autogen code. -
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.
-
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.
-
The blank setting for CAPSULE_FLAGS in
[Capsule]
section of FDF file is not supported. If noCAPSULE_FLAGS
is set,CAPSULE_FLAGS
need not be specified in[Capsule]
section. -
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.
-
The expression after
!if
,!ifdef
,!elseif
cannot be empty. -
The section header in FDF cannot contain macros.
-
The name and value definition in define section must follow DSC spec.
-
The type of a PCD defined in a DSC file should match the possible types for this PCD in the DEC file.
-
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
- VfrCompile tool adds data type check for Oneof and Numeric opcode. The valid data type for Oneof and Numeric question are
UINT8
,UINT16
,UINT32
andUINT64
.
-
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. -
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. -
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. -
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.
-
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.
-
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.
-
The Prebuild and Postbuild entry must be a tool that can be executed.