[LLVMdev] Status of LLVM's atomic intrinsics

Jon Harrop jon at ffconsultancy.com
Wed Mar 18 20:00:14 PDT 2009


On Wednesday 18 March 2009 18:59:04 Luke Dalessandro wrote:
> Jon Harrop wrote:
> > $ llvm-g++ -O3 -lpthread waitfree.c -o waitfree
> > /tmp/cc6t7jaO.o: In function `inc_count(void*)':
> > (.text+0x2ee): undefined reference to `__sync_add_and_fetch_4'
> > collect2: ld returned 1 exit status
>
> This probably means that you're target triple starts with i386, where
> __sync instructions aren't supported, possibly reconfiguring llvm-g++
> explicitly with i686 (if that's what you have) will fix your problem.
> This should prevent the builtins from leaking through the front end (I
> think... it's also possible there just isn't anything mapped to
> __sync_add_and_fetch_4 in Intrinsics.td).

That fixed it, thanks!

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e



More information about the llvm-dev mailing list