From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 D78901A1E2D for ; Mon, 5 Sep 2016 07:37:56 -0700 (PDT) Received: by mail-wm0-x235.google.com with SMTP id w207so27433487wmw.1 for ; Mon, 05 Sep 2016 07:37:56 -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=+otNeUWeKyINTRB4gJ12r3P1KyIv0gIoItDiuTkTdyM=; b=c/w9MGkCM0SNmZpe1crWFvwloUi17j7w2IHh7ZO/7bcQ54s5D9VQKBdzEyGb8fJ4AS K0TtT+WnTgeLNWIZhecV/IZesgBkNJmUhJtDBBm2JIy+eCOccpwNs3RVNJdCAkccYECa MV5tSAJ49YjBEzRnYiwKcjrv9ql10sDcOEZ2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+otNeUWeKyINTRB4gJ12r3P1KyIv0gIoItDiuTkTdyM=; b=BXC8MD2qHr920NnaPs2T7SgVQs/InPF7+RIeVmq1+1xA08FRDBM/45I7NtpuIYitNi N3RtWCxqp4ir4M/Lpz2gfFHv/WIcyikq1t9qQUpHSooAuHQehMF+cJ/f7M7Rfl/4HKyY 94mizRK22ED+6+86SmZTjltbDb6xqLU1POXVnqqK+owE96Y1cRJk7mY1qNzRg7oIh8b1 l7tbp+Gf0+WjUx+hAMEyEy9QrsFPLRz9qTytBeGER+LtiN3muKEAq0RoyIECHTHhZPQq pWqUF7y4AEm+VDBA58hoDSvuXdI2d/NqmyJKjX32efk+7AojBBF13DrtSYF9BsgyH31+ 66Kg== X-Gm-Message-State: AE9vXwOfZqmfnYKcFEYZAW3etUj9oo5VdMsXTc4DKZoa9mjnf9D8DyHedcwSKIQuitM4c1SN X-Received: by 10.28.167.215 with SMTP id q206mr8528210wme.62.1473086275248; Mon, 05 Sep 2016 07:37:55 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id kk6sm25703478wjb.44.2016.09.05.07.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Sep 2016 07:37:54 -0700 (PDT) Date: Mon, 5 Sep 2016 15:37:53 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20160905143753.GB16080@bivouac.eciton.net> References: <1473079066-8225-1-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1473079066-8225-1-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH] ArmPkg/CompilerIntrinsicsLib ARM: make memset() weak again X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2016 14:37:57 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 05, 2016 at 01:37:46PM +0100, Ard Biesheuvel wrote: > After the recent update of CompilerIntrinsicsLib, our memset() is no > longer emitted as a weak symbol. On ARM, this may cause problems when > combining this library with another library that supplies memset() [e.g., > CryptoPkg/IntrinsicLib], due to the fact that the object also supplies > the __aeabi_memXXX entry points, which can only be satisfied by this > object. So make our memset() weak again, to let the other implementation > take precedence. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > > This makes ArmVirtQemu build again for ARM with SECURE_BOOT_ENABLE=TRUE > > ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c > index 3d417d797242..0d837fcecf09 100644 > --- a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c > +++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c > @@ -31,6 +31,15 @@ void *memset(void *dest, int c, size_t n); > > #ifdef __arm__ > > +// > +// Other modules (such as CryptoPkg/IntrinsicLib) may provide another > +// implementation of memset(), which may conflict with this one if this > +// object was pulled into the link due to the definitions below. So make > +// our memset() 'weak' to let the other implementation take precedence. > +// > +__attribute__((__weak__)) > +void *memset(void *dest, int c, size_t n); > + > void __aeabi_memset(void *dest, size_t n, int c) > { > __memset(dest, c, n); > -- > 2.7.4 >