TianoCore EDK2 master
Loading...
Searching...
No Matches
MdeLibs.dsc.inc
1## @file
2# Mde DSC include file for [LibraryClasses*] section of all Architectures.
3#
4# This file can be included to the [LibraryClasses*] section(s) of a platform DSC file
5# by using "!include MdePkg/MdeLibs.dsc.inc" to specify the library instances
6# of some EDKII basic/common library classes.
7#
8# Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.<BR>
9#
10# SPDX-License-Identifier: BSD-2-Clause-Patent
11#
12##
13
14[Defines]
15!ifndef CUSTOM_STACK_CHECK_LIB
16 # The DSC parser will set any unset macros to 0. Then, below when we check for STATIC or DYNAMIC, even if we couch
17 # that in a !ifdef CUSTOM_STACK_CHECK_LIB, the parser will issue a warning that we are comparing a boolean (0) against
18 # a string, which will always fail. So we set it to a dummy value here.
19 DEFINE CUSTOM_STACK_CHECK_LIB = NONE
20!endif
21
22[LibraryClasses]
23 OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
24 ArmTrngLib|MdePkg/Library/BaseArmTrngLibNull/BaseArmTrngLibNull.inf
25 RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
26 CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
27 SmmCpuRendezvousLib|MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf
28 SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
29 SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
30 MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
31 StackCheckFailureHookLib|MdePkg/Library/StackCheckFailureHookLibNull/StackCheckFailureHookLibNull.inf
32 FvLib|MdePkg/Library/FvLib/FvLib.inf
33
34!if $(CUSTOM_STACK_CHECK_LIB) == STATIC
35 # To only use the static stack cookie, we just include the checking functionality.
36 StackCheckLib|MdePkg/Library/StackCheckLib/StackCheckLib.inf
37!elseif $(CUSTOM_STACK_CHECK_LIB) == DYNAMIC
38 StackCheckLib|MdePkg/Library/StackCheckLib/StackCheckLib.inf
39
40 # To use the dynamic stack cookie, we need to include the entry point libraries that will set up the stack cookie.
41 # Typically, PeiCore and PEIMs will not use dynamic stack cookies, so they are not included generally.
42 # If dynamic stack cookies are not enabled, we do not setup the entry points, as the existing behavior was
43 # for a platform to define them.
44 # StandaloneMmCoreEntryPoint is not included here because support dynamic stack cookies is not available for
45 # AARCH64 here. X64 platforms should include the DynamicStackCookieEntryPointLib in their DSC file.
46 DxeCoreEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/DxeCoreEntryPoint.inf
47 StandaloneMmDriverEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/StandaloneMmDriverEntryPoint.inf
48 UefiApplicationEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/UefiApplicationEntryPoint.inf
49 UefiDriverEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf
50
51!else
52 # If CUSTOM_STACK_CHECK_LIB is set, MdeLibs.dsc.inc will not link StackCheckLibNull and it is expected that the
53 # DSC being built is providing it's own implementation of StackCheckLib.
54 StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
55!endif
56
57[LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE]
58 # edk2 does not implement exception handling for SEC and PEI_CORE, so StackCheckLibNull is used, as failing
59 # stack cookies will generate an exception, which if unhandled can lead to a hung system state. If a platform
60 # implements exception handling for SEC and PEI_CORE, it can use StackCheckLib for these phases in its DSC.
61 StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
62
63[LibraryClasses.AARCH64]
64 #
65 # It is not possible to prevent the AARCH64 compilers from inserting generic intrinsic functions.
66 # This library provides the intrinsic functions generated by these compilers.
67 #
68 # Linking this here as a null library will cause all AARCH64 files to link against it and have
69 # definitions for the intrinsic functions.
70 #
71 NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
72
73[LibraryClasses.LOONGARCH64]
74 #
75 # Some LOONGARCH/LOONGARCH64 compilers may replace memory operations with libc functions to improve performance,
76 # and there is no way to prevent the LOONGARCH/LOONGARCH64 compilers from inserting generic intrinsics.
77 # This library provides the intrinsic functions generated by these compilers.
78 #
79 # Linking this here as a null library will cause all LOONGARCH/LOONGARCH64 files to link against it and have
80 # definitions for the intrinsic functions.
81 #
82 NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
#define NULL
Definition: Base.h:319
#define STATIC
Definition: Base.h:264