audk/MdePkg/Library/StackCheckLib/StackCheckLib.inf
Oliver Smith-Denny efbf5ed08c MdePkg: Move StackCheckLibStaticInit to StackCheckLib
This commit oves StackCheckLib from a NULL lib to an instance of
StackCheckLib. This requires every entry point to add a library
dependency on StackCheckLib. It also requires every SEC module
to have a dependency on StackCheckLib because there is no
standard SEC entry point.

It allows for greater flexibility for a platform to apply stack
cookies and simplifies DSC logic.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00

57 lines
1.7 KiB
INI

## @file
# Provides the required functionality for checking the stack cookie.
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
[Defines]
INF_VERSION = 1.29
BASE_NAME = StackCheckLib
FILE_GUID = 1C4CA056-8FEA-413C-89D2-59A7E22847B3
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = StackCheckLib
[Sources]
StackCheckLibCommonMsvc.c | MSFT
StackCheckLibCommonGcc.c | GCC
[Sources.IA32]
IA32/CheckCookieMsvc.nasm | MSFT
[Sources.X64]
X64/CheckCookieMsvc.nasm | MSFT
[Sources.IA32, Sources.X64]
IA32/StackCookieInterrupt.nasm
[Sources.ARM]
Arm/StackCookieInterrupt.S |GCC
Arm/StackCookieInterrupt.asm |MSFT
[Sources.AARCH64]
AArch64/StackCookieInterrupt.S |GCC
AArch64/StackCookieInterrupt.asm |MSFT
[Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
StackCheckFailureHookLib
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdStackCookieExceptionVector
[BuildOptions]
# We cannot build the MSVC version with /GL (whole program optimization) because we run into linker error
# LNK1237, which is a failure to link against a symbol from a library compiled with /GL. The whole program
# optimization tries to do away with references to this symbol. The solution is to not compile the stack
# check libs with /GL
MSFT:*_*_*_CC_FLAGS = /GL-
# We cannot build the GCC version with LTO (link time optimization) because we run into linker errors where
# the stack cookie variable has been optimized away, as it looks to GCC like the variable is not used, because
# the compiler inserts the usage.
GCC:*_*_*_CC_FLAGS = -fno-lto