Skip to content

Commit

Permalink
Support cross-compiling for uClibc targets
Browse files Browse the repository at this point in the history
Disable backtrace support in src/config.h if uClibc is detected.

Tested on the following platforms:

- sh4-linux-uclibc (GCC 4.1.1, uClibc 0.9.29)
- mipsel-linux-uclibc (GCC 4.4.5, uClibc 0.9.29)

To cross-compile:

    $ make CC=mipsel-linux-gcc MALLOC=libc

Signed-off-by: Michael Steinert <mike.steinert@gmail.com>

Closes #537
  • Loading branch information
msteinert authored and mattsta committed Aug 2, 2014
1 parent 2a0c018 commit aaf2db3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Expand Up @@ -149,7 +149,7 @@ persist-settings: distclean
echo REDIS_LDFLAGS=$(REDIS_LDFLAGS) >> .make-settings
echo PREV_FINAL_CFLAGS=$(FINAL_CFLAGS) >> .make-settings
echo PREV_FINAL_LDFLAGS=$(FINAL_LDFLAGS) >> .make-settings
-(cd ../deps && $(MAKE) $(DEPENDENCY_TARGETS))
-(cd ../deps && $(MAKE) CC=$(CC) $(DEPENDENCY_TARGETS))

.PHONY: persist-settings

Expand Down
6 changes: 5 additions & 1 deletion src/config.h
Expand Up @@ -30,6 +30,10 @@
#ifndef __CONFIG_H
#define __CONFIG_H

#ifdef __unix
#include <features.h>
#endif

#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif
Expand All @@ -56,7 +60,7 @@
#endif

/* Test for backtrace() */
#if defined(__APPLE__) || defined(__linux__)
#if (defined(__APPLE__) || defined(__linux__)) && !defined(__UCLIBC__)
#define HAVE_BACKTRACE 1
#endif

Expand Down

0 comments on commit aaf2db3

Please sign in to comment.