diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-01-20 13:21:05 -0500 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-01-20 13:22:47 -0500 |
commit | f79a5f962a9ff491acd7e394d71eda930543f17c (patch) | |
tree | 8a01fa2cde126a702f47af688222d89007aff275 /recipes-extended/xen | |
parent | 33e6cb346f44f4e10030b86086ff81ae3d35968e (diff) | |
download | meta-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.patch | 54 | ||||
-rw-r--r-- | recipes-extended/xen/xen_4.17.bb | 1 | ||||
-rw-r--r-- | recipes-extended/xen/xen_git.bb | 1 |
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 @@ | |||
1 | From mboxrd@z Thu Jan 1 00:00:00 1970 | ||
2 | From: Anthony PERARD <anthony.perard@citrix.com> | ||
3 | Subject: [XEN PATCH] build: fix building flask headers before descending in flask/ss/ | ||
4 | Date: Fri, 20 Jan 2023 13:36:26 +0000 | ||
5 | Message-ID: <20230120133626.55680-1-anthony.perard@citrix.com> | ||
6 | X-Mailer: git-send-email 2.30.2 | ||
7 | MIME-Version: 1.0 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | Content-Type: text/plain | ||
10 | |||
11 | Unfortunatly, adding prerequisite to "$(obj)/ss/built_in.o" doesn't | ||
12 | work because we have "$(obj)/%/built_in.o: $(obj)/% ;" in Rules.mk. | ||
13 | So, make is allow to try to build objects in "xsm/flask/ss/" before | ||
14 | generating the headers. | ||
15 | |||
16 | Adding a prerequisite on "$(obj)/ss" instead will fix the issue has | ||
17 | that the target used to run make in this subdirectory. | ||
18 | |||
19 | Unfortunatly, that target is also used when running `make clean`, so | ||
20 | we need to ignore it in this case. $(MAKECMDGOALS) can't be used in | ||
21 | this case as it is empty, but we can guess which operation is done by | ||
22 | looking at the list of loaded makefiles. | ||
23 | |||
24 | Upstream-Status: backport [https://lore.kernel.org/xen-devel/20230120133626.55680-1-anthony.perard@citrix.com/T/#u] | ||
25 | |||
26 | Fixes: 7a3bcd2babcc ("build: build everything from the root dir, use obj=$subdir") | ||
27 | Reported-by: "Daniel P. Smith" <dpsmith@apertussolutions.com> | ||
28 | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> | ||
29 | --- | ||
30 | xen/xsm/flask/Makefile | 6 +++++- | ||
31 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
32 | |||
33 | diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile | ||
34 | index 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 | -- | ||
51 | Anthony 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}" | |||
7 | SRC_URI = " \ | 7 | SRC_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 | ||
12 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" | 13 | LIC_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" | |||
7 | SRC_URI = " \ | 7 | SRC_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 | ||
12 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" | 13 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" |