From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22f; helo=mail-wm0-x22f.google.com; envelope-from=sigmaepsilon92@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 33B842114AD1D for ; Wed, 6 Jun 2018 22:47:23 -0700 (PDT) Received: by mail-wm0-x22f.google.com with SMTP id r125-v6so16082988wmg.2 for ; Wed, 06 Jun 2018 22:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ItjAc85DxRitV3OzCM2YJsBB3p4fL9r0LHMCfst7Wok=; b=lmyjsC/tZoNoM/Ox2El5h/mJt6iLxoe4ypfUV8i6APC7a54+xezi/4vbctBEqpt9/j A9RJ+H3Qh7aJYEjPTB21Y8MMcq473YNlm3jR/VCRKLhAvJKi3ZgVCaM4RjcEQQGWajCG CQhlc/PUyRL1sn4FI5E4W3o/Ci0suBHefgg1I+lTH2vzIjVWBtHS17tVL2ScJgLWpN1E Fv9/ZvadoYIGhZojgNN5CH4Sbx5KaleuHz0xgX5c8uHGfcQdYcp216x0C0VpRfTiOfYc 1vifbTdwnVwMff7A+iWfZCV4oJfG01K84L6d7CJIOPAx3vnyKf2SgYi0+2GAWkYhshJN 3cyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ItjAc85DxRitV3OzCM2YJsBB3p4fL9r0LHMCfst7Wok=; b=tiNG6IQk2ctPLnyJYHPYVzadI01uG++SQqT3/bHg2JMT0NNdFUkamk5ibtTbVBY+bR whoxmxiBlqkxxIf3LG107gCR3x9mA3Y0QA+wG/4f3zY9N8IQ8BNysIJoFQaalbo+eIli tYee3PVdewSfpb93cZkTSmm9uF2zkXaRvJgPyPcFQA7SnT5uYJe4TYnzjGo6BT0Q2mc1 tsiUwsZgiQ2yqtWatedBtYUp1+6IiTDbzYUXPoy3k/pvK/1YiMehmnuXt3WI6QNkYkJU b4+KPW5Osdanx3tQLomV6CzLe5gBqqLlZBCIGP9VOPNEHfuLxznRQqAcCa9J5lJd1K3h Y/8w== X-Gm-Message-State: APt69E0jthslNuwc89GeL25a+2croTVxYgqpxBAqR9HpBGiBEnJ78/at lwOWZ4Ku5rmoPonPKRRTftQL0fkY X-Google-Smtp-Source: ADUXVKJl4hewLfJhoyk4rJQlanJHWmzWNix8CWy17aGAD0ui5b3Cod/zy/V2/Y+/pWOUIxd++chH+Q== X-Received: by 2002:a1c:4787:: with SMTP id m7-v6mr550129wmi.92.1528350441424; Wed, 06 Jun 2018 22:47:21 -0700 (PDT) Received: from m1cha-NB.localdomain ([2a02:908:5a3:da80:7a8d:2699:26c0:ba14]) by smtp.gmail.com with ESMTPSA id e2-v6sm12032217wro.97.2018.06.06.22.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 22:47:20 -0700 (PDT) From: Michael Zimmermann To: edk2-devel@lists.01.org Cc: Leif Lindholm , Ard Biesheuvel Date: Thu, 7 Jun 2018 07:47:20 +0200 Message-Id: <20180607054720.15940-1-sigmaepsilon92@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [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 05:47:23 -0000 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 -- 2.17.1