diff options
author | Oliver Smith-Denny <osde@microsoft.com> | 2025-01-03 10:09:41 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-01-22 19:47:20 +0000 |
commit | 14cb48b0a053b44c5a6bcc89cbbbf86ac78c7820 (patch) | |
tree | 2be6f2bac299b6f008d7b7ddd92b27afe6427593 /Conf | |
parent | 4613eb6abc22923a683f3f090601896eee4c4179 (diff) | |
download | edk2-14cb48b0a053b44c5a6bcc89cbbbf86ac78c7820.tar.gz |
BaseTools: Break Build on Linker Warnings
Today VS2022 and GCC are set to treat all compiler warnings as
errors and break the build. However, linker warnings for both
do not break the build. There are critical errors that can be
treated as warnings as the linker, such as not finding the
module entry point and use a default address as the entry
point. This will cause a runtime crash for something that
should be caught at build time.
This commit adds /WX to VS2022's DLINK_FLAGS and --fatal-warnings
to GCC's DLINK_FLAGS for IA32, X64, ARM, and AARCH64 in order to
break the build on linker warnings.
VS2022 linker warning 4210 is ignored for all builds because it
checks for static initializers and the linking of the VCRuntime.
edk2 never links the VCRuntime (except for HOST_APPLICATIONs) and
so the presence of static initializers will always cause this
warning, even when the edk2 code calls these initializers that
would otherwise be called in the _CRT_INIT function of the
VCRuntime. At the time of this commit, it only fails in CryptoPkg
for building OpenSSL, but could fail anywhere a static initializer
is used.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Diffstat (limited to 'Conf')
0 files changed, 0 insertions, 0 deletions