[v2,02/15] string/memchr: Add mechanism to set function attributes

Message ID 20240527111900.1060546-3-christoph.muellner@vrull.eu
State New
Headers
Series RISC-V: Add Zbb-optimized string routines as ifuncs |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed

Commit Message

Christoph Müllner May 27, 2024, 11:18 a.m. UTC
  This patch introduces the __CODEGEN_ATTRIBUTES macro which can be
used to set function attributes when building the code.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
 string/memchr.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/string/memchr.c b/string/memchr.c
index 08b5c41667..a2bcd0419e 100644
--- a/string/memchr.c
+++ b/string/memchr.c
@@ -29,6 +29,10 @@ 
 # define __memchr MEMCHR
 #endif
 
+#ifndef __CODEGEN_ATTRIBUTES
+# define __CODEGEN_ATTRIBUTES
+#endif
+
 static __always_inline const char *
 sadd (uintptr_t x, uintptr_t y)
 {
@@ -36,6 +40,7 @@  sadd (uintptr_t x, uintptr_t y)
 }
 
 /* Search no more than N bytes of S for C.  */
+__CODEGEN_ATTRIBUTES
 void *
 __memchr (void const *s, int c_in, size_t n)
 {