From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=OWAF6gXW; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.208.67, mailfrom: pete@akeo.ie) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by groups.io with SMTP; Tue, 07 May 2019 10:49:02 -0700 Received: by mail-ed1-f67.google.com with SMTP id b8so19519481edm.11 for ; Tue, 07 May 2019 10:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hIf4qB1YLTrwTzbJpO1/Fv38D7MlGxCkdYZ91oId+Dw=; b=OWAF6gXW+KIx2EGKUrHvglHu+GryDzbDtYSUpBFOzD4cso+Qn70dhGA5nVT2XU0Kcm MX2vYEJh9F0u4j+5fJDO2KGSPFT/Nsr8dBrI+WRyLEjr8nDuSoEoUQajBR7kgm9cL59u 55TMMLF8WH96uFOhGtjwWnNa+Xem/uNTfsggGEPKYbX0n3J/8VeO7z91Fpw18w3DAFxp RlAHWowLR1ya5VFt/kIH6BgL9TIADdqAdC1KY4Z+XA+STzIRWXij4RRvQ/jm4Bx7SCoo l/sh/S3HRzvf+wgwNKHyfL/QysOqaTwBdv68rrwT9L0vE1FryHZEjHXukCPEtUMRzl+n vPdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hIf4qB1YLTrwTzbJpO1/Fv38D7MlGxCkdYZ91oId+Dw=; b=peGnoN0Da1L62KWFA4D+63TvaK+qW9Nny6GwrXn1snPljv7YNx6pvlYmjTLNCRYz/f fefNRFi6FXr5sWAISi2oPP1kNUK0+bqkwN6oSSmJiiT9QEvrBkMroDsdQ33tJwLUz9y/ Axj68cgIxD+ayyGSMzX4QXjCdnzpHBZ6aLCu8pgmTXZHWEF2UiOFTTeJaHUJGIt1aADi wOtDvG0kJ75KyenjACeL3MINWasolAlyCNKvc4YhRK5z24aPVJugyM6TrYkfT2+3d+sH Lvt0juCCAGTtF/hN8gxaWopZy+mngRkE3sH00E2Uied+z4YqErW55UDxGIGknlQ+4iyE LqwA== X-Gm-Message-State: APjAAAUIfmhMXyCmL7sK3+ou4Nqt8i5VHQG1mCCC+OE2B0bOznopbSFF PiYbJHGiTRVgTwwztV29xrQm/Q== X-Google-Smtp-Source: APXvYqwoib1XJ/cqSU5/GOiZUdBo/B/yj39LjcL0rMVkDbAMATsvCK+FqZO7ng98PZLJdsk4wWBoqA== X-Received: by 2002:a50:bae4:: with SMTP id x91mr27675431ede.76.1557251340446; Tue, 07 May 2019 10:49:00 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.71.1]) by smtp.googlemail.com with ESMTPSA id v26sm1509253eju.42.2019.05.07.10.48.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 10:48:59 -0700 (PDT) Subject: Re: [PATCH 1/1] ArmPkg/CompilerIntrinsicsLib: Add lasr assembly source for gcc/arm To: Leif Lindholm Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org References: <20190507155726.1132-1-pete@akeo.ie> <20190507165250.gj6tzqv25dl7wsfc@bivouac.eciton.net> From: "Pete Batard" Message-ID: <4f615751-9487-f38b-acb2-257e96d808c3@akeo.ie> Date: Tue, 7 May 2019 18:48:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190507165250.gj6tzqv25dl7wsfc@bivouac.eciton.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Hi Leif, On 2019.05.07 17:52, Leif Lindholm wrote: > On Tue, May 07, 2019 at 04:57:26PM +0100, Pete Batard wrote: >> While compiling drivers or applications on Debian 9.8, using the native >> gcc 6.3.0 ARM compiler, one may run into the following build failure: >> >> "undefined reference to `__aeabi_lasr'" >> >> This patch adds the missing definition, through a port of the existing >> RVCT lasr.asm source. > > Ugh. Here's a module that could do with a bit of love. > ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm, > ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm and > ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm > also all miss .S versions. Well, I would assume the switch.asm counterparts are provided in the various switch##.S. On the other hand, since I'm half expecting to run into undefined refs with regards to __aeabi_uread# and __aeabi_uwrite# sooner rather than later, I will take a stab at uread/uwrite. > And then there is an ominous comment in the .inf > "# Move .c to .s to work around LLVM issues" > and it appears all of the .c files are actually unused. Okay. Unless someone objects, I'll remove these unused files as part of a v2 proposal. > I'm not going to try to make you fix those too, but if you're feeling > charitable... > > One comment below. > >> CC: Ard Biesheuvel >> CC: Leif Lindholm >> Signed-off-by: Pete Batard >> --- >> ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S | 22 ++++++++++++++++++++ >> ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf | 1 + >> 2 files changed, 23 insertions(+) >> >> diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S >> new file mode 100644 >> index 000000000000..9ded045b8bc4 >> --- /dev/null >> +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S >> @@ -0,0 +1,22 @@ >> +#------------------------------------------------------------------------------ >> +# >> +# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
>> +# >> +# SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +#------------------------------------------------------------------------------ >> + >> +#include >> + > > Could you add a "prototype" here? > The one in the original is nonsense, but > something like Will do that too. Regards, /Pete > > # > #INT64 > #EFIAPI > #__aeabi_lasr ( > # IN INT64 Value, > # IN INT32 Shift > # ); > # > > ? > > / > Leif > >> +ASM_FUNC(__aeabi_lasr) >> + subs r3,r2,#0x20 >> + bpl L_Test >> + rsb r3,r2,#0x20 >> + lsr r0,r0,r2 >> + orr r0,r0,r1,LSL r3 >> + asr r1,r1,r2 >> + bx lr >> +L_Test: >> + asr r0,r1,r3 >> + asr r1,r1,#31 >> + bx lr >> diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> index 0d5634959993..7cb8f194f210 100644 >> --- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> +++ b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> @@ -90,6 +90,7 @@ [Sources.ARM] >> Arm/uldiv.S | GCC >> Arm/ldivmod.S | GCC >> >> + Arm/lasr.S | GCC >> Arm/llsr.S | GCC >> Arm/llsl.S | GCC >> >> -- >> 2.21.0.windows.1 >>