Commit Graph

30 Commits

Author SHA1 Message Date
Vincent Chen 6958e19e06 fix: [Common] build failed with VS2015
The current BaseTools aligned with edk2-stable202311
introduces the replacement of __FUNCTION__ with __func__,
which causes compiler failure if the toolchain is using
VS2015. It is because VS2015 doesn't support __func__.
This patch reverts the change and its checker to continue
the VS2015 support.

Reference commit IDs from edk2 repo: b17a3a1 and c9fb11f

Test command: python BuildLoader.py build xxxx -t VS2015

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2024-03-29 09:36:07 -07:00
Guo Dong 416f2d95da
Sync edk2 basetool mdepkg (#2121)
* Sync BaseTools to align with edk2-stable202311

Keep the SBL specific change (e.g. Lz4).

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Sync MdePkg from EDK2 edk2-stable202311 branch

Only sync required file without any changes to EDK2 files.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Update MdePkg for SBL after sync from EDK2

Signed-off-by: Guo Dong <guo.dong@intel.com>

* Update SBL after updating Basetool and MdePkg

After Sync BaseTool and MdePkg to edk2-stable202311,
Need update SBL code to align with this change.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: rollback some changes after mdepkg sync

New change from MdePkg requires new NASM version.
To make sure NASM 2.14.02 still works, just rollback
few changes.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Update component size to fix build failure

After syncing BaseTool and MdePkg, some components would
have a little bigger size. So update the config to fix the
build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Remove unused asl code

Some ASL files don't exist but they are included in other asl files.
It would cause build failure with new build BaseTool. So just remove
them to fix the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>

---------

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-03-08 13:43:46 -05:00
tsaikevin c7abb91f16
feat: [BaseTools] Update to latest EDK2 stable tag 202211 (#1791)
This patch updated SBL BaseTools to be in sync with EDK2 stable tag 202211.

Preserve previous changes made in GNUmakefile, Makefile, RunTest, and
PatchCheck to prevent compiling issue.

Add condition to match last line when reporting "No newline at end of file"

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2022-12-19 16:21:27 -07:00
Bejean Mosher 3cf8c298f4 feat: Enforce newlines at the end of all text files in PatchCheck.py.
PatchCheck.py currently checks for files without terminating newlines
but takes no action. This change will report this as a code format error.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2022-12-13 16:07:54 -07:00
Lennert Buytenhek 9cf6f1354e Fix two instances of printf("%s")'ing a FILE * instead of a char *
Signed-off-by: Lennert Buytenhek <buytenh@arista.com>
2022-06-27 10:57:52 -07:00
Maurice Ma 069031c9f8 [BaseTools] Update to latest EDK2 stable tag 202111
This patch updated SBL BaseTools to be in sync with EDK2 stable tag
202111.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Maurice Ma fb17a7389f PatchCheck: Skip more files that contain non-standard whitespace
This patch added additional files to be excluded from patch check.
For example, txt, ini, app, common, template, rule, Makefile,
GNUmakefile, etc.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-10 13:15:04 -08:00
Maurice Ma d94ff784bd Remove trailing whitespace/tabs from source files
Current PatchChecker.py still complains lots of files with
trailing whitespace and tabs. This patch addressed these
error reporting.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-10 13:15:04 -08:00
Mike Crowe 990e3e81e6 Use LF line endings in the repository
Convert the line endings stored for all text files in the repository to
LF. The majority previously used DOS-style CRLF line endings. Add a
.gitattributes file to enforce this and treat certain extensions as
never being text files.

Update PatchCheck.py to insist on LF line endings rather than CRLF.
However, its other checks fail on this commit due to lots of
pre-existing complaints that it only notices because the line endings
have changed.

Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch
needs to be treated as binary since it contains a mixture of line
endings.

This change has implications depending on the client platform you are
using the repository from:

* Windows

The usual configuration for Git on Windows means that text files will
be checked out to the work tree with DOS-style CRLF line endings. If
that's not the case then you can configure Git to do so for the entire
machine with:

 git config --global core.autocrlf true

or for just the repository with:

 git config core.autocrlf true

Line endings will be normalised to LF when they are committed to the
repository. If you commit a text file with only LF line endings then it
will be converted to CRLF line endings in your work tree.

* Linux, MacOS and other Unices

The usual configuration for Git on such platforms is to check files out
of the repository with LF line endings. This is probably the right thing
for you. In the unlikely even that you are using Git on Unix but editing
or compiling on Windows for some reason then you may need to tweak your
configuration to force the use of CRLF line endings as described above.

* General

For more information see
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings .

Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400
Signed-off-by: Mike Crowe <mac@mcrowe.com>
2021-11-10 12:46:42 -08:00
Chin Keong Ang 653382dbd1 Fix hang at STAGE1B when compile with MSVC 2017 for IA32 Debug
Removed the Oy- flag for DEBUG_VS2017_IA32_CC_FLAGS
which was introduced recently in commit 9f3d2b5fc3
it causes hang when calculating SHA384 by CryptoLib call by SecureBootLib driver

Signed-off-by: Chin Keong Ang <chin.keong.ang@intel.com>
2020-12-01 20:54:10 -08:00
Mircea Gherzan 9f3d2b5fc3 Fix the compiler flags for MSVC 2017 and 2019
* Enable frame pointers (via /Oy-) for 32-bit modules. From the
documentation: "If you specify a debug compiler option (/Z7, /Zi, /ZI),
we recommend that you specify the /Oy- option after any other
optimization compiler options."
* /O1b2s is equivaled to /O1 (/Ob2 and /Os are included in /O1)
* /Z7 for debug info is obsolete, replace with /Zi

Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
2020-11-03 12:38:58 -08:00
Maurice Ma 1608235af1 Resync BaseTools with latest EDKII stable tag
This patch synced BaseTools with EDKII stable tag:
  edk2-stable202008

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-12 16:02:35 -07:00
Maurice Ma b05a73f24b Upgrade LZ4 to 1.7.4
This patch upgraded the LZ4 from 1.4.0 to 1.7.4. The size will
increase around 300 bytes. Performance is still very similar.
But when trying to use more recent LZ4 version 1.9, noticed
significant performance degration. So keep to 1.7.4 for now.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-15 17:54:26 -07:00
Maurice Ma bde798e186
Add travis Windows build support (#650)
This patch added build for Windows VS2017 in Travis. The following
build will be verified on Travis now:
 - QEMU GCC x86 Debug
 - QEMU GCC x64 Release
 - APL  GCC x64 Debug
 - CFL  GCC x86 Release
 - APL  VC  x86 Debug
 - APL  VC  x64 Release
 - CFL  VC  x86 Release
 - CFL  VC  x64 Debug

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-09 13:25:38 -07:00
James Gutbub 2ea731017c Skip submodules during PatchCheck.py
If a submodule is being updated in a
commit there is inadvertently some line
ending issues that will cause PatchCheck.py
to report an error; since we cannot change
the line ending in the submodule files
we should skip over a line in a patch that
matches the format of a submodule being
updated.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-02-06 16:05:11 -07:00
Maurice Ma 6d41183c52 Fix BaseTools FFS map file dependency issue
With the lastest EDK2 201911 BaseTools, the generated Makefile has
missing dependcy file for the map file target. It results in staled
map file when source code is modified.  This patch added the missing
dependencies.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-02-06 12:27:14 -08:00
Maurice Ma 5bd480e425 Sync up new BaseTools to EDK201911 stable release
This patch synced up the BaseTools to EDK201911.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-02-03 15:49:48 -08:00
Aiden Park e79890742f
[PatchCheck] Add exception file types (#523)
The PatchCheck.py will skip specified file types in skip_check_file_types.
As of now, .patch and .pem files are in skip list.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-01-08 11:19:42 -08:00
Aiden Park 6295c4ec8f Build stuck on unicode locale Windows
This issue happens under two conditions
  1. Unicode language environment in Windows
  2. A python calls 'BaseTools/toolsetup.bat'
     (In EDKII, edksetup.bat directly in Windows command shell)

- 'BuildLoader.py' calls 'BaseTools/toolsetup.bat' in a subprocess
- 'BaseTools/toolsetup.bat' calls 'nmake cleanall'
- 'cleanall' target runs 'python NmakeSubdirs.py' directly
- 'NmakeSubdirs.py' creates multi-threads
-  The threads create another subprocesses

But, one of multi-threads is on deadlock when python handles stdout and
stderr in a subprocess pipe only if the output includes unicode chars.
Therefore, only stderr will be handled in the pipe same as a single
thread call.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-11 13:35:31 -08:00
Aiden Park 2105a49e04 [PatchCheck] Skip CRLF check in git .patch files
GIT allows only UNIX format in .patch file. Otherwise, git am or apply
will report 'fatal: git apply: bad git-diff - expected /dev/null'.
But, PatchCheck blocks non-CRLF changes in commit. It's mutual exclusive.
Therefore, skip CRLF check in git .patch files.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-11 13:35:31 -08:00
Aiden Park b24fd2759c Cosmetic: Convert LF to CRLF
This will fully support PatchCheck.py.
- Remove all trailing whitespace
- Convert LF to CRLF by default
- Update EFI_D_* to DEBUG_*
- Re-enable CRLF check in PatchCheck.py

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-02 16:21:19 -08:00
Aiden Park 143b7facaa PatchCheck: Re-enable TAB check
This will not allow TAB characters in commit(s).

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-21 12:11:37 -08:00
Aiden Park b5c9976bf1 PatchCheck: Skip TAB check in .py files
This patch will skip TAB check in all python files for now.
THis change will be reverted after cleanup all TABs.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-12 21:02:32 -07:00
Aiden Park d313c9c5fc Disable force_crlf in PatchCheck.py for now
Slim Bootloader code has both CRLF and LF line-ending files.
Before cleaning-up, disable force_crlf for now.

Change-Id: I2e73ccfb8814ea8638c078f284ca7dbeca298e8b
Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-09-30 12:40:28 -07:00
Aiden Park ad211e7adb Add PatchCheck.py from EDK2 BaseTools
The PatchCheck.py does basic rule check on commit message and code.
This can be used as one of pre-commit checker before doing PR.

ex) N: the number of commits from HEAD
  python BaseTools/Scripts/PatchChecker.py -N

Change-Id: Ib75aafa2c3eb3408de08f7fab7fff4934715547c
Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-09-30 12:40:28 -07:00
Maurice Ma 6f8c44b375 Sync up with EDK2 stable tag edk2-stable201905
Synced up MdePkg, IntelFsp2Pkg and BaseTools to EDK2 stable tag
edk2-stable201905.

There are several changes for MdePkg and BaseTools.
MdePkg:
 - Support light print to reduce SBL size
   MdePkg\Library\BasePrintLib\PrintLibInternal.c
   MdePkg\Include\Library\DebugLib.h
 - TCG TPM2 spec changes and remove dependencies
   MdePkg\Include\IndustryStandard\UefiTcgPlatform.h
   MdePkg\Include\IndustryStandard\Tpm2Acpi.h
 - Use old NVM protocol file
   MdePkg\Include\Protocol\NvmExpressPassthru.h
 - Removed unused files

BaseTools:
 - Added LZ4 support
 - Removed unused files

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-06-12 08:29:06 -07:00
Maurice Ma afe4dde4fb Remove UPT tool from BaseTools
This patch removed unused UPT tool from BaseTools. This UPT tool
also contains sqlite3.dll binary. It is not preferred in the source
repo.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-13 15:07:00 -07:00
Aiden Park d7ec54a79f BaseTools: Fix build failure on Fedora29 with gcc 8.2.1
This change includes below commits from the latest EDKII.
- The build failure has been identified on Fedora 29 with gcc version
  8.2.1 20181215 (Red Hat 8.2.1-6).
- Verified no compile errors with below changes from EDKII.

commit 9de306701312f986c9638cb819d3f1f848d55cab
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Fri Mar 2 17:11:52 2018 +0100
    BaseTools/GenVtf: silence false "stringop-overflow" warning with memcpy()

commit 03252ae287c4a61983b3793ff71baeabe2ff3df7
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Wed Jul 25 22:40:09 2018 +0200
    BaseTools/header.makefile: remove "-c" from BUILD_CFLAGS

commit 9222154ae7b3eef75ae88cdb56158256227cb929
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Fri Mar 2 17:11:52 2018 +0100
    BaseTools/header.makefile: add "-Wno-restrict"

commit 1d212a83df0eaf32a6f5d4159beb2d77832e0231
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Fri Mar 2 17:11:52 2018 +0100
    BaseTools/header.makefile: add "-Wno-stringop-truncation"

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-02-13 10:05:07 -08:00
Aiden Park 397f25b853
Remove Python cx-freeze dependency (#51)
Ported the patch from EDKII repository and added following up changes

<Original commit info in EDKII>
commit 7b500c606ad101fad52327318af37889048cd45e
Author: Liming Gao <liming.gao@intel.com>
Date:   Tue Oct 16 23:08:46 2018 +0800

    BaseTools: Remove the step to freeze python tool

    https://bugzilla.tianocore.org/show_bug.cgi?id=1257
    Binary python tool is not supported anymore. So, the freeze python tool
    step is not required.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-12-03 15:05:24 -08:00
Maurice Ma c6999f497a Initial check-in for Slim Bootloader source 2018-09-13 16:11:07 -07:00