From 5cc734e0a3e941f866af6e234fe1e36939044110 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 21 Jul 2015 09:12:40 -0700 Subject: [PATCH] forkfd: Fix build with uClibc <= 0.9.33 That version of uClibc has neither pipe2 nor eventfd. There were two problems with our detection. First, it checked for glibc incorrectly, so the comparison was always true as __GLIBC__ << 16 = 0x20000 Second, we needed to check for uClibc's version. Task-number: QTBUG-47337 Change-Id: Ib306f8f647014b399b87ffff13f3023b7f8d6d4a Reviewed-by: Rafael Roquetto --- src/3rdparty/forkfd/forkfd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c index 86e109358c..a95d486d9f 100644 --- a/src/3rdparty/forkfd/forkfd.c +++ b/src/3rdparty/forkfd/forkfd.c @@ -44,11 +44,13 @@ #include #ifdef __linux__ -# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x207) || defined(__BIONIC__) +# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x207 && \ + (!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x921))) # include # define HAVE_EVENTFD 1 # endif -# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x209) || defined(__BIONIC__) +# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x209 && \ + (!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x921))) # define HAVE_PIPE2 1 # endif #endif