|
| 1 | +From 6f0aafeccb99b6c92a48ee1c775afdc0f16a1ce6 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Khem Raj < [email protected]> |
| 3 | +Date: Fri, 13 Dec 2019 08:46:39 -0800 |
| 4 | +Subject: [PATCH] check for reallocarray before using it |
| 5 | + |
| 6 | +in kplot there is a runtime check for reallocarray which actually wont |
| 7 | +work in cross compile mode, luckily it does check for HAVE_REALLOCARRAY |
| 8 | +before usng the results of runtime check. So here add a configure time |
| 9 | +check for presense of reallocarray |
| 10 | + |
| 11 | +Fixes |
| 12 | + |
| 13 | +TOPDIR/build/tmp/work/core2-32-yoe-linux/libegt/0.8-r0/recipe-sysroot/usr/include/stdlib.h:559:14: error: exception specification in declaration does not match previous declaration |
| 14 | +extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) |
| 15 | + ^ |
| 16 | +../external/kplot/compat.h:24:7: note: previous declaration is here |
| 17 | +void *reallocarray(void *optr, size_t nmemb, size_t size); |
| 18 | + ^ |
| 19 | + |
| 20 | +Upstream-Status: Submitted [https://github.com/linux4sam/egt/pull/2] |
| 21 | +Signed-off-by: Khem Raj < [email protected]> |
| 22 | +--- |
| 23 | + configure.ac | 2 +- |
| 24 | + src/chart.cpp | 1 + |
| 25 | + 2 files changed, 2 insertions(+), 1 deletion(-) |
| 26 | + |
| 27 | +diff --git a/configure.ac b/configure.ac |
| 28 | +index 81410c78..65873d8b 100644 |
| 29 | +--- a/configure.ac |
| 30 | ++++ b/configure.ac |
| 31 | +@@ -210,7 +210,7 @@ AC_TYPE_UINT8_T |
| 32 | + |
| 33 | + # Checks for library functions. |
| 34 | + AC_FUNC_MMAP |
| 35 | +-AC_CHECK_FUNCS([floor memmove memset munmap select setlocale sqrt strerror]) |
| 36 | ++AC_CHECK_FUNCS([floor memmove memset munmap reallocarray select setlocale sqrt strerror]) |
| 37 | + |
| 38 | + AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" |
| 39 | + CFLAGS="$CFLAGS $PTHREAD_CFLAGS"], AC_MSG_ERROR(Can not find pthreads. This is required.)) |
| 40 | +diff --git a/src/chart.cpp b/src/chart.cpp |
| 41 | +index 7578ea29..0faf65e8 100644 |
| 42 | +--- a/src/chart.cpp |
| 43 | ++++ b/src/chart.cpp |
| 44 | +@@ -3,6 +3,7 @@ |
| 45 | + * |
| 46 | + * SPDX-License-Identifier: Apache-2.0 |
| 47 | + */ |
| 48 | ++#include "config.h" |
| 49 | + #include "compat.h" |
| 50 | + #include "egt/chart.h" |
| 51 | + #include "egt/detail/meta.h" |
| 52 | +-- |
| 53 | +2.24.1 |
| 54 | + |
0 commit comments