From patchwork Mon Sep 5 12:37:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 75380 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp53145qgf; Mon, 5 Sep 2016 05:37:56 -0700 (PDT) X-Received: by 10.98.68.148 with SMTP id m20mr63676561pfi.0.1473079076817; Mon, 05 Sep 2016 05:37:56 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id ih1si16424793pad.95.2016.09.05.05.37.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Sep 2016 05:37:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3D4AB1A1E2E; Mon, 5 Sep 2016 05:37:56 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 EF6CD1A1E2D for ; Mon, 5 Sep 2016 05:37:53 -0700 (PDT) Received: by mail-wm0-x236.google.com with SMTP id 1so137007531wmz.1 for ; Mon, 05 Sep 2016 05:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=2Zcxb8cKHjXQOF4cDT1zwNXTCTt+XM1Tk166KFp1Z9E=; b=RC0pCBQsSDJ2E4IIPD0fQNcdFIfboghJkhIczs/l0nNZB17Bi7LpuaTJQMoe4pHIH2 Qd3t1s82B91X+i0aKpASCYrM/rbLvb2O5FRE3NjAYg7lPeMMyqWyTnepDR6RbBuGa3C4 Vju/2bfeGAIRvQpsQgX/sJuGCLh2CXcXJEk+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2Zcxb8cKHjXQOF4cDT1zwNXTCTt+XM1Tk166KFp1Z9E=; b=fqdU7wYnZBtdXTNBPVSIUcvb2cCVC50f8XFzf+hw1IZjnioqk0q9ywsWrsaS7VsQd6 EmBE4oc5V2liaG3YHbSolXaFpWTs4bQgE0TL6aERKrFPLbIPksfztlO+QWizbFfDdQzh K5JQiq/8pcMfd+OpCIwaxg621PwWq+/8G7pAJH7fPmY11kmj/2ZiMHa3I2rlGASiIAS5 p7kIFslEPV35bkAoC+aJtADUUHs1RMBGeqbmfruzJ/ajbzyMJDf+EMHf0FENlSvgXf7z /QXMBTCmK0S+mPR1Nja8nrK0S9QsJZPIisd5VIUZcjQ2P2iCqjYMOkvZGVTE+Ttyk8m2 cjxA== X-Gm-Message-State: AE9vXwOqUjCZbujym2TBvfh61A3VqgU1BRyzzDL9vw1mRXoBg2GkGkgJbwbE8gTSJNub+vd4 X-Received: by 10.28.70.5 with SMTP id t5mr15713235wma.46.1473079071657; Mon, 05 Sep 2016 05:37:51 -0700 (PDT) Received: from localhost.localdomain ([197.130.133.164]) by smtp.gmail.com with ESMTPSA id bj8sm27505873wjc.49.2016.09.05.05.37.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Sep 2016 05:37:50 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Mon, 5 Sep 2016 13:37:46 +0100 Message-Id: <1473079066-8225-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- This makes ArmVirtQemu build again for ARM with SECURE_BOOT_ENABLE=TRUE ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm 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);