On 08/04/14 00:08, Alexander Ivchenko wrote:
Hi,
libcilkrts is compiled with "-nostdlib", that means we have to
explicitly specify the pthread library we should link with (e.g. we
don't have such problem with libgomp, because it is C). And, indeed,
"-lpthread" is hard-coded in the Makefile for cilkrts. For Android
this doesn't work, because lpthread is absent and pthreads are part of
libc.
I also noticed, that configure check for
"pthread_{,attr_}[sg]etaffinity_np" always fails, because at the point
where it is placed in configure.ac, "-pthread" is not set. We just
have to put this check after we added "-pthread" to CFLAGS. This patch
addresses this as well.
diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
index 3881c82..ab10a0b 100644
--- a/libcilkrts/ChangeLog
+++ b/libcilkrts/ChangeLog
@@ -1,3 +1,15 @@
+2014-08-01 Alexander Ivchenko <alexander.ivche...@intel.com>
+
+ * configure.ac: Move pthread affinity test to the place where
+ '-pthread' passed to CFLAGS. Otherwise the test always fails.
+ (XCFLAGS): New variable for correctly passing
+ '-pthread'.
+ (XLDFLAGS): New variable for passing the correct pthread lib.
+ * configure: Regenerate.
+ * Makefile.am (AM_CFLAGS): Add $XCFLAGS.
+ (AM_LDFLAGS): Add $XLDFLAGS.
+ * Makefile.in: Regenerate.
So can you confirm that you've bootstrapped this on
x86_64-unknown-linux-gnu and that there were no regressions? Also
double-check the indention in the ChangeLog entry, though it may just be
your mailer that has mucked that up.
Once the bootstrap and regression test are OK, this is OK.
jeff