Commit Graph

1080 Commits

Author SHA1 Message Date
Yonghong Zhu 5aec6991e7 BaseTools: Update BaseTools to pass VS2015 compiler
Fix some errors to pass VS2015 compiler.
1. warning C4456: declaration of xxx hides previous local declaration
2. warning C4005: 'UINT8_MAX': macro redefinition

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19768 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-29 04:54:37 +00:00
Yonghong Zhu e459de7800 BaseTools:Incremental build not work if VPD values in DSC changed by -D
If a -D flag is passed into build that selects different lines in
[PcdsDynamicExVpd], then build does not see any changes to the timestamp
of the DSC file and the VPD tool is not used to regenerate the VPD
region based in the statements that are active. so we changed the detect
condition and use SaveFileOnChange function to generate VPD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19767 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-29 04:48:55 +00:00
Yonghong Zhu d66670f9ea BaseTools: Fix the bug for VOID* Patchable PCD declaration in Library
VOID* Patchable PCD in Library has the different declaration from the
one in Driver, this issue that will cause GCC LTO build failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19766 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-29 04:46:47 +00:00
Yonghong Zhu ca85291f1f BaseTools: Fix a bug for VpdOffset calculate
The VpdOffset value in the DSC both support integer and Hex value, so we
fix the bug to support both format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19765 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-29 04:44:54 +00:00
Yonghong Zhu cb04330eee BaseTools: Fix the bug when no FD section in the FDF file
Check if the Fdf.CurrentFdName is not None and in Fdf.Profile.FdDict
before using it which fix a crash issue when no FD section in FDF file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19747 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-26 08:45:34 +00:00
Eugene Cohen a243297253 BaseTools: make build report tolerant of FVs specified by name
Check if the FV name is in the FV dictionary before using it which fixes 
a crash during build report generation when FVs are specified by path in 
the FDF.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19705 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 09:10:55 +00:00
Charles Duffy 8d0776f3e6 BaseTools: Improve LzmaF86Compress wrapper
- Remove test usage declared obsolescent by POSIX
- Pass argv array through as literal rather than forming into a string, then
  string-splitting and glob-expanding same.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Charles Duffy <chaduffy@cisco.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19697 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-20 05:15:55 +00:00
Charles Duffy 87157f76f0 BaseTools: Use python2 if available in Tests/GNUmakefile
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Charles Duffy <chaduffy@cisco.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19696 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-20 05:14:10 +00:00
Charles Duffy 5e40764835 BaseTools: Improve shell wrapper for C build commands
- Avoid obsolescent forms of test builtin (`-a` and `-o`; see APPLICATION USAGE
  section of http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html).
- Quote all expansions to prevent string-splitting and globbing.
- Avoid unspecified "exit -1" (only single-byte integers are valid); instead,
  use identical exit status to shell command-not-found.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Charles Duffy <chaduffy@cisco.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19695 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-20 05:12:02 +00:00
Charles Duffy 6928c1d3ee BaseTools: Improve shell wrappers for Python build commands
- Use `python2` executable if it exists, to avoid breakage on systems (such as
  Arch Linux) where `python` is Python 3.
- Quote all references to `$0`, for safety when located in a directory
  containing spaces in its name.
- Use the `exec` shell command to avoid leaving the shell wrapper in the
  process table when invoking the actual build tool.
- Use `"$@"` rather than `$*` to pass arguments through directly rather than
  concatenating to a string, and then string-splitting and glob-expanding its
  contents.
- Use `$BASH_SOURCE` in preference to `$0` (which is only guaranteed to be
  process name, *not* source path).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Charles Duffy <chaduffy@cisco.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19694 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-20 05:09:06 +00:00
Yonghong Zhu 4cb7bade0a BaseTools: process the files by the priority in BUILDRULEORDER
By the BUILDRULEORDER feature to process files listed in INF [Sources]
sections in priority order, if a filename is listed with multiple
extensions, the tools will use only the file that matches the first
extension in the space separated list.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19686 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 12:58:52 +00:00
Yonghong Zhu 22061fab23 BaseTools: VPD Tool to allocate VPD region be aligned based on value type
Base on build spec update, ASCII strings(“string”), will be byte aligned,
Unicode strings(L”string”) will be two-byte aligned, Byte arrays,
{0x00, 0x01} will be 8-byte aligned.
This patch is going to update VPD Tool to allocate VOID* PCDs to an offset
value that is aligned based in syntax of the PCD value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19651 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-18 01:47:50 +00:00
Yonghong Zhu 5a13737abf BaseTools: VOID* PCDs in VPD region must be aligned based on value type
Base on build spec update, ASCII strings(“string”), will be byte aligned,
Unicode strings(L”string”) will be two-byte aligned, Byte arrays,
{0x00, 0x01} will be 8-byte aligned.
This patch is going to halt with an error message if a VOID* PCD has an
offset value that is not aligned based on the syntax of the PCD value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19650 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-18 01:46:25 +00:00
Yonghong Zhu 8b54f22f60 BaseTools: Fix GenPatchPcdTable to support '-' characters in file names
The Regular Expression parsing of lines in MAP files does not currently
support the use of '-' in the column for the filename the symbol is
sources from, it cause a build break from the GenPatchPcdTable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19649 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-18 01:42:20 +00:00
Ard Biesheuvel d764d59849 BaseTools AARCH64: build XIP modules with strict alignment
GCC for AARCH64 recognizes byte swapping load and store sequences
and may replace them with wider loads or stores combined with rev
instructions. In some cases (i.e., with GCC version 5 and later)
this may result in unaligned accesses, which are not allowed before
we turn the MMU on.

So build any modules or static libraries that may execute with the MMU
off with -mstrict-align. Other modules don't need this switch, so we
can remove it from the CLANG35/AARCH64 common CC flags.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19638 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-11 08:50:49 +00:00
Ard Biesheuvel 3a02a87f9f BaseTools AARCH64: add separate GCC build rule for XIP objects
This introduces a special .c to .obj build rule for GCC/AARCH64 that
takes into account additional compiler flags that have been specified
via *_*_*_CC_XIPFLAGS. These will be passed after (and in addition to)
the ordinary CC_FLAGS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19637 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-11 08:50:39 +00:00
Michael Thomas 819a2394f1 BaseTools/VfrCompile: honor CC if it is set
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Thomas <malinka@entropy-development.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19636 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-11 07:42:03 +00:00
Hao Wu 64957e357b BaseTools: Fix 'caculate' typos
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19604 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 01:13:35 +00:00
Ard Biesheuvel c2a892d7c8 BaseTools CLANG35: use -target in PP flags as well
The Clang preprocessor may rely on builtin defines that are target
dependent, so we should add the -target argument also when invoking
the preprocessor directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19584 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-04 09:31:42 +00:00
Ard Biesheuvel d4dcd5542a BaseTools CLANG35: use linux-gnu target triplets explicitly
Since we are combining Clang with the GNU linker, make that explicit in
the target triplet. This affects certain builtin defines and other compiler
behavior that may be unspecified otherwise.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19583 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-04 09:31:33 +00:00
Hess Chen bc003bc076 BaseTool/UPT: Fix a typo issue
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19576 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-30 02:22:30 +00:00
Hess Chen 975889279d BaseTool/ECC: Add UTF-8 support on ECC tool
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19575 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-30 02:22:02 +00:00
Larry Hauch 1794756453 BaseTools: Fix Makefile to correctly break during a build failure
Updated the Makefile so that nmake will correctly fail if the cxfreeze command fails to complete successfully.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Larry Hauch <larry.hauch@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19501 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 18:30:20 +00:00
Liming Gao 4e06673dbc BaseTools: Update Scripts to support VS2015 env
edk2 Edk2Setup.bat depends on those scripts to configure VS env.
Update them to support VS2015.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19431 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22 01:01:54 +00:00
Yonghong Zhu 534ef50ca1 BaseTools: Fix one bug in FD region for multiple workspace support
Update the os.path.join to mws.join for FILE/INF/CAPSULE/FV region type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19319 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17 09:38:43 +00:00
Ard Biesheuvel b9f7890c47 BaseTools ARM: add CLANG35 support
This extends the existing CLANG35 toolchain definition with support for
building for the ARM architecture. In order to be able to reuse the existing
ARM GCC definitions as much as possible, the following changes have been
made to the existing ARM GCC support:
- the -mapcs option has been removed; it is a no-op under Thumb (our default)
  and we use AAPCS (-mabi=aapcs) anyway
- the -mword-relocations option has been moved from GCC_ARM_CC_FLAGS to
  the GCC4x specific option: CLANG does not support it, and uses '-mllvm
  -marm-use-movt=0' instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19284 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15 15:02:24 +00:00
Jordan Justen 3f45c1375d BaseTools/Scripts: Add ConvertUni.py script
This script uses python codecs to convert .uni string files between
the utf-16 and utf-8 formats.

The advantages of utf-8 data:
 * Generally smaller files
 * More commonly supported by editors
 * Not treated as binary data in patch files

The script was tested on MdePkg with both python 2.7 and python 3.4.
It was able to convert all MdePkg .uni files between utf-8 and utf-16
multiple times always producing the same files for each format.

v2:
 * Rename ConvertUtf16ToUtf8.py to ConvertUni.py
 * Also support utf-8 to utf-16 conversion (with --utf-16)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19247 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15 04:50:50 +00:00
Hess Chen 044f60172b BaseTools/Ecc: Fix a bug to report fake issue
Fix a bug to ignore the lib ins defined in [components] section but also listed in SkipDir

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19238 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-14 08:08:21 +00:00
Ard Biesheuvel 088dc24508 BaseTools/GenFw RVCT: fix relocation processing of PT_DYNAMIC sections
Unlike GNU ld, which can be instructed to emit symbol based static
relocations into fully linked binaries using the --emit-relocs command
line switch, the RVCT armlink tool can only emit dynamic relocations
into the PT_DYNAMIC segment.

This has two consequences
. we can only identify absolute relocations, so there is no way to fix
  up relative relocations between sections, or check their validity in
  the PE/COFF layout
. the r_offset fields of the PT_DYNAMIC DT_REL entries are relative
  either to the base of the image or to any of its segments but *not* to
  the base of the input section that contains the location they refer
  to, and converting them to PE/COFF image offsets is non-trivial unless
  the sections are laid out in the same way in the ELF and PE/COFF
  versions of the binary.

There is really only one way to deal with this, and that is to require
that the ELF and PE/COFF versions of the binary are identical in memory.
So enforce that in the code.

Also, fix the utterly broken relocation fixup code that dereferences
ELF32_R_SYM(r_info) both as a 1-based program header index and a 0-based
section header index. If this code ever produced working binaries, it
was purely by chance.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19236 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-14 07:56:02 +00:00
Ard Biesheuvel b12ef6b964 BaseTools RVCT: use scatter file to enforce minimum section alignment
Up until SVN r18540, GenFw created invalid PE/COFF binaries for the ARM
architecture, by allowing PE/COFF .data sections to appear at offsets
that were not aligned to the global PE/COFF section alignment. The
reason for this was that the relocation metadata emitted by RVCT's
armlink only contains dynamic absolute relocations, so it is impossible
to recalculate relative relocations between .text and .data, and so the
relative offset between the two needs to be preserved.

Since r18540, we do align .data to the PE/COFF section alignment,
resulting in potentially corrupt PE/COFF binaries unless .data happens
to appear at a 32-byte aligned offset. So let's introduce a RVCT scatter
file that sets this alignment for the ELF .data section (and subsequent
.bss section).

At the same time, set the start offset to 0x220 bytes (which is the size
of our 32-bit PE/COFF header) so that the memory layouts are identical
between ELF and PE/COFF. Also add a 4 KB aligned version that can be
used to build DXE_RUNTIME_DRIVER modules with runtime memory protection
enabled.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19235 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-14 07:55:46 +00:00
Ard Biesheuvel 214a3b7941 BaseTools GCC: avoid the use of COMMON symbols
The default behavior of the GCC compiler is to emit uninitialized globals
with external linkage into a COMMON section, where duplicate definitions
are merged. This may result in unexpected behavior, since global variables
defined under the same name in different C files may not refer to the same
logical data item.

For instance, the definitions of EFI_EVENT mVirtualAddressChangeEvent that
[used to] appear in the following files:

  CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c

will be folded into a single instance of the variable when the latter
module includes the former library, which can lead to unexpected results.

Even if some may argue that there are legal uses for COMMON allocation, the
high modularity of EDK2 combined with the low level of awareness of the
intracicies surrounding common allocation and the generally poor EDK2
developer discipline regarding the use of the STATIC keyword* make a strong
case for disabling it by default, and re-enabling it explicitly for packages
that depend on it.

So prevent GCC from emitting variables into the COMMON section, by passing
-fno-common to the compiler, and discarding the section in the GNU ld linker
script.

* Any function or variable that is only referenced from the translation unit
  that defines it could be made STATIC. This does not only prevent issues
  like the above, it also allows the compiler to generate better code, e.g.,
  drop out of line function definitions after inlining all invocations or
  perform constant propagation on variables.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19164 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 07:40:12 +00:00
Yonghong Zhu 5c1edc5534 Revert the change in r19143 for BUILDRULEORDER.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19150 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 03:06:41 +00:00
Yonghong Zhu 7f3f3133ce BaseTools: update man page to add some descriptions
add the description for --ignore-sources and --check-usage into man page.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19144 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:10:33 +00:00
Yonghong Zhu 48aed71c65 BaseTools: process the files by the priority in BUILDRULEORDER
By the BUILDRULEORDER feature to process files listed in INF [Sources]
sections in priority order, if a filename is listed with multiple
extensions, the tools will use only the file that matches the first
extension in the space separated list.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19143 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:09:31 +00:00
Yonghong Zhu 4aa9826def BaseTools: Fix a bug when apply patches to SEC use the FILE_GUID override
Fix a bug when applying patches to SEC modules that use the FILE_GUID
override. Since a temp dir is used when FILE_GUID override is used, the
INF file path comparisons fail. The fix is to capture the real INF file
path comparisons instead of using the temp dir path to the INF.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19142 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:08:05 +00:00
Yonghong Zhu 2ff9e57574 BaseTools: Enhance GenFv Tool to report error message
When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19141 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:04:39 +00:00
Yonghong Zhu 043928da6a BaseTools: Fix a bug in the VPD report generation
Changed the if condition to check whether current Region is FD VPD region
to fix a bug in the VPD report generation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19139 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:03:35 +00:00
Yonghong Zhu ca9d6d7962 Revert the change in r19137.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19138 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:01:44 +00:00
Yonghong Zhu eadb60d96f BaseTools: Enhance GenFv Tool to report error message
When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19137 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 08:29:10 +00:00
Yonghong Zhu b21a13fbb6 BaseTools: Add support for INF statement in FD region
FD region today can be file or data, but not a patched image.Add support
for an INF statement in an FD region, so the binary from the INF can be
patched prior to being added to the FD region.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19136 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 08:27:53 +00:00
Jordan Justen 103733f8e6 BaseTools PatchCheck.py: Support binary diff
This allows a patch with binary data that is generated with --binary
to be parsed by the PatchCheck.py script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19104 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-03 08:18:00 +00:00
Wang Yu 5d9cd24ede BaseTools: Add VS2015 tool chain in tools_def.template
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Yu <yu.wang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19101 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-03 03:19:01 +00:00
Eugene Cohen 8e18fbd70d BaseTools RVCT: add preprocessor preinclude for AutoGen.h
Ensure that AutoGen.h is force-included when the RVCT preprocessor
is invoked.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19097 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 16:11:33 +00:00
Yonghong Zhu 47fea6afd7 BaseTools: Clean some coding style issues
This patch clean some coding style issues, majorly for space character.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19080 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-01 04:22:16 +00:00
Yonghong Zhu 35ba063da8 BaseTools/toolsetup.bat: fixed the error when the path contains space
We have a new simple and effective method to resolve the original issue
that the PATH env's update error when the path contains space, so this
patch remove the last check in and use the new method to fix the original
issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19028 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 03:43:25 +00:00
Yonghong Zhu 38b986e3d0 BaseTools: Add build error detection for Dynamic PCD name conflict
when multiple Dynamic PCD have different token space guid but same PCD
name, it is difficult for user to check why the generated autogen.c and
autogen.h are not consistent. so we add a check before generating
autogen.c and report error directly that user can know what happened
immediately.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19027 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 03:40:37 +00:00
Yonghong Zhu fb3d22793e BaseTools: Add a VPD report subsection of FLASH to the Report
Build Spec already added a VPD report subsection of FLASH to the Report
chapter, it provide a simple way for user to determine where the VPD
region and VPD PCDs are located in the fd file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19026 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 03:36:50 +00:00
Ard Biesheuvel 3164361121 BaseTools/GenFw ARM: allow R_ARM_REL32 relocations
R_ARM_REL32 are relative relocations, so we don't need to do anything
special when performing the ELF to PE/COFF conversion, since our memory
layout is identical between the two binary formats. So just allow them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18931 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-24 08:40:33 +00:00
Hess Chen 48b77f5ea9 BaseTool/UPT: Add supporting of decimal numbers for INF_VERSION and DEC_SPECIFICATION
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18868 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-18 05:38:35 +00:00
Yonghong Zhu 1834aeeac6 BaseTools/toolsetup.bat: fixed the error when the path contains space
when the path contains space, it will report error for PATH Environment
update.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18852 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 07:45:04 +00:00