libclc git compilation error with LLVM 5.0 git from to today

Hello Jan and Aaron,

compilation of latest libclc git with current LLVM 5.0 (fe252ffdaa62fc676b1bceaaba90652e51f07e5f) resulted in this
(LLVM git bug, missing pthread or openSUSE Tumbleweed PIE thing OpenSUSE Tumbleweed Is Now Built With PIE - Phoronix):

LINK utils/prepare-builtins
/usr/local/lib/libLLVMSupport.a(Mutex.cpp.o): In function `llvm::sys::MutexImpl::MutexImpl(bool)':
Mutex.cpp:(.text._ZN4llvm3sys9MutexImplC2Eb+0x2c): undefined reference to `pthread_mutexattr_init'
Mutex.cpp:(.text._ZN4llvm3sys9MutexImplC2Eb+0x38): undefined reference to `pthread_mutexattr_settype'
Mutex.cpp:(.text._ZN4llvm3sys9MutexImplC2Eb+0x4b): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/libLLVMSupport.a(Mutex.cpp.o): In function `llvm::sys::MutexImpl::tryacquire()':
Mutex.cpp:(.text._ZN4llvm3sys9MutexImpl10tryacquireEv+0x8): undefined reference to `pthread_mutex_trylock'
/usr/local/lib/libLLVMSupport.a(Process.cpp.o): In function `llvm::sys::Process::SafelyCloseFileDescriptor(int)':
Process.cpp:(.text._ZN4llvm3sys7Process25SafelyCloseFileDescriptorEi+0x3f): undefined reference to `pthread_sigmask'
Process.cpp:(.text._ZN4llvm3sys7Process25SafelyCloseFileDescriptorEi+0x87): undefined reference to `pthread_sigmask'
Process.cpp:(.text._ZN4llvm3sys7Process25SafelyCloseFileDescriptorEi+0xa2): undefined reference to `pthread_sigmask'
/usr/local/lib/libLLVMSupport.a(Process.cpp.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x67): undefined reference to `setupterm'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x90): undefined reference to `tigetnum'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x99): undefined reference to `set_curterm'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xa1): undefined reference to `del_curterm'
/usr/local/lib/libLLVMSupport.a(RWMutex.cpp.o): In function `llvm::sys::RWMutexImpl::RWMutexImpl()':
RWMutex.cpp:(.text._ZN4llvm3sys11RWMutexImplC2Ev+0x23): undefined reference to `pthread_rwlock_init'
/usr/local/lib/libLLVMSupport.a(RWMutex.cpp.o): In function `llvm::sys::RWMutexImpl::~RWMutexImpl()':
RWMutex.cpp:(.text._ZN4llvm3sys11RWMutexImplD2Ev+0x8): undefined reference to `pthread_rwlock_destroy'
/usr/local/lib/libLLVMSupport.a(RWMutex.cpp.o): In function `llvm::sys::RWMutexImpl::reader_acquire()':
RWMutex.cpp:(.text._ZN4llvm3sys11RWMutexImpl14reader_acquireEv+0x8): undefined reference to `pthread_rwlock_rdlock'
/usr/local/lib/libLLVMSupport.a(RWMutex.cpp.o): In function `llvm::sys::RWMutexImpl::reader_release()':
RWMutex.cpp:(.text._ZN4llvm3sys11RWMutexImpl14reader_releaseEv+0x8): undefined reference to `pthread_rwlock_unlock'
/usr/local/lib/libLLVMSupport.a(RWMutex.cpp.o): In function `llvm::sys::RWMutexImpl::writer_acquire()':
RWMutex.cpp:(.text._ZN4llvm3sys11RWMutexImpl14writer_acquireEv+0x8): undefined reference to `pthread_rwlock_wrlock'
/usr/local/lib/libLLVMSupport.a(RWMutex.cpp.o): In function `llvm::sys::RWMutexImpl::writer_release()':
RWMutex.cpp:(.text._ZN4llvm3sys11RWMutexImpl14writer_releaseEv+0x8): undefined reference to `pthread_rwlock_unlock'
/usr/local/lib/libLLVMSupport.a(Threading.cpp.o): In function `llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)':
Threading.cpp:(.text._ZN4llvm22llvm_execute_on_threadEPFvPvES0_j+0x3c): undefined reference to `pthread_create'
Threading.cpp:(.text._ZN4llvm22llvm_execute_on_threadEPFvPvES0_j+0x4c): undefined reference to `pthread_join'
Threading.cpp:(.text._ZN4llvm22llvm_execute_on_threadEPFvPvES0_j+0x66): undefined reference to `pthread_attr_setstacksize'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:14: utils/prepare-builtins] Fehler 1

I’m headed back from a long weekend with the family. I’ll see if I can find some time tonight to look at this if no one else gets to it before then.

–Aaron

Hello Aaron,

NO action needed from your site,
all fine after update to LLVM 5.0 git commit
7c44c2a308cdb9db4b11c5fef0bebe61f98a9069
at least.
All 'opencl-example' pass, as 'always'. :wink:

So it was LLVM git thing NOT libclc.

Cheers,
Dieter