<div dir="ltr">On Thu, Sep 3, 2015 at 8:17 PM, Vinicius Tinti <span dir="ltr"><<a href="mailto:viniciustinti@gmail.com" target="_blank">viniciustinti@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have made a patch to separate the GNUEABI lowering from EABI concerning RTLIB.<br>
Before, both were handle as the same target.<br>
<br>
This patch aims to fix the following:<br>
<br>
  struct my_s {<br>
    unsigned long a[18];<br>
  };<br>
<br>
  void foo(unsigned long *t) {<br>
    *(struct my_s *)t = *((struct my_s *)(1UL));<br>
  }<br>
<br>
This code will generate a 'memcpy' call which will, on LLVM, be converted to<br>
'__aeabi_memcpy' and then '__aeabi_memcpy4'. The issue is that GCC will not do<br>
so. GCC keeps 'memcpy' as 'memcpy'.<br>
<br>
I will not argue that one is correct. Instead I just want to point out that as<br>
the target is called 'arm-linux-gnueabi' and it should IMHO behave as expected<br>
by GNU tools. Linux and Android need workarounds that can be solved with this<br>
patch:<br></blockquote><div><br></div><div>The GNU here doesn't refer to GNU tools, but rather to the GNU *libc*, which does provide the function.  I think that the way you state this is a bit disingenuous, while a change to the invocation of clang would be sufficient and retain the QoI in clang.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Bionic from Android wraps '__aeabi_memcpy4' to 'memcpy' [1].<br>
* LLVMLinux wraps it too (NOTE: patch not in mainline) [2].<br>
<br>
Please give your thoughts and suggestions.<br>
<br>
<a href="http://reviews.llvm.org/D12413" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12413</a><br>
<br>
[1] <a href="https://android.googlesource.com/platform/bionic/+/master/libc/arch-arm/bionic/__aeabi.c" rel="noreferrer" target="_blank">https://android.googlesource.com/platform/bionic/+/master/libc/arch-arm/bionic/__aeabi.c</a><br>
[2] <a href="http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob_plain;f=arch/arm/patches/eabi-arm.patch;hb=8ee017d41f46b40af20d7b7a9cc28618c9c7181c" rel="noreferrer" target="_blank">http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob_plain;f=arch/arm/patches/eabi-arm.patch;hb=8ee017d41f46b40af20d7b7a9cc28618c9c7181c</a><br>
<br>
Regards,<br>
Vinicius<br>
</blockquote></div><br>-- <br><div class="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>