aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-02-07 19:50:25 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-02-08 19:15:21 +0000
commit81e074d57dfcd86f152e2848dc44b77087ee7a2d (patch)
tree8adf15df960014816dcb2facde3e71ffdc65bee2
parent3e2d96ac974db823255a6f40b90eeffa6e38d022 (diff)
downloadsrc-81e074d57dfcd86f152e2848dc44b77087ee7a2d.tar.gz
src-81e074d57dfcd86f152e2848dc44b77087ee7a2d.zip
libkern: use compiler builtins for strcpy, strcmp and strlen
-rw-r--r--sys/sys/libkern.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
index 3874ef9ec4bd..3f8827de06c5 100644
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -199,6 +199,10 @@ size_t kcsan_strlen(const char *);
#define strcpy(d, s) kcsan_strcpy((d), (s))
#define strcmp(s1, s2) kcsan_strcmp((s1), (s2))
#define strlen(s) kcsan_strlen((s))
+#else
+#define strcpy(d, s) __builtin_strcpy((d), (s))
+#define strcmp(s1, s2) __builtin_strcmp((s1), (s2))
+#define strlen(s) __builtin_strlen((s))
#endif
static __inline char *