Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1021925iob; Fri, 13 May 2022 19:59:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrdrLx2Ee3UmluVqt2ljb2AkKixsgfPYBRntYZt6DuXn4TzHB7di9JQy0cdJs1EQs9vDPF X-Received: by 2002:a05:6000:1e1a:b0:20c:565d:ca1c with SMTP id bj26-20020a0560001e1a00b0020c565dca1cmr5892239wrb.643.1652497152986; Fri, 13 May 2022 19:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652497152; cv=none; d=google.com; s=arc-20160816; b=N9n4Hqni2PDhbMxoyabpI7gsSvdYpn0nVSgDxRItZtSLfezCzyzS3nW/K1+qpedFkt WnsR7k2Bt8e8MAGSLrDeEY4jfSqmyVYYoK/aqbsWZAlLBACizqObtt0ZG+vHl0FWlxpj TVtf4CcqpKsCgbFjbjwt69G3hysf1Tgb8ruMkwKGR1WOG8q1HbQ7zfN9Fprh/YJmJL5a 7uBFulJQY0ctzbkKJlGj0hd9Nb7jRbyoXDfc7TzLLdDZCLS8lpOp19iM+H+v4895zSFm P1abiPgDllN+YQ38OXegzWKUj/VkyqR2GuvS2GPt2KVzbykgk6lnZdO48C40g1GfWK0D mEZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=by3q2u7pd2hyaL5ucbdQJ/fKHgUIfSt712B1Ta9pyDU=; b=ekfckuT2x/rvfjsPi+mhttWyhGJQqMlb6mxJAo8yOQvy9uGxO8sRD3ISIwb+lX8GGY VSQW0UWgwaz/KC5jAmIJ1g4rs6D2OPYuO/qVj3iwyEBdKAJ6orgRJG0qpysF+W9NvY0A 1uldGyY/n9ZrpLlnIpu/IqMlBtvdrRiQtk2ivQ3BT6yzR6Si4WyPf5xnPk6HtzGdMVyT SuUmWwRyWhtv80C/eagGJU8Xw87raVpRf3Pr1od000vxnB6GhqjPt1/jRnuJTarKFLzz itJaeGQG9cDyjySq+LAU3dshpLNa0ZP7g6Al5NtnNCGUzpaajynwLWpdN1S2U/Vpgf5S p+yQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m1-20020a5d64a1000000b0020ac34e80e6si4934721wrp.541.2022.05.13.19.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:59:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0FDB839D47D; Fri, 13 May 2022 16:43:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379939AbiEMLkv (ORCPT + 99 others); Fri, 13 May 2022 07:40:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379933AbiEMLkt (ORCPT ); Fri, 13 May 2022 07:40:49 -0400 Received: from mail.avm.de (mail.avm.de [IPv6:2001:bf0:244:244::120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E49C813E33; Fri, 13 May 2022 04:40:45 -0700 (PDT) Received: from mail-auth.avm.de (unknown [IPv6:2001:bf0:244:244::71]) by mail.avm.de (Postfix) with ESMTPS; Fri, 13 May 2022 13:40:42 +0200 (CEST) Received: from buildd.core.avm.de (buildd-sv-01.avm.de [172.16.0.225]) by mail-auth.avm.de (Postfix) with ESMTPA id C6DCD81DE2; Fri, 13 May 2022 13:40:43 +0200 (CEST) Received: by buildd.core.avm.de (Postfix, from userid 1000) id C1600182AE3; Fri, 13 May 2022 13:40:43 +0200 (CEST) Date: Fri, 13 May 2022 13:40:43 +0200 From: Nicolas Schier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Peter Zijlstra , linux-modules@vger.kernel.org, llvm@lists.linux.dev, Ard Biesheuvel , Sami Tolvanen , Kees Cook , Josh Poimboeuf Subject: Re: [PATCH v5 12/12] kbuild: rebuild multi-object modules when objtool is updated Message-ID: References: <20220511164514.2741934-1-masahiroy@kernel.org> <20220511164514.2741934-13-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220511164514.2741934-13-masahiroy@kernel.org> X-purgate-ID: 149429::1652442042-000003AF-5D1AD51C/0/0 X-purgate-type: clean X-purgate-size: 1858 X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2022 at 01:45:14AM +0900, Masahiro Yamada wrote: > When CONFIG_LTO_CLANG or CONFIG_X86_KERNEL_IBT is enabled, objtool for > multi-object modules is postponed until the objects are linked together. > > Make sure to re-run objtool and re-link multi-object modules when > objtool is updated. > > Signed-off-by: Masahiro Yamada > Reviewed-by: Kees Cook > Acked-by: Josh Poimboeuf > --- > > (no changes since v4) > > Changes in v4: > - New > Resent of my previous submission > https://lore.kernel.org/linux-kbuild/20210831074004.3195284-11-masahiroy@kernel.org/ > > scripts/Makefile.build | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index f546b5f1f33f..4e6902e099e8 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -404,13 +404,18 @@ $(obj)/modules.order: $(obj-m) FORCE > $(obj)/lib.a: $(lib-y) FORCE > $(call if_changed,ar) > > -quiet_cmd_link_multi-m = LD [M] $@ > - cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ @$(patsubst %.o,%.mod,$@) $(cmd_objtool) > +quiet_cmd_ld_multi_m = LD [M] $@ > + cmd_ld_multi_m = $(LD) $(ld_flags) -r -o $@ @$(patsubst %.o,%.mod,$@) $(cmd_objtool) > + > +define rule_ld_multi_m > + $(call cmd_and_savecmd,ld_multi_m) > + $(call cmd,gen_objtooldep) > +endef > > $(multi-obj-m): objtool-enabled := $(delay-objtool) > $(multi-obj-m): part-of-module := y > $(multi-obj-m): %.o: %.mod FORCE > - $(call if_changed,link_multi-m) > + $(call if_changed_rule,ld_multi_m) > $(call multi_depend, $(multi-obj-m), .o, -objs -y -m) > > targets := $(filter-out $(PHONY), $(targets)) > -- > 2.32.0 > Reviewed-by: Nicolas Schier