Skip to content

Commit

Permalink
corepkcs11: Refactor Arm Compiler patch
Browse files Browse the repository at this point in the history
Do not define __PASTE-macro for Arm compiler patch is
modified as the issue that the patch is trying to solve
was already introduced before for Keil Compiler so, the
condition is just modified to add Arm Compiler too.

This is done to be able to push this patch upstream.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
  • Loading branch information
AhmedIsmail02 committed Jul 2, 2024
1 parent be129c6 commit 6a2ccc6
Showing 1 changed file with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
From a75eef190220626f7f2419f6844df441d4f2f5ff Mon Sep 17 00:00:00 2001
From: Devaraj Ranganna <devaraj.ranganna@arm.com>
Date: Wed, 26 Jul 2023 11:05:47 +0100
Subject: [PATCH] Do not define __PASTE macro for Arm compiler
From b57c4407d6438e252ade2b753565da9fffc8f8b7 Mon Sep 17 00:00:00 2001
From: Ahmed Ismail <Ahmed.Ismail@arm.com>
Date: Tue, 2 Jul 2024 10:46:38 +0100
Subject: [PATCH] Do not define __PASTE macro for Arm-compiler

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
__PASTE macro is defined for Arm Compiler in its header files
so to avoid conflicts it is undefined as it is already defined by
corePkcs11 headers.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
---
./source/dependency/3rdparty/pkcs11/pkcs11.h | 2 ++
1 file changed, 2 insertions(+)
source/include/core_pkcs11.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/dependency/3rdparty/pkcs11/pkcs11.h b/source/dependency/3rdparty/pkcs11/pkcs11.h
index 0d78dd7..ecead72 100644
--- a/source/dependency/3rdparty/pkcs11/pkcs11.h
+++ b/source/dependency/3rdparty/pkcs11/pkcs11.h
@@ -187,7 +187,9 @@ extern "C" {
*/
#include "pkcs11t.h"

+#ifndef __ARMCC_VERSION
#define __PASTE(x,y) x##y
+#endif
diff --git a/source/include/core_pkcs11.h b/source/include/core_pkcs11.h
index d8b84f7..6195f3f 100644
--- a/source/include/core_pkcs11.h
+++ b/source/include/core_pkcs11.h
@@ -197,8 +197,8 @@

/* Bring in the public header. */

/* ==============================================================
-/* Undefine the macro for Keil Compiler to avoid conflict */
-#if defined( __PASTE ) && defined( __CC_ARM )
+/* Undefine the macro for Keil and ARMClang Compilers to avoid conflict */
+#if defined( __PASTE ) && ( defined( __CC_ARM ) || defined( __ARMCC_VERSION ) )
/* ARM RCVT stdint.h has a duplicate definition with PKCS #11. */
#undef __PASTE
#endif
--
2.25.1
2.34.1

0 comments on commit 6a2ccc6

Please sign in to comment.