From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::242; helo=mail-io0-x242.google.com; envelope-from=sigmaepsilon92@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8CA37210DF5C9 for ; Thu, 7 Jun 2018 10:02:19 -0700 (PDT) Received: by mail-io0-x242.google.com with SMTP id u4-v6so12658009iof.2 for ; Thu, 07 Jun 2018 10:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TLfjw6T/Jv7/g3cE0wgTLhkxAjR1cufpJ3I+ltmMXJs=; b=qdy1iuRjAfxZrksmM/772emvGzOY3DWMfiHbFlxGv1Ep+tLW2BoyD4XnyVhCGu2L3E wFO/kgJ36JMKq64WbNgKGd6QKgeLw50aufzBA0unD7RYomRTEazIUC5fhjydl+hO0DfR PZEhYdZeq0GjaGLNCcgygfes+tvX5Htsb9H8VVtDYntLd4WkBCwaM4MwRMv729iroI70 1YEipp5nW6Zl7aabckyCZCOCJgXc4WiGfGLIZWuS12KN+VtdDleL1UPjQCQlgEUc7hlI ZRc2Fjj3S6Jl47jmBvpRAxgAZ979e36jwJaT2tzDyUDJJFmR1SqqBNiTFY2WWbddDbpd sATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TLfjw6T/Jv7/g3cE0wgTLhkxAjR1cufpJ3I+ltmMXJs=; b=JIl3j1dVsaQiCZBTL11dN4PxK7lriTwdu2Ze6sCTpCPBhREUgO9qh6I8wzt5ZqeEeE pO1Nr00nxpAaNqJY7aEbuofTSIUqygBoQUIrcNaITXhrJD9IbkXPlZk06vyiG07vnH1X hoElfDAV/1tYccb5qSPkrQZhu90+6cXVjcT+4UEZMkdkLTSaEowHrl14CxCJqbJbvka0 5INz6D1AIs7AQa9eSzaKU3/ZrLkaVIQYzw1eAAHEVU2JAEuoe7eEtCBaPar4CTxHP9JM 9R7CVWhx9jBrEgSBr7OiwnO6puzfcoZ9+uM8fDnVczvKGrAu9bEP+qO34qETTiCAvbnx 6xqg== X-Gm-Message-State: APt69E0HfiFK2r7npADNbvJgXWZXvcaLfy9PuecxN4u/5R/s3gIr3V7V RVCLDjf758nn/20pbuZu6kmMeuJ2oqJqapFcMp0zVw== X-Google-Smtp-Source: ADUXVKKLJFbolBicQCdM0f316dnFW7vkg98GmKKmijw1ziqgwqTQ+L60h/CctWxut920hTBOB1YZK0oscQlhmq+u+sg= X-Received: by 2002:a6b:1745:: with SMTP id 66-v6mr2281263iox.154.1528390938600; Thu, 07 Jun 2018 10:02:18 -0700 (PDT) MIME-Version: 1.0 References: <20180607054720.15940-1-sigmaepsilon92@gmail.com> In-Reply-To: From: Michael Zimmermann Date: Thu, 7 Jun 2018 19:02:05 +0200 Message-ID: To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Leif Lindholm Subject: Re: [PATCH] ArmPkg/CompilerIntrinsicsLib: fix GCC8 warning for __aeabi_memcpy aliases X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 17:02:19 -0000 Content-Type: text/plain; charset="UTF-8" Hi Ard, yes that fixes the problem too and looks much better, thx! On Thu, Jun 7, 2018 at 9:05 AM Ard Biesheuvel wrote: > > On 7 June 2018 at 07:47, Michael Zimmermann wrote: > > This was the warning(shown for __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8): > > ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c:42:6: error: '__aeabi_memcpy8' alias between functions of incompatible types 'void(void > > *, const void *, size_t)' {aka 'void(void *, const void *, unsigned int)'} and 'void *(void *, const void *, size_t)' {aka 'void > > *(void *, const void *, unsigned int)'} [-Werror=attribute-alias] > > void __aeabi_memcpy8(void *dest, const void *src, size_t n); > > ^~~~~~~~~~~~~~~ > > ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c:19:7: note: aliased declaration here > > void *__memcpy(void *dest, const void *src, size_t n) > > > > The problem is the different return type(void vs void*). > > This commit adds a wrapper '__aeabi___memcpy' with a void return value. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Michael Zimmermann > > --- > > ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c | 11 ++++++++--- > > 1 file changed, 8 insertions(+), 3 deletions(-) > > > > diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c b/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c > > index a944e00b89e1..507234186fa9 100644 > > --- a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c > > +++ b/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c > > @@ -31,14 +31,19 @@ __attribute__((__alias__("__memcpy"))) > > void *memcpy(void *dest, const void *src, size_t n); > > > > #ifdef __arm__ > > +static __attribute__((__used__)) > > +void __aeabi___memcpy(void *dest, const void *src, size_t n) > > +{ > > + __memcpy(dest, src, n); > > +} > > > > -__attribute__((__alias__("__memcpy"))) > > +__attribute__((__alias__("__aeabi___memcpy"))) > > void __aeabi_memcpy(void *dest, const void *src, size_t n); > > > > -__attribute__((__alias__("__memcpy"))) > > +__attribute__((__alias__("__aeabi___memcpy"))) > > void __aeabi_memcpy4(void *dest, const void *src, size_t n); > > > > -__attribute__((__alias__("__memcpy"))) > > +__attribute__((__alias__("__aeabi___memcpy"))) > > void __aeabi_memcpy8(void *dest, const void *src, size_t n); > > > > #endif > > Thanks Michael. > > Would this fix the problem as well? > > --- a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c > +++ b/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c > @@ -16,20 +16,21 @@ > typedef __SIZE_TYPE__ size_t; > > static __attribute__((__used__)) > -void *__memcpy(void *dest, const void *src, size_t n) > +void __memcpy(void *dest, const void *src, size_t n) > { > unsigned char *d = dest; > unsigned char const *s = src; > > while (n--) > *d++ = *s++; > +} > > +void *memcpy(void *dest, const void *src, size_t n) > +{ > + __memcpy(dest, src, n); > return dest; > } > > -__attribute__((__alias__("__memcpy"))) > -void *memcpy(void *dest, const void *src, size_t n); > - > #ifdef __arm__ > > __attribute__((__alias__("__memcpy")))