[LLVMdev] Prevent clang from replacing code with library calls

Sean Silva chisophugis at gmail.com
Thu Aug 7 15:49:53 PDT 2014


On Thu, Aug 7, 2014 at 2:49 PM, Jim Grosbach <grosbach at apple.com> wrote:

>
> > On Aug 7, 2014, at 4:12 AM, Anton Korobeynikov <anton at korobeynikov.info>
> wrote:
> >
> >> I downloaded the latest NDK (r10) and compiled with the following cmd:
> >> arm-linux-androideabi-clang myMemcpy.c -S -fno-builtin -o0
> >> It still produces assembly with a call to "memcpy". Maybe the
> -fno-builtin
> >> is broken also in the latest release.
> > It's not broken. Even freestanding implementation is supposed to
> > provide mem* functions.
> >
>
> It’s also supposed to be possible to write a memcpy() implementation in C
> without the compiler’s idiom recognizer just transforming it into a call to
> the system memcpy(). -fno-builtin is supposed to be how to do that, right?
>

IIRC -ffreestanding might be the solution.

-- Sean Silva


>
> -jim
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140807/3a7791e0/attachment.html>


More information about the llvm-dev mailing list