xref: /aosp_15_r20/external/coreboot/util/smmstoretool/udk2017.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef SMMSTORETOOL__UDK2017_H__
4 #define SMMSTORETOOL__UDK2017_H__
5 
6 #include <UDK2017/MdePkg/Include/Uefi/UefiBaseType.h>
7 #include <UDK2017/MdePkg/Include/Uefi/UefiMultiPhase.h>
8 #include <UDK2017/MdePkg/Include/Pi/PiFirmwareVolume.h>
9 #include <UDK2017/MdeModulePkg/Include/Guid/VariableFormat.h>
10 
11 /*
12  * ProcessorBind.h contains `#pragma GCC visibility push(hidden)` guarded by an
13  * identical condition, but there is no corresponding `pop` pragma. This can
14  * cause trouble for code following headers above including libc headers because
15  * linker suddenly considers declarations from them (e.g., `strcmp()`) to be
16  * hidden.
17  *
18  * In order to address this situation all UDK2017 headers used by this tool
19  * must be listed above and included indirectly through this header which
20  * restores default visibility.
21  *
22  * Mind that this issue appears only if the following conditions are satisfied
23  * and not all toolchains are configured to build position-independent code by
24  * default (as if -fpic or -fpie appears on compilation command-line).
25  */
26 #if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
27 #pragma GCC visibility pop
28 #endif
29 
30 #endif // SMMSTORETOOL__UDK2017_H__
31