[cfe-dev] Implementing "external" built-in functions

Chris Lattner clattner at apple.com
Fri Jul 19 09:04:27 PDT 2013


Have you tried -fno-builtin?

-Chris

On Jul 19, 2013, at 3:04 AM, Emmanuel Blot <eblot.ml at gmail.com> wrote:

> Hi,
> 
> clang emits calls to external functions for built-in functions it
> cannot implement, the way GCC does:
> 
> From GCC doc about built-in functions for memory accesses:
> "Not all operations are supported by all target processors. If a
> particular operation cannot be implemented on the target processor, a
> warning will be generated and a call an external function will be
> generated. The external function will carry the same name as the
> builtin, with an additional suffix `_n' where n is the size of the
> data type."
> 
> Is is possible to implement those "external" built-in functions and
> compile them with clang? The "problem" is that clang recognizes their
> signature, and emit an error, such as:
> 
> error: definition of builtin function
>   '__sync_fetch_and_and_4'
> 
> I'm unable to find a clang front-end option switch to disable this behavior.
> What is the recommended way to compile such a built-in function?
> 
> I'm looking for a way to compile those functions in a dedicated
> library, outside the clang build tree.
> 
> Thanks,
> Emmanuel.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list