-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libegt: Fix for cross-compile time detection of allocarray
kplot otherwise has runtime check for this, which fails when building for say x86, since build host is also x86 it is able to run the runtime testcode on build machine, but thats wrong, it should be either run using qemu or not run at all, here we use configure time check to detect reallocarray() Signed-off-by: Khem Raj <[email protected]>
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
recipes-graphics/libegt/libegt/0001-check-for-reallocarray-before-using-it.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
From 6f0aafeccb99b6c92a48ee1c775afdc0f16a1ce6 Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <[email protected]> | ||
Date: Fri, 13 Dec 2019 08:46:39 -0800 | ||
Subject: [PATCH] check for reallocarray before using it | ||
|
||
in kplot there is a runtime check for reallocarray which actually wont | ||
work in cross compile mode, luckily it does check for HAVE_REALLOCARRAY | ||
before usng the results of runtime check. So here add a configure time | ||
check for presense of reallocarray | ||
|
||
Fixes | ||
|
||
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 | ||
extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ||
^ | ||
../external/kplot/compat.h:24:7: note: previous declaration is here | ||
void *reallocarray(void *optr, size_t nmemb, size_t size); | ||
^ | ||
|
||
Upstream-Status: Submitted [https://github.com/linux4sam/egt/pull/2] | ||
Signed-off-by: Khem Raj <[email protected]> | ||
--- | ||
configure.ac | 2 +- | ||
src/chart.cpp | 1 + | ||
2 files changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 81410c78..65873d8b 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -210,7 +210,7 @@ AC_TYPE_UINT8_T | ||
|
||
# Checks for library functions. | ||
AC_FUNC_MMAP | ||
-AC_CHECK_FUNCS([floor memmove memset munmap select setlocale sqrt strerror]) | ||
+AC_CHECK_FUNCS([floor memmove memset munmap reallocarray select setlocale sqrt strerror]) | ||
|
||
AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" | ||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"], AC_MSG_ERROR(Can not find pthreads. This is required.)) | ||
diff --git a/src/chart.cpp b/src/chart.cpp | ||
index 7578ea29..0faf65e8 100644 | ||
--- a/src/chart.cpp | ||
+++ b/src/chart.cpp | ||
@@ -3,6 +3,7 @@ | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
+#include "config.h" | ||
#include "compat.h" | ||
#include "egt/chart.h" | ||
#include "egt/detail/meta.h" | ||
-- | ||
2.24.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters