Skip to content

Commit

Permalink
Avoid duplicate symbols in edk2 and edk2-libc
Browse files Browse the repository at this point in the history
Fixes this build error when building with MSVC for aarch64:
CompilerIntrinsicsLib.lib(memmove_ms.obj) : error LNK2005: memmove already defined in LibString.lib(Copying.obj)
CompilerIntrinsicsLib.lib(memcmp_ms.obj) : error LNK2005: memcmp already defined in LibString.lib(Comparison.obj)
CompilerIntrinsicsLib.lib(memset_ms.obj) : error LNK2005: memset already defined in LibString.lib(Misc.obj)
CompilerIntrinsicsLib.lib(memcpy_ms.obj) : error LNK2005: memcpy already defined in LibString.lib(Copying.obj)

Similar approach is used in edk2/NetworkPkg/Test/NetworkPkgHostTest.dsc

Signed-off-by: Sergey Sudnitsyn <kotbegemoth@gmail.com>
  • Loading branch information
serge-s committed Oct 3, 2024
1 parent 02cd621 commit f32d263
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions StdLib/StdLib.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,10 @@

LuaLib|AppPkg/Applications/Lua/LuaLib.inf # Lua language library

[LibraryClasses.ARM]
[LibraryClasses.ARM, LibraryClasses.AArch64]
!if "MSFT" not in $(FAMILY)
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|StdLib/LibC/Softfloat/Softfloat.inf

# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf

[LibraryClasses.AArch64]
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

!endif
# Use the softfloat library to cover missing hardfloat operations.
NULL|StdLib/LibC/Softfloat/Softfloat.inf

Expand Down

0 comments on commit f32d263

Please sign in to comment.