[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH] build: fix building flask headers before descending in flask/ss/


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 20 Jan 2023 09:13:47 -0500
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674224033; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=9ix9s84QpeY8dDxVbIX3sXORNpGtaeroYBcT4xnkZeg=; b=mwSLHIP4cG9pExY3Oyok780YiqY9LZYBo757qhxPNd99LkBB3AkoBOsNoMwgxT7bnDOioQNperYjma5k2pvNSpzRCHLBIiAN29jqlol01XvKa3OYKW6O/cp6PfGlfhDcinyqK5pteKUw5TuDovJ62V9/owBJtqXz4iECqF2KsZI=
  • Arc-seal: i=1; a=rsa-sha256; t=1674224033; cv=none; d=zohomail.com; s=zohoarc; b=XZh3rC7FHAof0N08XiWZ/CfdL/0rVKOP2tG0BHe39eY7DomE+aYBHzYrT8spYbEVhrBFCxX0umgL2Vd9pkDHvhCcGcgQqT9js3aPYwooXMGfm4Trx6VYwDkQ5mEPW3ODDOLUTD9mmOWHrDtFyfpAZAjq+sb8xofhUrBiK5a1Q18=
  • Delivery-date: Fri, 20 Jan 2023 14:14:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 1/20/23 08:36, Anthony PERARD wrote:
Unfortunatly, adding prerequisite to "$(obj)/ss/built_in.o" doesn't
work because we have "$(obj)/%/built_in.o: $(obj)/% ;" in Rules.mk.
So, make is allow to try to build objects in "xsm/flask/ss/" before
generating the headers.

Adding a prerequisite on "$(obj)/ss" instead will fix the issue has
that the target used to run make in this subdirectory.

Unfortunatly, that target is also used when running `make clean`, so
we need to ignore it in this case. $(MAKECMDGOALS) can't be used in
this case as it is empty, but we can guess which operation is done by
looking at the list of loaded makefiles.

Fixes: 7a3bcd2babcc ("build: build everything from the root dir, use 
obj=$subdir")
Reported-by: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
  xen/xsm/flask/Makefile | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index d25312f4fa..2d24346ee3 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -16,7 +16,11 @@ FLASK_H_FILES := flask.h class_to_string.h 
initial_sid_to_string.h
  AV_H_FILES := av_perm_to_string.h av_permissions.h
  ALL_H_FILES := $(addprefix include/,$(FLASK_H_FILES) $(AV_H_FILES))
-$(addprefix $(obj)/,$(obj-y)) $(obj)/ss/built_in.o: $(addprefix $(obj)/,$(ALL_H_FILES))
+# Adding prerequisite to descending into ss/ folder only when not running `make
+# clean`.
+ifeq ($(filter %/Makefile.clean,$(MAKEFILE_LIST)),)
+$(addprefix $(obj)/,$(obj-y)) $(obj)/ss: $(addprefix $(obj)/,$(ALL_H_FILES))
+endif
  extra-y += $(ALL_H_FILES)
mkflask := $(srcdir)/policy/mkflask.sh

It builds for me, but I also do not have a large enough system to do a `-j16` to confirm it at the scale for which it occurred. Regardless, I will ack it.

Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.