From f744f1c1dd9dde19820200169f8bf5453b832916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C3=ABtek=20Bak?= Date: Tue, 9 Dec 2014 22:50:51 +0000 Subject: [PATCH] Work around bug in glibc 2.11 --- rts/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rts/Makefile b/rts/Makefile index 30a359ea5..7d133b9aa 100644 --- a/rts/Makefile +++ b/rts/Makefile @@ -8,6 +8,15 @@ CFLAGS:=-fPIC $(CFLAGS) CFLAGS += $(GMP_INCLUDE_DIR) $(GMP) -DIDRIS_TARGET_OS="\"$(OS)\"" CFLAGS += -DIDRIS_TARGET_TRIPLE="\"$(MACHINE)\"" +# NOTE: This works around glibc 2.11 not declaring pthread_mutexattr_settype +# and PTHREAD_MUTEX_RECURSIVE by default, causing compilation failures on +# Debian 6 and Ubuntu 10.04 LTS. +ifeq ($(OS), unix) +ifneq ($(shell ldd --version | head -n 1 | grep 2.11),) + CFLAGS += -D_GNU_SOURCE +endif +endif + ifeq ($(OS), windows) OBJS += windows/idris_stdfgn.o windows/idris_net.o else