From f1c5d5368d8c2dec90ff147d95b5a317bc84d04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20P=C3=B6chtrager?= Date: Thu, 11 Sep 2014 00:58:44 +0200 Subject: [PATCH] add a workaround for a glibc 2.20 bug --- build.sh | 1 + patches/cctools-cdefs.patch | 32 ++++++++++++++++++++++++++++++ wrapper/build.sh | 2 +- wrapper/quirks/include/sys/cdefs.h | 20 +++++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 patches/cctools-cdefs.patch create mode 100644 wrapper/quirks/include/sys/cdefs.h diff --git a/build.sh b/build.sh index 45d1679..a547bfe 100755 --- a/build.sh +++ b/build.sh @@ -186,6 +186,7 @@ if [ "$PLATFORM" == "Linux" ]; then fi # fix LD_LIBRARY_PATH patch -p0 < $PATCH_DIR/cctools-f7a5930.patch +patch -p0 < $PATCH_DIR/cctools-cdefs.patch popd &>/dev/null patch -p0 < $PATCH_DIR/cctools-ld64-1.patch patch -p0 < $PATCH_DIR/cctools-ld64-2.patch diff --git a/patches/cctools-cdefs.patch b/patches/cctools-cdefs.patch new file mode 100644 index 0000000..283cd68 --- /dev/null +++ b/patches/cctools-cdefs.patch @@ -0,0 +1,32 @@ +commit 7083dddbb0f106d791d313829ea7dc45db90e375 +Author: Thomas Pöchtrager +Date: Thu Sep 11 00:34:16 2014 +0200 + + add a workaround for a glibc 2.20 bug + +diff --git cctools/include/sys/cdefs.h cctools/include/sys/cdefs.h +new file mode 100644 +index 0000000..ca78da5 +--- /dev/null ++++ cctools/include/sys/cdefs.h +@@ -0,0 +1,20 @@ ++/* ++ * Workaround for a GLIBC bug. ++ * https://sourceware.org/bugzilla/show_bug.cgi?id=14952 ++ */ ++ ++#include_next ++ ++#ifdef __GLIBC__ ++ ++#ifndef __extern_inline ++# define __extern_inline \ ++ extern __inline __attribute__ ((__gnu_inline__)) ++#endif ++ ++#ifndef __extern_always_inline ++# define __extern_always_inline \ ++ extern __always_inline __attribute__ ((__gnu_inline__)) ++#endif ++ ++#endif /* __GLIBC__ */ diff --git a/wrapper/build.sh b/wrapper/build.sh index feeb81d..e692062 100755 --- a/wrapper/build.sh +++ b/wrapper/build.sh @@ -58,7 +58,7 @@ fi [ $PLATFORM = "FreeBSD" ] && FLAGS+="-lutil " if [[ $PLATFORM != *Windows ]] && [ $PLATFORM != "Darwin" ]; then - FLAGS+="-lrt " + FLAGS+="-lrt -isystem quirks/include" fi function compile_wrapper() diff --git a/wrapper/quirks/include/sys/cdefs.h b/wrapper/quirks/include/sys/cdefs.h new file mode 100644 index 0000000..ca78da5 --- /dev/null +++ b/wrapper/quirks/include/sys/cdefs.h @@ -0,0 +1,20 @@ +/* + * Workaround for a GLIBC bug. + * https://sourceware.org/bugzilla/show_bug.cgi?id=14952 + */ + +#include_next + +#ifdef __GLIBC__ + +#ifndef __extern_inline +# define __extern_inline \ + extern __inline __attribute__ ((__gnu_inline__)) +#endif + +#ifndef __extern_always_inline +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +#endif + +#endif /* __GLIBC__ */