tools/cpio: fix compilation with clang
authorRosen Penev <rosenp@gmail.com>
Thu, 4 Mar 2021 01:59:58 +0000 (17:59 -0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 20 Nov 2021 20:08:25 +0000 (21:08 +0100)
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@gmail.com>
tools/cpio/patches/001-duplicate-program-name.patch
tools/cpio/patches/010-clang.patch [new file with mode: 0644]

index 57ff4c3cad5c86101655cc8e895b9419d8d207a6..a7c3fbc8aee645e21167cc677ed3be3407fe5872 100644 (file)
@@ -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 (file)
index 0000000..89c7a81
--- /dev/null
@@ -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) \