public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Kees Cook <kees@kernel.org>, linux-hardening@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 1/3] fortify: use if_changed_dep to record header dependency in *.cmd files
Date: Mon, 15 Jul 2024 23:45:23 +0900	[thread overview]
Message-ID: <20240715144529.101634-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20240715144529.101634-1-masahiroy@kernel.org>

After building with CONFIG_FORTIFY_SOURCE=y, many .*.d files are left
in lib/test_fortify/ because the compiler outputs header dependencies
into *.d without fixdep being invoked.

When compiling C files, if_changed_dep should be used so that the
auto-generated header dependencies are recorded in .*.cmd files.

Currently, if_changed is incorrectly used, and only two headers are
hard-coded in lib/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 lib/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index 30337431d10e..429b259b5b64 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -408,11 +408,9 @@ targets += $(TEST_FORTIFY_LOGS)
 clean-files += $(TEST_FORTIFY_LOGS)
 clean-files += $(addsuffix .o, $(TEST_FORTIFY_LOGS))
 $(obj)/test_fortify/%.log: $(src)/test_fortify/%.c \
-			   $(src)/test_fortify/test_fortify.h \
-			   $(srctree)/include/linux/fortify-string.h \
 			   $(srctree)/scripts/test_fortify.sh \
 			   FORCE
-	$(call if_changed,test_fortify)
+	$(call if_changed_dep,test_fortify)
 
 quiet_cmd_gen_fortify_log = GEN     $@
       cmd_gen_fortify_log = cat </dev/null $(filter-out FORCE,$^) 2>/dev/null > $@ || true
-- 
2.43.0


  reply	other threads:[~2024-07-15 14:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 14:45 [PATCH 0/3] fortify: fix various issues in test_fortify Makefile Masahiro Yamada
2024-07-15 14:45 ` Masahiro Yamada [this message]
2024-07-16 17:50   ` [PATCH 1/3] fortify: use if_changed_dep to record header dependency in *.cmd files kernel test robot
2024-07-17  4:46     ` Masahiro Yamada
2024-07-17 22:19       ` Kees Cook
2024-07-18  4:22         ` Masahiro Yamada
2024-07-15 14:45 ` [PATCH 2/3] fortify: refactor test_fortify Makefile to fix some build problems Masahiro Yamada
2024-07-15 14:45 ` [PATCH 3/3] fortify: move test_fortify.sh to lib/test_fortify/ Masahiro Yamada
2024-07-15 16:07 ` [PATCH 0/3] fortify: fix various issues in test_fortify Makefile Kees Cook
2024-07-15 16:38   ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240715144529.101634-2-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox