From f4b23769de50ab2172163d2135f2a82ae9396e30 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 12 Jan 2016 16:42:12 +0000 Subject: perf: fix strerror_r override detection, apparently part of tools/ relies on non-GNU behavior Signed-off-by: Felix Fietkau git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48221 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/devel/perf/Makefile | 2 +- package/devel/perf/musl-compat.h | 11 ----------- package/devel/perf/musl-include/string.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 package/devel/perf/musl-include/string.h (limited to 'package') diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile index 97eecd715d..e6ee62f5a2 100644 --- a/package/devel/perf/Makefile +++ b/package/devel/perf/Makefile @@ -59,7 +59,7 @@ MAKE_FLAGS = \ prefix=/usr ifdef CONFIG_USE_MUSL - MAKE_FLAGS += EXTRA_CFLAGS="-include $(CURDIR)/musl-compat.h -D__UCLIBC__" + MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__" endif define Build/Compile diff --git a/package/devel/perf/musl-compat.h b/package/devel/perf/musl-compat.h index d0fa7810fa..458915d5eb 100644 --- a/package/devel/perf/musl-compat.h +++ b/package/devel/perf/musl-compat.h @@ -4,7 +4,6 @@ #ifndef __ASSEMBLER__ #include -#include #include #include #include @@ -16,16 +15,6 @@ #undef _IOC #undef _IO -/* Change XSI compliant version into GNU extension hackery */ -static inline char * -gnu_strerror_r(int err, char *buf, size_t buflen) -{ - if (strerror_r(err, buf, buflen)) - return NULL; - return buf; -} -#define strerror_r gnu_strerror_r - #define _SC_LEVEL1_DCACHE_LINESIZE -1 static inline long sysconf_wrap(int name) diff --git a/package/devel/perf/musl-include/string.h b/package/devel/perf/musl-include/string.h new file mode 100644 index 0000000000..65dc2f1e8f --- /dev/null +++ b/package/devel/perf/musl-include/string.h @@ -0,0 +1,18 @@ +#ifndef __MUSL_COMPAT_STRING_H +#define __MUSL_COMPAT_STRING_H + +#include_next + +/* Change XSI compliant version into GNU extension hackery */ +static inline char * +gnu_strerror_r(int err, char *buf, size_t buflen) +{ + if (strerror_r(err, buf, buflen)) + return NULL; + return buf; +} +#ifdef _GNU_SOURCE +#define strerror_r gnu_strerror_r +#endif + +#endif -- cgit v1.2.3