<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jun 9, 2013, at 5:15 PM, Francois Pichet <<a href="mailto:pichet2000@gmail.com">pichet2000@gmail.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div>Hi, I would like to propose this patch to makes it possible to compile any builtin if -fno-builtin is passed.</div><div><br></div>Here is the problem I am trying to get around.<div><br></div><div>I am working on a out-of-tree target where atomic operations are expanded to function calls.</div>
<div>for example:</div><div>  setOperationAction(ISD::ATOMIC_SWAP,  MVT::i32, Expand);</div><div><br></div><div><br></div><div>The backend will replace some atomic operations when compiling libc++ with function calls. Now if I try to actually compile the function calls with clang I'll get errors like:</div>
<div>       definition of builtin function '__sync_lock_test_and_set_4'<br></div><div><br></div><div>Just as if I was trying to compile a file similar to <a href="http://www.opensource.apple.com/source/Libc/Libc-583/arm/sys/gcc_atomic.c">http://www.opensource.apple.com/source/Libc/Libc-583/arm/sys/gcc_atomic.c</a> with clang. </div>
<div><br></div><div>Any objection? Or any possible workaround?<br></div></div></blockquote><div><br></div></div>Should we even be recognizing this as a builtin under -fno-builtin?<div><br></div><div>John.</div></body></html>