summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2024-03-30 21:58:31 +0100
committerFelix Fietkau <nbd@nbd.name>2024-03-30 21:59:24 +0100
commit0cb3e86557fe17824283224b711fe7394590c680 (patch)
tree2e55e73cd32666d3f397342fe3890ab6800c93ab /target
parent0c96d20bf9fba6d814efa88c6fb08a5df094103a (diff)
downloadopenwrt-0cb3e86557fe17824283224b711fe7394590c680.tar.gz
openwrt-0cb3e86557fe17824283224b711fe7394590c680.tar.bz2
openwrt-0cb3e86557fe17824283224b711fe7394590c680.zip
kernel: fix build issue on macOS
On x86, the build failed while trying to compile tools/lib/string.c because of a clash with the system provided implementation for strlcpy Add ifdefs to prevent the conflict. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/hack-6.1/212-tools_portability.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/target/linux/generic/hack-6.1/212-tools_portability.patch b/target/linux/generic/hack-6.1/212-tools_portability.patch
index add281991e..3ee4393006 100644
--- a/target/linux/generic/hack-6.1/212-tools_portability.patch
+++ b/target/linux/generic/hack-6.1/212-tools_portability.patch
@@ -340,3 +340,21 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
else ifneq ($(CROSS_COMPILE),)
# Allow userspace to override CLANG_CROSS_FLAGS to specify their own
+--- a/tools/lib/string.c
++++ b/tools/lib/string.c
+@@ -100,6 +100,7 @@ int strtobool(const char *s, bool *res)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wignored-attributes"
+ #endif
++#ifndef __APPLE__
+ size_t __weak strlcpy(char *dest, const char *src, size_t size)
+ {
+ size_t ret = strlen(src);
+@@ -111,6 +112,7 @@ size_t __weak strlcpy(char *dest, const
+ }
+ return ret;
+ }
++#endif
+ #ifdef __clang__
+ #pragma clang diagnostic pop
+ #endif