From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=R+h7c3wt; spf=pass (domain: linaro.org, ip: 209.85.221.66, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by groups.io with SMTP; Tue, 07 May 2019 09:52:54 -0700 Received: by mail-wr1-f66.google.com with SMTP id r4so8034775wro.10 for ; Tue, 07 May 2019 09:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Qg+J3aY941PPewoQ+JHnJqs4QJNOOM2ehcTdJvx3LvM=; b=R+h7c3wti8wyRIhS3gVyEPl0hvDko31CQ0czqfuSQuMIhvBNCJOXBT2RFqb46V41r8 7SmyQD4iin5n/oegSDCU5jys2KxaFL1IiZ7DvsvxK8b/lNJdeeYOepMq50VUA7o2/5qZ xjLBMRsD4fM9o3D0edIoohumORhbWQUrJWHymPcNNS67/nP00+C/DGuA8iNHnA9K/seZ ko7KhVFPT/ADC0Q7sjBfF52pzpC1p25ZStUuVkxioJ+9/oyxK58sPvNna1ggMw1dy5Ui XkQdFlSmoPeWW2h8nvytcqN5tNApV6UFpvrfqFul1I43lc8IC1XmX1JNEaHSO3um9wKy CoUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Qg+J3aY941PPewoQ+JHnJqs4QJNOOM2ehcTdJvx3LvM=; b=NZzkAJZ0yXRiN4ehYvLDXLQqVNQ54UHKVqf9OaHq2uhDOAlHz+EMIrTMvmI8wVWxSL lNeTSwlNyGvrFABLZs7ioq2G4hTqNT813BblvFzc/phFK2ApjgLU0lVvTJuYwx+FmZyT 7AmG/NQKVq43jHDmvRr8DPWVy0eH/TL9EZYS6kXzZPjpi3LajvFiuqnQPIHMzALiicsY rjcPinsBDqL/nM0UBiMyHVGCJSY8dTk4VFPFMWYRxX5egSmycODkOuXeU4iqVbGJhr4/ JA/SxdUFkSu+bpdVv5wM5P/MUDX0Vu/CoPGMeXbL8LK83lwQ4eLxra9ft/Y+kyih8Pe6 7PDA== X-Gm-Message-State: APjAAAWkqx97x/4aEZ1Vnk5+ZGNY5agmDu0uDSSM2Y48TvI5dhrZ6lEo OVY838/TYvQzsA5TfgOWzABTGw== X-Google-Smtp-Source: APXvYqyuaiz61QvcIBX9fHtze3Tu4q67qP4sEfhIluHfvzgtfumsmploY5EewB4pQ6RDnd/Ml8xQMQ== X-Received: by 2002:adf:90ef:: with SMTP id i102mr22005717wri.133.1557247972918; Tue, 07 May 2019 09:52:52 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i17sm14280266wmb.0.2019.05.07.09.52.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 May 2019 09:52:52 -0700 (PDT) Date: Tue, 7 May 2019 17:52:50 +0100 From: "Leif Lindholm" To: Pete Batard Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org Subject: Re: [PATCH 1/1] ArmPkg/CompilerIntrinsicsLib: Add lasr assembly source for gcc/arm Message-ID: <20190507165250.gj6tzqv25dl7wsfc@bivouac.eciton.net> References: <20190507155726.1132-1-pete@akeo.ie> MIME-Version: 1.0 In-Reply-To: <20190507155726.1132-1-pete@akeo.ie> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. 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. 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 # #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 >