[openwrt/openwrt] generic: fix PATH_MAX macro redefined in exec-cmd.c on macOS 15.4
LEDE Commits
lede-commits at lists.infradead.org
Sat Apr 19 03:05:45 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b77e6cd6272d55af7ea64200dd2358666d25b6db
commit b77e6cd6272d55af7ea64200dd2358666d25b6db
Author: Georgi Valkov <gvalkov at gmail.com>
AuthorDate: Fri Apr 18 16:37:33 2025 +0300
generic: fix PATH_MAX macro redefined in exec-cmd.c on macOS 15.4
Fix an error while building target/linux x64 on macOS 15.4 host,
due to the PATH_MAX macro being redefined:
mkdir -p /Volumes/test/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.6.86/tools/objtool && make O=/Volumes/test/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.6.86 subdir=tools/objtool --no-print-directory -C objtool
exec-cmd.c:15:9: error: 'PATH_MAX' macro redefined [-Werror,-Wmacro-redefined]
15 | #define PATH_MAX 4096
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:103:9: note: previous definition is here
103 | #define PATH_MAX 1024 /* max bytes in pathname */
| ^
exec-cmd.c is compiled as part of objtool to run on the host, and
therefore host headers are used, where PATH_MAX is already defined.
Using an old OpenWRT snapshot from 2025-02-16, where linux-6.6.77
used to build correctly, does not help. Reverting from Xcode 16.3 to
16.2 does not help either.
Signed-off-by: Georgi Valkov <gvalkov at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18530
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
target/linux/generic/hack-6.6/200-tools_portability.patch | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/target/linux/generic/hack-6.6/200-tools_portability.patch b/target/linux/generic/hack-6.6/200-tools_portability.patch
index f016e641c6..e58b4db5bc 100644
--- a/target/linux/generic/hack-6.6/200-tools_portability.patch
+++ b/target/linux/generic/hack-6.6/200-tools_portability.patch
@@ -61,6 +61,19 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
#define __cold
typedef __u16 __bitwise __le16;
+--- a/tools/lib/subcmd/exec-cmd.c
++++ b/tools/lib/subcmd/exec-cmd.c
+@@ -12,7 +12,10 @@
+ #include "subcmd-config.h"
+
+ #define MAX_ARGS 32
++
++#ifndef PATH_MAX
+ #define PATH_MAX 4096
++#endif
+
+ static const char *argv_exec_path;
+ static const char *argv0_path;
--- a/tools/objtool/include/objtool/objtool.h
+++ b/tools/objtool/include/objtool/objtool.h
@@ -12,6 +12,7 @@
More information about the lede-commits
mailing list