Skip to contentSkip to conversation

selinux: fix Makefile dependencies of flask.h

PATCH In review Ondrej Mosnacek 3 participants 3 messages Apr 12, 2023 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selinux: fix Makefile dependencies of flask.h

Make the flask.h target depend on the genheaders binary instead of classmap.h to ensure that it is rebuilt if any of the dependencies of genheaders are changed.

Notably this fixes flask.h not being rebuilt when
initial_sid_to_string.h is modified.

Fixes 8753f6bec352 ("selinux: generate flask headers during kernel build")
---
 security/selinux/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/Makefile +2 -2
index 7761624448826..103c2776478a7 100644
@@ -23,8 +23,8 @@ ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
 $(addprefix $(obj)/,$(selinux-y)): $(obj)/flask.h
 
 quiet_cmd_flask = GEN     $(obj)/flask.h $(obj)/av_permissions.h
-      cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h
+      cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h
 
 targets += flask.h av_permissions.h
-$(obj)/flask.h: $(src)/include/classmap.h FORCE
+$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE
 	$(call if_changed,flask)
Signature · 1 line
2.39.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Ondrej Mosnacek

Make the flask.h target depend on the genheaders binary instead of classmap.h to ensure that it is rebuilt if any of the dependencies of genheaders are changed.

Notably this fixes flask.h not being rebuilt when
initial_sid_to_string.h is modified.

Fixes 8753f6bec352 ("selinux: generate flask headers during kernel build")
Quoted 22 lines
---
 security/selinux/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/Makefile +2 -3
index 7761624448826..103c2776478a7 100644
@@ -23,8 +23,8 @@ ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
 $(addprefix $(obj)/,$(selinux-y)): $(obj)/flask.h
 
 quiet_cmd_flask = GEN     $(obj)/flask.h $(obj)/av_permissions.h
-      cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h
+      cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h
 
 targets += flask.h av_permissions.h
-$(obj)/flask.h: $(src)/include/classmap.h FORCE
+$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE
        $(call if_changed,flask)
--

2.39.2

maintainer
#2 lore raw
In reply to Ondrej Mosnacek
Quoted 5 lines · Ondrej Mosnacek

Make the flask.h target depend on the genheaders binary instead of classmap.h to ensure that it is rebuilt if any of the dependencies of genheaders are changed.

Quoted 8 lines

Notably this fixes flask.h not being rebuilt when
initial_sid_to_string.h is modified.

Fixes 8753f6bec352 ("selinux: generate flask headers during kernel build")
---
 security/selinux/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks Ondrej, I just merged this into selinux/next. You also inspired me to fix a build bug with av_permissions.h that has bit me once or twice :)

Signature · 1 line
paul-moore.com