2913 Commits

Author SHA1 Message Date
Mikhail Krichanov
16c414c1e8 OvmfPkg, BaseTools: Fixed Amaranth compilation for gcc-12.3.0. 2023-05-17 16:57:00 +03:00
Marvin Häuser
58021b2e7b ImageTool: Replace QuickSort with qsort 2023-05-09 18:24:31 +03:00
Marvin Häuser
cf1422b7eb BaseTools/GenFds: Fix reloc-stripped file name typo 2023-05-09 18:24:31 +03:00
Marvin Häuser
5d71d5f204 ImageTool: Remove old HII functionality 2023-05-09 18:24:31 +03:00
Marvin Häuser
820d54669f BaseTools: Introduce new HII section design 2023-05-09 18:24:31 +03:00
Marvin Häuser
3cbb3f3c55 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2023-05-09 18:24:31 +03:00
Marvin Häuser
c80ad49870 BaseTools/GenFv: Remove .text and .data from FV map 2023-05-09 18:24:30 +03:00
Marvin Häuser
2ab0dbf987 BaseTools: Remove GenFw 2023-05-09 18:24:30 +03:00
Marvin Häuser
8d2d635a7a BaseTools/Python: Replace GenFw with ImageTool 2023-05-09 18:24:30 +03:00
Marvin Häuser
6567f22721 ImageTool: Update command syntax to suit BaseTools/GenMake 2023-05-09 18:24:30 +03:00
Marvin Häuser
eb498a2fc3 ImageTool: Support FixedAddress 2023-05-09 18:24:30 +03:00
Marvin Häuser
5ed47e7c71 ImageTool: Utilize UefiImageLib 2023-05-09 18:24:30 +03:00
Marvin Häuser
b9a2fa8473 ImageTool: Support stripping relocs 2023-05-09 18:24:30 +03:00
Marvin Häuser
41a8eaf22b ImageTool: Separate image generation from file I/O logic 2023-05-09 18:24:30 +03:00
Marvin Häuser
3f044a39b8 ImageTool: Make IR canonical and compare input/output IRs 2023-05-09 18:24:30 +03:00
Marvin Häuser
a68aaab3c1 ImageTool: Make ELF SymbolsPath optional 2023-05-09 18:24:30 +03:00
Marvin Häuser
857d3804c7 ImageTool: Append .hii during PE generation 2023-05-09 18:24:30 +03:00
Marvin Häuser
c790116e13 ImageTool: Relocate using the IR 2023-05-09 18:24:30 +03:00
Marvin Häuser
4fccfa0359 ImageTool: Always store the full image segment data, including padding 2023-05-09 18:24:30 +03:00
Marvin Häuser
108c0769ad ImageTool: Don't shrink segment DataSize during validation 2023-05-09 18:24:30 +03:00
Marvin Häuser
98179a20bf BaseTools: Simplify ELF-to-PE build 2023-05-09 18:24:30 +03:00
Marvin Häuser
141a48425c ImageTool: Unify 32-bit and 64-bit tool variants 2023-05-09 18:24:30 +03:00
Marvin Häuser
270a038c4d ImageTool: Don't output errors for ElfScan() RETURN_UNSUPPORTED 2023-05-09 18:24:30 +03:00
Marvin Häuser
35049dd27c ImageTool: Remove ImageInfo global state 2023-05-09 18:24:30 +03:00
Marvin Häuser
49d174dd95 ImageTool: Remove global state from ELF scanning 2023-05-09 18:24:30 +03:00
Marvin Häuser
8f3ea92eda BaseTools/build_rule: Drop deprecated ASM16 definition 2023-05-09 18:24:30 +03:00
Mikhail Krichanov
c7edf90a16 Drop support for the TE format 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
002702671a BaseTools/CommonLib: Consume MemoryAllocationLib 2023-05-09 18:24:29 +03:00
Marvin Häuser
124e8a5ec2 BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-05-09 18:24:29 +03:00
Marvin Häuser
ad21bf30bc BaseTools/GenFv: Remove duplicated alignment macros 2023-05-09 18:24:29 +03:00
Marvin Häuser
52aff92912 BaseTools/DevicePath: Consume MdePkg/UefiDevicePathLib
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-05-09 18:24:28 +03:00
Marvin Häuser
e21683c782 BaseTools/CommonLib: Consume MdePkg and MdeModulePkg
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-05-09 18:24:28 +03:00
Mike Beaton
0f3b3460b4 GenSec: Support TianoCompress
Allows .fdf files to define a compressed .ffs section which can be read
by legacy EFI firmware (such as found on Apple Mac).
Use `COMPRESS TIANO`.
2023-05-09 18:24:28 +03:00
Mikhail Krichanov
c189dd0bd0 Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
9c3595f1bd BaseTools: Removed GCC48/49 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
05c47cd0d1 Conf: Remove unused IPHONE_TOOLS, SOURCERY_CYGWIN_TOOLS defs and EBC (EFI Byte Code) compiler definitions. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
1ed79bc4df BaseTools: Removed VS2008-VS2013 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
6ef394d429 Conf: Removed CLANG35/38 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
db34228ae5 BaseTools, MdeModulePkg: Update brotli submodule
Update the brotli submodule to the latest commit (ed1995b6bda1)
so that the build isn't broken in GCC 12 compilers.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Mikhail Krichanov
1e0cdd036d BaseTools: Replaced GenFw with ImageTool and MicroTool. 2023-05-09 18:19:07 +03:00
Mikhail Krichanov
29ab261538 SecurePE: Replaced old PE loader with Secure one. 2023-05-09 18:18:43 +03:00
Marvin Häuser
fb5e7be923 BaseTools/tools_def: Disable PIE generation for IA32 CLANGDWARF
Commit c25d390 disabled PIE generation for GCC49 and GCC5 as the GCC toolchains
at the time started enabling it by default. LLVM 15 has now done the same thing
for all Linux targets [1]. This causes the emission of a GOT with relocations
that GenFw does not currently support.

As such, disable PIC and PIE for the CLANGDWARF toolchain for IA32 targets, as
already done for GCC49 and GCC5, to support LLVM 15.

[1] ca68038d12

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-04-28 16:55:39 +03:00
Mikhail Krichanov
1a28f374fe Build: Fixed missing HII for X64, IA32 CLANGDWARF DEBUG, NOOPT. 2023-04-28 16:55:39 +03:00
Vitaly Cheptsov
29701b6bd9 BaseTools: Allow .text relocations in CLANGDWARF toolchain
UefiCpuPkg modules like ExceptionHandlerAsm.nasm require relocations
to .text or PIC as they use instructions like mov or bt against
external symbols:

1. mov     rax, ASM_PFX(CommonInterruptEntry)
2. mov     rax, HookAfterStubHeaderEnd
3. bt      [ASM_PFX(mErrorCodeFlag)], ecx
4. mov     [rcx + (@VectorNum - HookAfterStubHeaderBegin)], al

It is not easily possible to rewrite 3/4 cases without involving
more registers or more commands, and EDK II has never targeted
read-only .text at load time, only at runtime.

Change the defaults to let OVMF compile by CLANGDWARF as per:
https://lists.llvm.org/pipermail/llvm-dev/2017-March/111441.html

Signed-off-by: Vitaly Cheptsov <cheptsov@ispras.ru>
2023-04-28 16:55:39 +03:00
Mikhail Krichanov
4539a64818 BaseTools: Fix for NOOPT CLANG38 compilation with clang-13
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3715

We must treat not only R_X86_64_PLT32 as R_X86_64_PC32
(https://github.com/torvalds/linux/commit/
b21ebf2fb4cde1618915a97cc773e287ff49173e),
but also treat R_386_PLT32 relocation as R_386_PC32
(https://github.com/torvalds/linux/commit/
bb73d07148c405c293e576b40af37737faf23a6a).

Signed-off-by: Mikhail Krichanov <krichanov@ispras.ru>
2023-04-28 16:55:39 +03:00
Sunil V L
2c5961cccf BaseTools/tools_def.template: Update -march parameter for RISC-V
Replace rv64imafdc with rv64gc so that it works for gcc 12.

"g" means imafd in gcc < 12 and imafd_zifencei_zicsr in gcc >= 12.
So, replacing rv64imafdc with rv64gc will work for both gcc <12
and gcc >=12.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-02-23 03:56:05 +00:00
Joey Vagedes
02fcfdce1e BaseTools: Update WindowsVsToolChain plugin
This patch updates edk2-pytool-library dependency to v0.14.0, which has
an interface change to FindWithVsWhere. The BaseTools plugin uses this
function, so it is being updated to account for the interface change.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>

Signed-off-by: Joey Vagedes <joeyvagedes@microsoft.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-02-16 18:54:33 +00:00
Thierry LARONDE
aef0061ac2 BaseTools: remove useless dependency on libuuid
Signed-off-by: Thierry LARONDE <tlaronde@polynum.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-02-07 03:10:41 +00:00
Rebecca Cran
15f98047d2 BaseTools: Remove CYGWIN_NT-5.1-i686 ref from Scripts/PatchCheck.py
With the removal of RVCT support and the related Bin/CYGWIN_NT-5.1-i686
and Darwin-i386 directories, remove a leftover reference to
CYGWIN_NT-5.1-i686 from Scripts/PatchCheck.py.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Bob Feng <bob.c.feng@intel.com>
2023-01-30 16:50:14 +00:00
Rebecca Cran
cdcee3d17b BaseTools: Delete Bin/{CYGWIN_NT-5.1-i686,Darwin-i386} directories
The Bin/CYGWIN_NT-5.1-i686 and Bin/Darwin-i386 directories contained
files needed for RVCT support.

Since EDK2 no longer supports RVCT, delete those directories.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Bob Feng <bob.c.feng@intel.com>
2023-01-30 16:50:14 +00:00