From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sami Tolvanen Subject: [PATCH 13/22] scripts/mod: disable LTO for empty.c Date: Wed, 24 Jun 2020 13:31:51 -0700 Message-ID: <20200624203200.78870-14-samitolvanen@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20200624203200.78870-1-samitolvanen@google.com> Sender: linux-kbuild-owner@vger.kernel.org To: Masahiro Yamada , Will Deacon Cc: Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, Sami Tolvanen List-Id: linux-arch.vger.kernel.org With CONFIG_LTO_CLANG, clang generates LLVM IR instead of ELF object files. As empty.o is used for probing target properties, disable LTO for it to produce an object file instead. Signed-off-by: Sami Tolvanen --- scripts/mod/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index 296b6a3878b2..b6e3b40c6eeb 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 OBJECT_FILES_NON_STANDARD := y +CFLAGS_REMOVE_empty.o += $(CC_FLAGS_LTO) hostprogs := modpost mk_elfconfig always-y := $(hostprogs) empty.o -- 2.27.0.212.ge8ba1cc988-goog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406545AbgFXUdX (ORCPT ); Wed, 24 Jun 2020 16:33:23 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E4CC061573 for ; Wed, 24 Jun 2020 13:33:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id m63so3470550ybc.13 for ; Wed, 24 Jun 2020 13:33:22 -0700 (PDT) Date: Wed, 24 Jun 2020 13:31:51 -0700 In-Reply-To: <20200624203200.78870-1-samitolvanen@google.com> Message-ID: <20200624203200.78870-14-samitolvanen@google.com> Mime-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> Subject: [PATCH 13/22] scripts/mod: disable LTO for empty.c From: Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Masahiro Yamada , Will Deacon Cc: Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, Sami Tolvanen Message-ID: <20200624203151.t8DmPxQc8WpNVhJgKy3KYI5u4fRBFcxdfVAPVlqxRQk@z> With CONFIG_LTO_CLANG, clang generates LLVM IR instead of ELF object files. As empty.o is used for probing target properties, disable LTO for it to produce an object file instead. Signed-off-by: Sami Tolvanen --- scripts/mod/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index 296b6a3878b2..b6e3b40c6eeb 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 OBJECT_FILES_NON_STANDARD := y +CFLAGS_REMOVE_empty.o += $(CC_FLAGS_LTO) hostprogs := modpost mk_elfconfig always-y := $(hostprogs) empty.o -- 2.27.0.212.ge8ba1cc988-goog