From patchwork Thu Nov 29 02:58:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1005003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="twyT0uTk"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="UQ15fJ2a"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4352Lp4bSsz9s47 for ; Thu, 29 Nov 2018 14:00:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=o/ubybCea4WUPyiHdshu7XVXFAh3z/1uLcXaAM4USYU=; b=twy T0uTkTKlCjvwbihKqAHxem2L73tSFf4ZjxrZwlMWR7IVho8/zkfG7hACqVkjiXpnEspnSi83VMq+c UA0nqxFL1GKHsMVUgQrbhUE62fUD5pMakZCEm3bgycLFMNQYqSe1zrnNC2yn7K4+sSkedHQI3AFv/ yAwidP1ZDpR/uih8l7KcWTMXQe9u5jcESN0D1cxwhcWGohwl08cb/hFDZbEUE3Yqv9Cesx7Kk/xIE DffasDKc4iLRXFDcEFMF4gwQHg/NFnGU9RJi7MKJhpITFp68TFZxIHBlyMkJk349mBTfm97i0PRye mOXIgbnAdHqhi3XHgnoIJKmoqpFi4QA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSCYR-0001IB-IE; Thu, 29 Nov 2018 02:59:51 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSCYN-0001HT-R0 for linux-um@lists.infradead.org; Thu, 29 Nov 2018 02:59:49 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id wAT2x3qD006619; Thu, 29 Nov 2018 11:59:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com wAT2x3qD006619 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1543460344; bh=Zijhk3B0tO6PDmGT/Ead+AaJZcHca8AmeJMyJrYLKkM=; h=From:To:Cc:Subject:Date:From; b=UQ15fJ2a/SlBGXehlxqmZZZzb8AAhbJUuEzwaKq2NUUNdKPKrJygwPKElUpz4sSqm 4JHTiLFq6hl0CKH90ad4a3aEjeHeVYUdgS41ble5b6w6s260mNmB1rbNf2vdnEr+u7 ORCnNpT1iAtxZt4o71BNbwn2RzFTnd+n6e/P8TZV02v5JtTKEQ3765UkPWn84mZgCd m28oy3cVVqqq1jyUTifjPRCN1bTlS5acJMUf2vifnkb8AZrMA5fCyU3//iW7DvGx1Y aJVJ07/TLTTXmfl4KMdBylImy2XVJm0AAsy9MC9pYpJ9StOhi82E//WmCqwkSCR+69 C6lSA8ChPOgjw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Subject: [PATCH] kbuild: fix UML build error with CONFIG_GCC_PLUGINS Date: Thu, 29 Nov 2018 11:58:50 +0900 Message-Id: <1543460330-2219-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_185948_091975_91E20D27 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.131.2.76 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , Kees Cook , Richard Weinberger , Jeff Dike , x86@kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Masahiro Yamada , Emese Revfy , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar MIME-Version: 1.0 Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org UML fails to build with CONFIG_GCC_PLUGINS=y. $ make -s ARCH=um mrproper $ make -s ARCH=um allmodconfig $ make ARCH=um UPD include/generated/uapi/linux/version.h WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h WRAP arch/x86/include/generated/uapi/asm/poll.h WRAP arch/x86/include/generated/asm/dma-contiguous.h WRAP arch/x86/include/generated/asm/early_ioremap.h WRAP arch/x86/include/generated/asm/export.h WRAP arch/x86/include/generated/asm/mcs_spinlock.h WRAP arch/x86/include/generated/asm/mm-arch-hooks.h SYSTBL arch/x86/include/generated/asm/syscalls_32.h SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h SYSTBL arch/x86/include/generated/asm/syscalls_64.h SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h SYSHDR arch/x86/include/generated/uapi/asm/unistd_64.h SYSHDR arch/x86/include/generated/uapi/asm/unistd_x32.h HOSTCC scripts/unifdef CC arch/x86/um/user-offsets.s cc1: error: cannot load plugin ./scripts/gcc-plugins/cyc_complexity_plugin.so ./scripts/gcc-plugins/cyc_complexity_plugin.so: cannot open shared object file: No such file or directory cc1: error: cannot load plugin ./scripts/gcc-plugins/structleak_plugin.so ./scripts/gcc-plugins/structleak_plugin.so: cannot open shared object file: No such file or directory cc1: error: cannot load plugin ./scripts/gcc-plugins/latent_entropy_plugin.so ./scripts/gcc-plugins/latent_entropy_plugin.so: cannot open shared object file: No such file or directory cc1: error: cannot load plugin ./scripts/gcc-plugins/randomize_layout_plugin.so ./scripts/gcc-plugins/randomize_layout_plugin.so: cannot open shared object file: No such file or directory make[1]: *** [scripts/Makefile.build;119: arch/x86/um/user-offsets.s] Error 1 make: *** [arch/um/Makefile;152: arch/x86/um/user-offsets.s] Error 2 Change the order of the preparation stage (with cleanups) to make sure gcc-plugins is built before descending to arch/x86/um/. Reported-by: kbuild test robot Fixes: 6b90bd4ba40b ("GCC plugin infrastructure") Signed-off-by: Masahiro Yamada --- I will pick up this to kbuild tree to avoid conflicts. Ack from UML people is appreciated, though. Makefile | 4 ++-- arch/um/Makefile | 24 ++---------------------- arch/x86/um/Makefile | 4 +++- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 0ce4e29..a066dab 100644 --- a/Makefile +++ b/Makefile @@ -1106,9 +1106,9 @@ prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h macroprepare: prepare1 archmacros -archprepare: archheaders archscripts macroprepare scripts_basic +archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins -prepare0: archprepare gcc-plugins +prepare0: archprepare $(Q)$(MAKE) $(build)=. # All the preparing.. diff --git a/arch/um/Makefile b/arch/um/Makefile index ab1066c..c080359 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -116,7 +116,8 @@ endef archheaders: $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) asm-generic archheaders -archprepare: include/generated/user_constants.h +archprepare: + $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib $(call cc-option, -no-pie) @@ -146,25 +147,4 @@ archclean: @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ -o -name '*.gcov' \) -type f -print | xargs rm -f -# Generated files - -$(HOST_DIR)/um/user-offsets.s: __headers FORCE - $(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@ - -define filechk_gen-asm-offsets - (set -e; \ - echo "/*"; \ - echo " * DO NOT MODIFY."; \ - echo " *"; \ - echo " * This file was generated by arch/$(ARCH)/Makefile"; \ - echo " *"; \ - echo " */"; \ - echo ""; \ - sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \ - echo ""; ) -endef - -include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s - $(call filechk,gen-asm-offsets) - export HEADER_ARCH SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index c2d3d7c..1792464 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile @@ -36,10 +36,12 @@ subarch-$(CONFIG_MODULES) += ../kernel/module.o USER_OBJS := bugs_$(BITS).o ptrace_user.o fault.o -extra-y += user-offsets.s $(obj)/user-offsets.s: c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \ -Iarch/x86/include/generated +include/generated/user_constants.h: $(obj)/user-offsets.s + $(call filechk,offsets,__USER_CONSTANT_H__) + UNPROFILE_OBJS := stub_segv.o CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)