Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111914203
D42303.id129148.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42303.id129148.diff
View Options
diff --git a/tools/build/Makefile b/tools/build/Makefile
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -196,9 +196,15 @@
SRCS+= rpmatch.c
.if ${.MAKE.OS} == "Linux"
-# On Linux, glibc does not provide strlcpy,strlcat or strmode.
+# On Linux, glibc does not provide strmode. It only provides strlcpy
+# and strlcat from glibc 2.38.
.PATH: ${LIBC_SRCTOP}/string
-SRCS+= strlcpy.c strlcat.c strmode.c
+SRCS+= strmode.c
+# Assume if strlcpy exists so does strlcat
+_WITH_EXPLICIT_STRLCPY!= cat ${HOST_INCLUDE_ROOT}/strings.h ${HOST_INCLUDE_ROOT}/string.h | grep -c strlcpy || true
+.if ${_WITH_EXPLICIT_STRLCPY} == 0
+SRCS+= strlcpy.c strlcat.c
+.endif
# On Linux, glibc provides ffs* but not fls*
SRCS+= fls.c flsl.c flsll.c
# Compile the fgetln/fgetwln/closefrom fallback code from libbsd:
diff --git a/tools/build/cross-build/include/linux/string.h b/tools/build/cross-build/include/linux/string.h
--- a/tools/build/cross-build/include/linux/string.h
+++ b/tools/build/cross-build/include/linux/string.h
@@ -47,8 +47,11 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
+#if !defined(__GLIBC__) || \
+ (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 38) || !defined(_GNU_SOURCE)))
size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz);
+#endif
char *strnstr(const char *str, const char *find, size_t str_len);
void strmode(mode_t mode, char *str);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 11, 4:59 AM (19 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17094958
Default Alt Text
D42303.id129148.diff (1 KB)
Attached To
Mode
D42303: tools/build: Support building with glibc 2.38
Attached
Detach File
Event Timeline
Log In to Comment