Review for: [ARM] Separate EABI and GNUEABI lowering

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 21:47:22 PDT 2015


On Thu, Sep 3, 2015 at 8:17 PM, Vinicius Tinti <viniciustinti at gmail.com>
wrote:

> Hi,
>
> I have made a patch to separate the GNUEABI lowering from EABI concerning
> RTLIB.
> Before, both were handle as the same target.
>
> This patch aims to fix the following:
>
>   struct my_s {
>     unsigned long a[18];
>   };
>
>   void foo(unsigned long *t) {
>     *(struct my_s *)t = *((struct my_s *)(1UL));
>   }
>
> This code will generate a 'memcpy' call which will, on LLVM, be converted
> to
> '__aeabi_memcpy' and then '__aeabi_memcpy4'. The issue is that GCC will
> not do
> so. GCC keeps 'memcpy' as 'memcpy'.
>
> I will not argue that one is correct. Instead I just want to point out
> that as
> the target is called 'arm-linux-gnueabi' and it should IMHO behave as
> expected
> by GNU tools. Linux and Android need workarounds that can be solved with
> this
> patch:
>

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.


> * Bionic from Android wraps '__aeabi_memcpy4' to 'memcpy' [1].
> * LLVMLinux wraps it too (NOTE: patch not in mainline) [2].
>
> Please give your thoughts and suggestions.
>
> http://reviews.llvm.org/D12413
>
> [1]
> https://android.googlesource.com/platform/bionic/+/master/libc/arch-arm/bionic/__aeabi.c
> [2]
> http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob_plain;f=arch/arm/patches/eabi-arm.patch;hb=8ee017d41f46b40af20d7b7a9cc28618c9c7181c
>
> Regards,
> Vinicius
>

-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150903/54c3b5e1/attachment-0001.html>


More information about the llvm-commits mailing list