From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Ard Biesheuvel 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: [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 12:37:54 -0000 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(+) 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