From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 19/34] xen/arm: Provide eabi wrapper for __aeabi_mem* functions Date: Wed, 26 Mar 2014 15:46:48 +0000 Message-ID: <5332F668.5060002@linaro.org> References: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> <1395766541-23979-20-git-send-email-julien.grall@linaro.org> <1395768302.22808.5.camel@kazak.uk.xensource.com> <5331C725.10003@linaro.org> <1395830364.22808.43.camel@kazak.uk.xensource.com> <5332F47F.3030000@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSq2h-0003RL-8F for xen-devel@lists.xenproject.org; Wed, 26 Mar 2014 15:47:03 +0000 Received: by mail-bk0-f44.google.com with SMTP id mz13so597826bkb.17 for ; Wed, 26 Mar 2014 08:47:00 -0700 (PDT) In-Reply-To: <5332F47F.3030000@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 03/26/2014 03:38 PM, Julien Grall wrote: > On 03/26/2014 10:39 AM, Ian Campbell wrote: >> On Tue, 2014-03-25 at 18:12 +0000, Julien Grall wrote: >>> Hi Ian, >>> >>> On 03/25/2014 05:25 PM, Ian Campbell wrote: >>>> On Tue, 2014-03-25 at 16:55 +0000, Julien Grall wrote: >>>>> Clang doesn't provide function __aebai_mem*, implement generically as a wrapper >>>>> for mem* function provided by Xen. >>>> >>>> Where are the references to these functions coming from if not from the >>>> compiler? >>> >>> Theses functions are called by the code generated by the compiler. >> >> And who normally provides them when building with clang? Some sort of >> libclang I guess? > > I've tried to compile a same compilation unit with gcc and clang. gcc is > inlining the call to __aebi_*. See below: I've just noticed it also calls memset/memcpy directly without the prefix __aebi_. > Clang assembly: > 000002b8 : > 2b8: e92d4800 push {fp, lr} > 2bc: e1a0b00d mov fp, sp > 2c0: e3a01024 mov r1, #36 ; 0x24 > 2c4: e3a02000 mov r2, #0 > 2c8: ebfffffe bl 0 <__aeabi_memset> > 2cc: e8bd8800 pop {fp, pc} > > GCC assembly: > > 00000378 : > 378: e52db004 push {fp} ; (str fp, [sp, #-4]!) > 37c: e28db000 add fp, sp, #0 > 380: e3a02000 mov r2, #0 > 384: e1a03000 mov r3, r0 > 388: e4832004 str r2, [r3], #4 > 38c: e5802004 str r2, [r0, #4] > 390: e2833004 add r3, r3, #4 > 394: e4832004 str r2, [r3], #4 > 398: e4832004 str r2, [r3], #4 > 39c: e4832004 str r2, [r3], #4 > 3a0: e4832004 str r2, [r3], #4 > 3a4: e4832004 str r2, [r3], #4 > 3a8: e4832004 str r2, [r3], #4 > 3ac: e5832000 str r2, [r3] > 3b0: e24bd000 sub sp, fp, #0 > 3b4: e49db004 pop {fp} ; (ldr fp, [sp], #4) > 3b8: e12fff1e bx lr > > Regards, > -- Julien Grall