[edk2-devel] [PATCH v2] MdePkg Base.h: Delete prototype for __builtin_return_address

Liming Gao liming.gao at intel.com
Mon Jul 27 02:17:35 UTC 2020


Reviewed-by: Liming Gao <liming.gao at intel.com>

-----Original Message-----
From: Jessica Clarke <jrtc27 at jrtc27.com> 
Sent: 2020年7月27日 9:59
To: devel at edk2.groups.io
Cc: Jessica Clarke <jrtc27 at jrtc27.com>; Gao, Liming <liming.gao at intel.com>; leif at nuviainc.com; Kinney, Michael D <michael.d.kinney at intel.com>
Subject: [PATCH v2] MdePkg Base.h: Delete prototype for __builtin_return_address

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1004

Being a compiler builtin, the type of __builtin_return_address is already known to the compiler so no prototype is needed. Clang also errors out when redeclaring certain builtins like this[1], though currently only for ones with custom type checking. At the moment, __builtin_return_address does not use custom type checking and so does not trigger this error, however, the CHERI fork of LLVM, which will form the basis of the toolchain for Arm's experimental Morello platform, does use custom type checking for it, and so gives an error. Thus, simply delete the unnecessary line.

[1] llvm/llvm-project at 41af97137572ad6d4dafc872e7ecf6bbb08d4984

Cc: Leif Lindholm <leif at nuviainc.com>
Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
---
Changes in v2:
 * Shortened [1] reference to fit column limit. The bug report has the
   full URL already, and this will still link correctly on GitHub.

 MdePkg/Include/Base.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 85a091b9d5..8e4271f6ea 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -1273,7 +1273,6 @@ typedef UINTN RETURN_STATUS;
   **/
   #define RETURN_ADDRESS(L)     ((L == 0) ? _ReturnAddress() : (VOID *) 0)
 #elif defined (__GNUC__) || defined (__clang__)
-  void * __builtin_return_address (unsigned int level);
   /**
     Get the return address of the calling function.
 
--
2.20.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63276): https://edk2.groups.io/g/devel/message/63276
Mute This Topic: https://groups.io/mt/75815158/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list