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: 152357 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1869840ljp; Wed, 28 Nov 2018 19:01:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/XVyNkeMF4FLF1HwGOS9QH+SoDGV4eBJVnEnPncq5kIg2Y/H2IIWzMdXqribyzanPjTuzg9 X-Received: by 2002:a63:441e:: with SMTP id r30mr35863181pga.128.1543460487317; Wed, 28 Nov 2018 19:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543460487; cv=none; d=google.com; s=arc-20160816; b=h70++3ZpzsyDqytaJUmwE4l6VtrDJajfdyk+RDI9ZhUg6nkfPQmTBPu3w3v5rbHz7O 6S70nPG+paUGlfWpjIW3K7ZGtkD/n8ndE47EuKSQ/L65UAfDcRkyHtzfsW1+3W/5JKXV 2qn3c2VKN5hRHtc69x9hfUpzN8feSeFVQx/Z0Fg3jDQ1ZXtGBUI10LNCtTAF7txDDDaW pcWpUmaAr4W2g8wHX6vD2UumMLqgkArTvIEtPJCYtxTRgnAbxAOUvXx0gjikf6J1K6M7 mc25ECUQJ6OoJMxYemTcintgrW3sYrNcrpN2hrqJ8EfzH5el3ijEaXfDnzwf8VFNt3t9 Dxqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=Zijhk3B0tO6PDmGT/Ead+AaJZcHca8AmeJMyJrYLKkM=; b=oKy8psXBIqiEJgcTnJxqK8R31PzJbbf18MsmIgmG6tSE0/HbEjIaVgXptlS/VIzeQT Oib/+fV2n9DSxPHlL9wrDZiTLFlM+AYoHAPUJe4Auz/+F9kc/YHuB0DTz7QqbbIGjVDc X7PFWU4rm4T1H40DWlJ4jxwTlOY0yFb1AWvOSwUNDaHUQnPiJNd5FaZlCE+9i5wwvdLd 5oeE+WuoXv0X7cuhW+QwzaAvUp6I1wIz/C5O2k7UFs8LaVmxV65/vzRfeZS2JBcl1wWE bKH6h6PjIdd1jEPMYjatAec2YKP+RNOtIPKLS3Fdr8AK8y6czx5BzYiReUmTFO5ugw1f BXYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=UQ15fJ2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d185-v6si594136pfc.256.2018.11.28.19.01.26; Wed, 28 Nov 2018 19:01:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=UQ15fJ2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727514AbeK2OFO (ORCPT + 32 others); Thu, 29 Nov 2018 09:05:14 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:38852 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbeK2OFO (ORCPT ); Thu, 29 Nov 2018 09:05:14 -0500 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 Cc: Kees Cook , Emese Revfy , Masahiro Yamada , "H. Peter Anvin" , Borislav Petkov , x86@kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Michal Marek , Richard Weinberger , Ingo Molnar , Jeff Dike 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.7.4 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)