summaryrefslogtreecommitdiffstats
path: root/recipes-extended/xen
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2023-01-20 13:21:05 -0500
committerBruce Ashfield <bruce.ashfield@gmail.com>2023-01-20 13:22:47 -0500
commitf79a5f962a9ff491acd7e394d71eda930543f17c (patch)
tree8a01fa2cde126a702f47af688222d89007aff275 /recipes-extended/xen
parent33e6cb346f44f4e10030b86086ff81ae3d35968e (diff)
downloadmeta-virtualization-f79a5f962a9ff491acd7e394d71eda930543f17c.tar.gz
xen: fix build race condition
It has been reported that xen can fail to build with the following error: | In file included from xsm/flask/ss/services.c:46: | ./xsm/flask/include/avc.h:18:10: fatal error: av_permissions.h: No such file or directory | 18 | #include "av_permissions.h" | | ^~~~~~~~~~~~~~~~~~ This fix has been proposed upstream: https://lore.kernel.org/xen-devel/20230120133626.55680-1-anthony.perard@citrix.com/T/#u It doesn't break our build, so we include it for stress testing. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/xen')
-rw-r--r--recipes-extended/xen/files/xen-flask-race-fix.patch54
-rw-r--r--recipes-extended/xen/xen_4.17.bb1
-rw-r--r--recipes-extended/xen/xen_git.bb1
3 files changed, 56 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/xen-flask-race-fix.patch b/recipes-extended/xen/files/xen-flask-race-fix.patch
new file mode 100644
index 00000000..fa2a82ff
--- /dev/null
+++ b/recipes-extended/xen/files/xen-flask-race-fix.patch
@@ -0,0 +1,54 @@
1From mboxrd@z Thu Jan 1 00:00:00 1970
2From: Anthony PERARD <anthony.perard@citrix.com>
3Subject: [XEN PATCH] build: fix building flask headers before descending in flask/ss/
4Date: Fri, 20 Jan 2023 13:36:26 +0000
5Message-ID: <20230120133626.55680-1-anthony.perard@citrix.com>
6X-Mailer: git-send-email 2.30.2
7MIME-Version: 1.0
8Content-Transfer-Encoding: 8bit
9Content-Type: text/plain
10
11Unfortunatly, adding prerequisite to "$(obj)/ss/built_in.o" doesn't
12work because we have "$(obj)/%/built_in.o: $(obj)/% ;" in Rules.mk.
13So, make is allow to try to build objects in "xsm/flask/ss/" before
14generating the headers.
15
16Adding a prerequisite on "$(obj)/ss" instead will fix the issue has
17that the target used to run make in this subdirectory.
18
19Unfortunatly, that target is also used when running `make clean`, so
20we need to ignore it in this case. $(MAKECMDGOALS) can't be used in
21this case as it is empty, but we can guess which operation is done by
22looking at the list of loaded makefiles.
23
24Upstream-Status: backport [https://lore.kernel.org/xen-devel/20230120133626.55680-1-anthony.perard@citrix.com/T/#u]
25
26Fixes: 7a3bcd2babcc ("build: build everything from the root dir, use obj=$subdir")
27Reported-by: "Daniel P. Smith" <dpsmith@apertussolutions.com>
28Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
29---
30 xen/xsm/flask/Makefile | 6 +++++-
31 1 file changed, 5 insertions(+), 1 deletion(-)
32
33diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
34index d25312f4fa..2d24346ee3 100644
35--- a/xen/xsm/flask/Makefile
36+++ b/xen/xsm/flask/Makefile
37@@ -16,7 +16,11 @@ FLASK_H_FILES := flask.h class_to_string.h initial_sid_to_string.h
38 AV_H_FILES := av_perm_to_string.h av_permissions.h
39 ALL_H_FILES := $(addprefix include/,$(FLASK_H_FILES) $(AV_H_FILES))
40
41-$(addprefix $(obj)/,$(obj-y)) $(obj)/ss/built_in.o: $(addprefix $(obj)/,$(ALL_H_FILES))
42+# Adding prerequisite to descending into ss/ folder only when not running `make
43+# clean`.
44+ifeq ($(filter %/Makefile.clean,$(MAKEFILE_LIST)),)
45+$(addprefix $(obj)/,$(obj-y)) $(obj)/ss: $(addprefix $(obj)/,$(ALL_H_FILES))
46+endif
47 extra-y += $(ALL_H_FILES)
48
49 mkflask := $(srcdir)/policy/mkflask.sh
50--
51Anthony PERARD
52
53
54
diff --git a/recipes-extended/xen/xen_4.17.bb b/recipes-extended/xen/xen_4.17.bb
index f35689d4..cec184f9 100644
--- a/recipes-extended/xen/xen_4.17.bb
+++ b/recipes-extended/xen/xen_4.17.bb
@@ -7,6 +7,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
7SRC_URI = " \ 7SRC_URI = " \
8 git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ 8 git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
9 file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ 9 file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
10 file://xen-flask-race-fix.patch \
10 " 11 "
11 12
12LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" 13LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index 21384244..209d1bb3 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -7,6 +7,7 @@ XEN_BRANCH ?= "master"
7SRC_URI = " \ 7SRC_URI = " \
8 git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ 8 git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
9 file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ 9 file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
10 file://xen-flask-race-fix.patch \
10 " 11 "
11 12
12LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" 13LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"