Browse Source

m4: Fix building with clang

android-5
Fredrik Fornwall 6 years ago
parent
commit
7584d38f4f
  1. 2
      packages/m4/build.sh
  2. 29
      packages/m4/lib-xalloc-oversized.h.patch

2
packages/m4/build.sh

@ -3,5 +3,3 @@ TERMUX_PKG_DESCRIPTION="Traditional Unix macro processor"
TERMUX_PKG_VERSION=1.4.18
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/m4/m4-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
# "undefined reference to `__muloti4":
TERMUX_PKG_CLANG=no

29
packages/m4/lib-xalloc-oversized.h.patch

@ -0,0 +1,29 @@
Fixed "undefined reference to __muloti4".
diff -u -r ../m4-1.4.18/lib/xalloc-oversized.h ./lib/xalloc-oversized.h
--- ../m4-1.4.18/lib/xalloc-oversized.h 2016-12-31 13:54:42.000000000 +0000
+++ ./lib/xalloc-oversized.h 2018-08-06 14:25:19.420628987 +0000
@@ -46,23 +46,6 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p)
-# define xalloc_oversized(n, s) \
- __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif ((5 <= __GNUC__ \
- || (__has_builtin (__builtin_mul_overflow) \
- && __has_builtin (__builtin_constant_p))) \
- && !__STRICT_ANSI__)
-# define xalloc_oversized(n, s) \
- (__builtin_constant_p (n) && __builtin_constant_p (s) \
- ? __xalloc_oversized (n, s) \
- : ({ __xalloc_count_type __xalloc_count; \
- __builtin_mul_overflow (n, s, &__xalloc_count); }))
-
-/* Other compilers use integer division; this may be slower but is
- more portable. */
-#else
# define xalloc_oversized(n, s) __xalloc_oversized (n, s)
-#endif
#endif /* !XALLOC_OVERSIZED_H_ */
Loading…
Cancel
Save