From c32862ad56b456430728001da4b65f14f584c2f8 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Fri, 2 Aug 2024 18:52:55 -0400 Subject: [PATCH] [SQUASH ON REBASE] Revert "MdePkg/CompilerIntrinsicsLib: Add IntrinsicLib class and strcmp" (#1086) ## Description The `strcmp` function was added to CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c in edk2 commit 46226fb. Therefore, ARM and AARCH64 modules can pick up the `strcmp` function needed to compile code from there without adding more functionality to `CompilerIntrinsicsLib` just for building third-party crypto code. - [ ] Impacts functionality? - [ ] Impacts security? - [x] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested - CrytoBinPkg build of all architectures - Mu Basecore CI ## Integration Instructions - `strcmp` will no longer be provided in `ArmCompilerIntrinsicsLib`, use another implementation if needed. Marked potentially breaking for this reason. Signed-off-by: Michael Kubacki --- .../ArmCompilerIntrinsicsLib.inf | 2 -- MdePkg/Library/CompilerIntrinsicsLib/strcmp.c | 34 ------------------- 2 files changed, 36 deletions(-) delete mode 100644 MdePkg/Library/CompilerIntrinsicsLib/strcmp.c diff --git a/MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf b/MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf index def65a31f5..fb941274d6 100644 --- a/MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf +++ b/MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf @@ -16,11 +16,9 @@ MODULE_TYPE = BASE VERSION_STRING = 1.0 LIBRARY_CLASS = CompilerIntrinsicsLib - LIBRARY_CLASS = IntrinsicLib # MU_CHANGE: Support IntrinsicLib linking [Sources] - strcmp.c # MU_CHANGE: Add strcmp implementation memcpy.c | GCC memset.c | GCC diff --git a/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c deleted file mode 100644 index d005d1f301..0000000000 --- a/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c +++ /dev/null @@ -1,34 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// MU_CHANGE: WHOLE FILE - Add strcmp -// -// ------------------------------------------------------------------------------ - -int -strcmp ( - const char *, - const char * - ); - -#if defined (_MSC_VER) - #pragma intrinsic(strcmp) - #pragma function(strcmp) -#endif - -int -strcmp ( - const char *s1, - const char *s2 - ) -{ - while ((*s1 != '\0') && (*s1 == *s2)) { - s1++; - s2++; - } - - return *s1 - *s2; -}