From patchwork Fri May 8 18:01:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 206351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBAAEC47255 for ; Fri, 8 May 2020 18:03:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F619218AC for ; Fri, 8 May 2020 18:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588960980; bh=0UX/KE5NPn6JSiA254bGg/BusFMtpcXn/r1pNYgqK6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lBj+cxLPCjtet622Y0u8Yz181aHja/xDKRYGF8MI9ZMiibXb/RsFgGdlEjdNRcQWy UgKSq/HoPK5syNvBw787y3FXJJXAqCzg1aS68HJt1QbaEQzx/ZtpKIIlhkrTIAvQVJ oWMaVHeFfGewa20AB1UvSB+/wjuvU3JnUKJ64NiY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727992AbgEHSC4 (ORCPT ); Fri, 8 May 2020 14:02:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:48430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbgEHSCz (ORCPT ); Fri, 8 May 2020 14:02:55 -0400 Received: from e123331-lin.nice.arm.com (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr [109.210.65.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 761DE24972; Fri, 8 May 2020 18:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588960975; bh=0UX/KE5NPn6JSiA254bGg/BusFMtpcXn/r1pNYgqK6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IXM4t75JqlaHiuFtBGFnYCJhAOG3cXnRftl3lC0d1wkSrTcSK1NPlvTuTP6RuRoKx PoUquoGe81LiZsJai7SUnr3VcKhV8MsnyLAeew1pk1XOHZRmiO940szHkL7uqb0m6X DE2lNg8X5w/xStFsNyV5uF+VfuiBSVBgaommgppE= From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Arnd Bergmann , Arvind Sankar , Guenter Roeck , Joe Perches , Nick Desaulniers , Peter Collingbourne , Sami Tolvanen Subject: [PATCH 13/15] efi/libstub/x86: Work around LLVM ELF quirk build regression Date: Fri, 8 May 2020 20:01:55 +0200 Message-Id: <20200508180157.1816-14-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508180157.1816-1-ardb@kernel.org> References: <20200508180157.1816-1-ardb@kernel.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org When building the x86 EFI stub with Clang, the libstub Makefile rules that manipulate the ELF object files may throw an error like: STUBCPY drivers/firmware/efi/libstub/efi-stub-helper.stub.o strip: drivers/firmware/efi/libstub/efi-stub-helper.stub.o: Failed to find link section for section 10 objcopy: drivers/firmware/efi/libstub/efi-stub-helper.stub.o: Failed to find link section for section 10 This is the result of a LLVM feature [0] where symbol references are stored in a LLVM specific .llvm_addrsig section in a non-transparent way, causing generic ELF tools such as strip or objcopy to choke on them. So force the compiler not to emit these sections, by passing the appropriate command line option. [0] https://sourceware.org/bugzilla/show_bug.cgi?id=23817 Cc: Nick Desaulniers Cc: Peter Collingbourne Cc: Sami Tolvanen Reported-by: Arnd Bergmann Suggested-by: Fangrui Song Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 8d246b51bd49..e5a49dc8e9bc 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -30,6 +30,7 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ -D__NO_FORTIFY \ $(call cc-option,-ffreestanding) \ $(call cc-option,-fno-stack-protector) \ + $(call cc-option,-fno-addrsig) \ -D__DISABLE_EXPORTS GCOV_PROFILE := n