Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp848803img; Wed, 20 Mar 2019 12:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUtRc+MULnFxUOyHLK2rKqFeZuD2/hk2kBlTDygGj5JOSVsC3E+lQP9H06EjbAe1aCjcEE X-Received: by 2002:a63:c00a:: with SMTP id h10mr8992139pgg.272.1553109035428; Wed, 20 Mar 2019 12:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553109035; cv=none; d=google.com; s=arc-20160816; b=NCGM3hj2Ol0U8ehEgwiKT9C/6nXU2dS5FQsZIxH3zqFKU677T7YN0cjTZ3bXaWftAG PhgbOzKGQ9EmlkYAsyaB2tJY5R1zYW0QwyGcgCg9BuHBMj7TFKEbVyQqDDKmLhxIjdnn 6Kru2DHP2YTFjM+Lx/oD84oc+GV+o+6XYmRuvnRHZ+Mdt5dKTnOchbLi5QZgezJ8cnb7 +TL6d7GsQgxSWEuYAAeMpcAq/0IAVmut8kFN7h1UH4v4njK5HUFY9ZzsGTohUwla+oDd si5ULj9Ivugkj6F6saJC+KQ9Pa6/ewVSf8W/Oz6v3MAY19dPwQHqMjFPv4dBj9JLN+qF 5Q6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=QoPGPSsvKNCIA2fasGql8REFge+4TA3LgDOT4B4F1fg=; b=zNrKfLz780bB1e8Lm2+siJZd/4Qss8Fk6BzuHrJT8rjEMKhPaknhsIbqrn5o74QTQC yLlFLqrqvX8uUFgdvLgh0lx0uo1IulR/fKRZDnC83uXCxXZ7+Zx4MzgmvOi8VrqjfoF6 +H2ZVefUrD7FQsDyJF1EQQbIKZEJX1haJqEm5umA0eO/B228qC16eOr7jX4lfGE7t+07 d0FqRy+56JNqidNSHUO62BSLSLKiH7+AEijo/qWpNNYdk2i9PDe4446srgvdKMoLpF1G wfNrf4fqvhLn+n74KA+MkpI9e+FNAycJu0bmiHKqTjwClMyyhEnhUqjQtV8kk5JV9rrc +0hg== ARC-Authentication-Results: i=1; mx.google.com; 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 e9si2227827pgs.450.2019.03.20.12.10.19; Wed, 20 Mar 2019 12:10:35 -0700 (PDT) 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; 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 S1726981AbfCTTII (ORCPT + 99 others); Wed, 20 Mar 2019 15:08:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:52182 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726006AbfCTTIH (ORCPT ); Wed, 20 Mar 2019 15:08:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5FB7AAE3C; Wed, 20 Mar 2019 19:08:06 +0000 (UTC) Date: Wed, 20 Mar 2019 20:08:05 +0100 (CET) From: Miroslav Benes To: Joe Lawrence cc: Joao Moreira , live-patching@vger.kernel.org, pmladek@suse.cz, jikos@suse.cz, nstange@suse.de, jpoimboe@redhat.com, khlebnikov@yandex-team.ru, jeyu@kernel.org, matz@suse.de, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, linux-kbuild@vger.kernel.org, michal.lkml@markovi.net Subject: Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation In-Reply-To: <20190318191926.GA23138@redhat.com> Message-ID: References: <20190301141313.15057-1-jmoreira@suse.de> <20190301141313.15057-3-jmoreira@suse.de> <20190318191926.GA23138@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > index fd03d60f6c5a..1e28ad21314c 100644 > > --- a/scripts/Makefile.build > > +++ b/scripts/Makefile.build > > @@ -247,6 +247,11 @@ cmd_gen_ksymdeps = \ > > $(CONFIG_SHELL) $(srctree)/scripts/gen_ksymdeps.sh $@ >> $(dot-target).cmd > > endif > > > > +ifdef CONFIG_LIVEPATCH > > +cmd_livepatch = $(if $(LIVEPATCH_$(basetarget).o), \ > > + $(shell touch $(MODVERDIR)/$(basetarget).livepatch)) > > +endif > > + > > define rule_cc_o_c > > $(call cmd,checksrc) > > $(call cmd_and_fixdep,cc_o_c) > > @@ -283,6 +288,7 @@ $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) F > > $(call if_changed_rule,cc_o_c) > > @{ echo $(@:.o=.ko); echo $@; \ > > $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) > > + $(call cmd_livepatch) > > > > quiet_cmd_cc_lst_c = MKLST $@ > > cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ > > Since cmd_livepatch is only called for single-used-m, does this mean > that we can only klp-convert single object file livepatch modules? > > I stumbled upon this when trying to create a self-test module that > incorporated two object files. I tried adding a $(call cmd_livepatch) > in the recipe for $(obj)/%.o, but that didn't help. My kbuild foo > wasn't good enough to figure this one out. I looked at my original code and it is a bit different there. I placed it under rule_cc_o_c right after objtool command. If I remember correctly this is the correct recipe for .c->.o. Unfortunately I forgot the details and there is of course nothing about it in my notes. Does it help? Joao, is there a reason you moved it elsewhere? Miroslav