From a420df3c8ad83ad590cd5b86b52ebcaa736022b2 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 13 May 2013 20:14:58 +0000 Subject: [PATCH] Use an ugly hack to get around bootstrapping problems when building clang on head between r239347 and r245428. The former revision introduced CLOCK_PROCESS_CPUTIME_ID as a clock id for the clock_gettime() function and friends, but it was only added in , not in . Any program including would therefore not be able to use CLOCK_PROCESS_CPUTIME_ID, even though the value of _POSIX_CPUTIME indicates its existence. The latter revision synchronized the defines again. Work around this problem by defining the id on the command line for the particular .cpp file that needs it. If the id ever changes value, this hack will need to be updated. --- lib/clang/libllvmsupport/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/clang/libllvmsupport/Makefile b/lib/clang/libllvmsupport/Makefile index 1a2dd20c574c..6dff622422b8 100644 --- a/lib/clang/libllvmsupport/Makefile +++ b/lib/clang/libllvmsupport/Makefile @@ -93,3 +93,8 @@ SRCS+= DataExtractor.cpp \ .endif .include "../clang.lib.mk" + +# Ugly hack to work around CLOCK_PROCESS_CPUTIME_ID not being properly defined +# between r239347 and r245428. +CXXFLAGS.Process.cpp= -DCLOCK_PROCESS_CPUTIME_ID=15 +CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}}