Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 2021 06:02:04 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ca718f503168 - stable/13 - libkern: use compiler builtins for strcpy, strcmp and strlen
Message-ID:  <202104100602.13A624N0015156@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=ca718f503168291d3f764e32f7642501c5283efd

commit ca718f503168291d3f764e32f7642501c5283efd
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-02-07 19:50:25 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-04-10 05:57:55 +0000

    libkern: use compiler builtins for strcpy, strcmp and strlen
    
    (cherry picked from commit 81e074d57dfcd86f152e2848dc44b77087ee7a2d)
---
 sys/sys/libkern.h | 4 ++++
 1 file changed, 4 insertions(+)

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 *



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104100602.13A624N0015156>