kumquat-buildroot/package/redis/redis-001-uclibc.patch
Thomas Petazzoni 5b13261dc7 redis: build fix and minor improvement
The redis-001-uclibc.patch was properly adding conditionals to ensure
HAVE_BACKTRACE is not defined when uClibc is used. However, __unix
doesn't seem to be define with the toolchain Peter uses on gcc14, so
the <features.h> doesn't get included, therefore __UCLIBC isn't
defined, and the code believes that backtrace support is available. We
fix this by including <features.h> when __linux__ is defined.

Fixes:
http://autobuild.buildroot.org/results/4ba818f877af145a547a1fede0bb738192c2f181/build-end.log.

Also add another patch that do not redefine the _LARGEFILE_SOURCE and
_FILE_OFFSET_BITS macros if they are already defined on the command
line. It avoids the ugly warnings that we could see from the build
logs, and therefore make it easier to spot real errors.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-03-25 23:36:08 +01:00

46 lines
1.4 KiB
Diff

redis-001-uclibc.patch: This patch fixes redis so that it can be compiled
against uclibc. Patch originates from:
Support cross-compiling for uClibc targets
https://github.com/antirez/redis/pull/537
Mike Steinert, mike.steinert@gmail.com
Signed-off-by: Daniel Price <daniel.price@gmail.com>
=========================================================================
diff -ur old/src/config.h new/src/config.h
--- old/src/config.h 2012-10-26 07:20:24.000000000 -0700
+++ new/src/config.h 2012-10-31 13:41:51.206309564 -0700
@@ -1,6 +1,10 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#if defined(__unix) || defined(__linux__)
+#include <features.h>
+#endif
+
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif
@@ -25,7 +29,7 @@
#endif
/* Test for backtrace() */
-#if defined(__APPLE__) || defined(__linux__)
+#if (defined(__APPLE__) || defined(__linux__) && !defined(__UCLIBC__))
#define HAVE_BACKTRACE 1
#endif
diff -ur old/src/Makefile new/src/Makefile
--- old/src/Makefile 2012-10-26 07:20:24.000000000 -0700
+++ new/src/Makefile 2012-10-31 13:40:39.224728830 -0700
@@ -135,7 +135,7 @@
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