Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Test for the existence of execinfo.h #7

Merged
merged 1 commit into from

2 participants

@maxnet

Previous code assumed that on Linux the execinfo.h functions are always available, which is a glibc extension.
This change fixes building the library under buildroot, which uses uClibc by default

@maxnet maxnet Test for the existence of execinfo.h
Previous code assumed that on Linux the execinfo.h functions are always available, which is a glibc extension.
This change fixes building the library under buildroot, which uses uClibc by default
93ae1bc
@popcornmix popcornmix merged commit f7b1cad into raspberrypi:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 25, 2012
  1. @maxnet

    Test for the existence of execinfo.h

    maxnet authored
    Previous code assumed that on Linux the execinfo.h functions are always available, which is a glibc extension.
    This change fixes building the library under buildroot, which uses uClibc by default
This page is out of date. Refresh to see the latest.
View
7 interface/vcos/glibc/vcos_backtrace.c
@@ -26,7 +26,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <interface/vcos/vcos.h>
-#ifdef __linux__
+#ifdef HAVE_CMAKE_CONFIG
+#include "cmake_config.h"
+#endif
+#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#include <stdio.h>
@@ -35,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void vcos_backtrace_self(void)
{
-#ifdef __linux__
+#ifdef HAVE_EXECINFO_H
void *stack[64];
int depth = backtrace(stack, sizeof(stack)/sizeof(stack[0]));
char **names = backtrace_symbols(stack, depth);
View
4 makefiles/cmake/arm-linux.cmake
@@ -115,6 +115,10 @@ try_compile(HAVE_MTRACE
${CMAKE_SOURCE_DIR}/makefiles/cmake/srcs/test-mtrace.c
OUTPUT_VARIABLE foo)
+# test for existence of execinfo.h header
+include(CheckIncludeFile)
+check_include_file(execinfo.h HAVE_EXECINFO_H)
+
add_definitions(-DHAVE_CMAKE_CONFIG)
configure_file (
"makefiles/cmake/cmake_config.h.in"
View
3  makefiles/cmake/cmake_config.h.in
@@ -8,5 +8,8 @@
/** Do we have support for GLIBC mtrace() ? */
#cmakedefine HAVE_MTRACE
+/** Do we have the execinfo.h include file ? */
+#cmakedefine HAVE_EXECINFO_H
+
#endif
Something went wrong with that request. Please try again.