[openwrt/openwrt] tools/cpio: fix compilation with clang
LEDE Commits
lede-commits at lists.infradead.org
Sat Nov 20 12:09:09 PST 2021
hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9211af712f29556be2d1a757a0d17c55580e4eab
commit 9211af712f29556be2d1a757a0d17c55580e4eab
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Mar 3 17:59:58 2021 -0800
tools/cpio: fix compilation with clang
A define dealing with builtin type is wrong. A gnulib update fixes
this, but that requires a new cpio version.
Refresh other patch.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
tools/cpio/patches/001-duplicate-program-name.patch | 2 --
tools/cpio/patches/010-clang.patch | 11 +++++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/cpio/patches/001-duplicate-program-name.patch b/tools/cpio/patches/001-duplicate-program-name.patch
index 57ff4c3cad..a7c3fbc8ae 100644
--- a/tools/cpio/patches/001-duplicate-program-name.patch
+++ b/tools/cpio/patches/001-duplicate-program-name.patch
@@ -4,8 +4,6 @@ https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=641d3f489cf6238bb916368d4b
* src/global.c: Remove superfluous declaration of program_name
-diff --git a/src/global.c b/src/global.c
-index fb3abe9..acf92bc 100644
--- a/src/global.c
+++ b/src/global.c
@@ -184,9 +184,6 @@ unsigned int warn_option = 0;
diff --git a/tools/cpio/patches/010-clang.patch b/tools/cpio/patches/010-clang.patch
new file mode 100644
index 0000000000..89c7a8149e
--- /dev/null
+++ b/tools/cpio/patches/010-clang.patch
@@ -0,0 +1,11 @@
+--- a/gnu/xalloc-oversized.h
++++ b/gnu/xalloc-oversized.h
+@@ -52,7 +52,7 @@ typedef size_t __xalloc_count_type;
+ #elif ((5 <= __GNUC__ \
+ || (__has_builtin (__builtin_mul_overflow) \
+ && __has_builtin (__builtin_constant_p))) \
+- && !__STRICT_ANSI__)
++ && !__STRICT_ANSI__) && !defined(__clang__)
+ # define xalloc_oversized(n, s) \
+ (__builtin_constant_p (n) && __builtin_constant_p (s) \
+ ? __xalloc_oversized (n, s) \
More information about the lede-commits
mailing list