[v2,2/3] RISC-V: Add compiler support check in string-fza.h and string-fzi.h
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
|
Build passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Test passed
|
Commit Message
Add macros from `compiler-ext-avail.h` to avoid using Zbb or XTheadBb in unsupported compiler versions.
Signed-off-by: Julian Zhu <jz531210@gmail.com>
---
sysdeps/riscv/string-fza.h | 5 ++++-
sysdeps/riscv/string-fzi.h | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
@@ -19,7 +19,10 @@
#ifndef _RISCV_STRING_FZA_H
#define _RISCV_STRING_FZA_H 1
-#if defined __riscv_zbb || defined __riscv_xtheadbb
+#include "compiler-ext-avail.h"
+
+#if (defined COMPILER_ZBB_AVAIL && defined __riscv_zbb) \
+ || (defined COMPILER_XTHEADBB_AVAIL && defined __riscv_xtheadbb)
/* With bitmap extension we can use orc.b to find all zero bytes. */
# include <string-misc.h>
# include <string-optype.h>
@@ -19,7 +19,10 @@
#ifndef _STRING_RISCV_FZI_H
#define _STRING_RISCV_FZI_H 1
-#if defined __riscv_zbb || defined __riscv_xtheadbb
+#include "compiler-ext-avail.h"
+
+#if (defined COMPILER_ZBB_AVAIL && defined __riscv_zbb) \
+ || (defined COMPILER_XTHEADBB_AVAIL && defined __riscv_xtheadbb)
# include <sysdeps/generic/string-fzi.h>
#else
/* Without bitmap clz/ctz extensions, it is faster to direct test the bits