[LLVMdev] Preventing C backend from using gcc builtin functions

Eric Christopher echristo at apple.com
Thu Feb 10 01:09:45 PST 2011


On Feb 10, 2011, at 12:16 AM, Anton Korobeynikov wrote:

>> Working with llvm 2.8 installed on Mac OS, when using the llvm-gcc frontend
>> and the C backend I see it converting regular (non-checking) memcpy and
>> memset calls to __memset_chk and __memcpy_chk already at the IR stage.
> Most probably these are changed due to defines in the system headers,
> so, compiler cannot do anything about this.
> You can hack on your system headers though.
> 
>> In a similar manner, llvm.objectsize.* calls are replaced with
>> __builtin_object_size calls, another gcc builtin function.
> What should be used instead?

For these two sets of things in particular you can pass -D_FORTIFY_SOURCE=0 on your command line.

In general, you probably don't want to though.

-eric



More information about the llvm-dev mailing list