I get the following error while building compiler-rt:
/slowfs/msret_s1_us03/ajost/src/llvm-3.3.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc:315:22: error: no matching function for call to ‘clone’
pid_t tracer_pid = clone(TracerThread, tracer_stack.Bottom(),
/usr/include/bits/sched.h:71:12: note: candidate function not viable: requires 4 arguments, but 7 were provided
extern int clone (int (*__fn) (void *__arg), void *__child_stack,
Inside sched.h, clone is indeed declared with four arguments, but, interestingly, the man page for clone provides this prototype:
int clone(int (*fn)(void *), void *child_stack,
int flags, void *arg, …
/* pid_t *pid, struct user_desc *tls, pid_t *ctid */ );
I’m running RedHat EL 2.6.9-89.ELlargesmp without root privileges.
Is this a bug in LLVM? Do I just have an old version of clone that’s not supported by LLVM? I can try just removing the last three arguments from the compiler-rt source, but is that the best solution? If someone can point out a clean way to fix this, then I don’t mind trying to contribute a patch (I would need to learn how).
Also, is this something that autoconf should have detected? What should it have done about it?