optee-os: fix build race
PATCH 1/1 optee-os: fix build race
From: Ross Burton <[email protected]>
There's a rare build race where mk/conf.mk.tmp is written to before mk/ exists. Add an explicit mkdir so that this directory is sure to exist.
Change-Id I4e907f395679da9354d386301e7bf5da46afdbaf
Signed-off-by Ross Burton <[email protected]>
--- .../optee/optee-os/missing-mkdir.patch | 31 +++++++++++++++++++ .../recipes-security/optee/optee-os_git.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta-arm/recipes-security/optee/optee-os/missing-mkdir.patch
meta-arm/recipes-security/optee/optee-os/missing-mkdir.patch new file +31 -0
@@ -0,0 +1,31 @@ +Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/4000] +Signed-off-by: Ross Burton <[email protected]> + +From 79384a244d1972cdb02114f5cde6fcaf2e014c9b Mon Sep 17 00:00:00 2001 +From: Jerome Forissier <[email protected]> +Date: Tue, 28 Jul 2020 17:28:43 +0200 +Subject: [PATCH] build: fix race when generating conf.mk + +This patch fixes the following error triggered by a heavily parallel build: + + echo sm := ta_arm64 > .../export-ta_arm64/mk/conf.mk.tmp + /bin/bash: .../export-ta_arm64/mk/conf.mk.tmp: No such file or directory + +Fixes: https://github.com/OP-TEE/optee_os/issues/3999 +Signed-off-by: Jerome Forissier <[email protected]> +--- + ta/ta.mk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ta/ta.mk b/ta/ta.mk +index 59ed87f71d..ad97edaf08 100644 +--- a/ta/ta.mk ++++ b/ta/ta.mk +@@ -190,6 +190,7 @@ define mk-file-export + .PHONY: $(conf-mk-file-export) + $(conf-mk-file-export): + @$$(cmd-echo-silent) ' CHK ' $$@ ++ $(q)mkdir -p $$(dir $$@) + $(q)echo sm := $$(sm-$(conf-mk-file-export)) > [email protected] + $(q)echo sm-$$(sm-$(conf-mk-file-export)) := y >> [email protected] + $(q)($$(foreach v, $$(ta-mk-file-export-vars-$$(sm-$(conf-mk-file-export))), \
meta-arm/recipes-security/optee/optee-os_git.bb +1 -0
@@ -21,6 +21,7 @@ SRC_URI = " \ file://0004-Cleanup-unused-comp-cflags-sm-from-libgcc-lookup-com.patch \ file://0005-Fixup-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \ file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \ + file://missing-mkdir.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.26.2
Quoted 7 lines · Ross Burton
From: Ross Burton <[email protected]>
There's a rare build race where mk/conf.mk.tmp is written to before mk/ exists. Add an explicit mkdir so that this directory is sure to exist.
Change-Id I4e907f395679da9354d386301e7bf5da46afdbafSigned-off-by Ross Burton <[email protected]>
Pulled into master.
Thanks,
Jon
Quoted 60 lines
--- .../optee/optee-os/missing-mkdir.patch | 31 +++++++++++++++++++ .../recipes-security/optee/optee-os_git.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta-arm/recipes-security/optee/optee-os/missing-mkdir.patchmeta-arm/recipes-security/optee/optee-os/missing-mkdir.patch new file +31
-0@@ -0,0 +1,31 @@ +Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/4000] +Signed-off-by: Ross Burton <[email protected]> + +From 79384a244d1972cdb02114f5cde6fcaf2e014c9b Mon Sep 17 00:00:00 2001 +From: Jerome Forissier <[email protected]> +Date: Tue, 28 Jul 2020 17:28:43 +0200 +Subject: [PATCH] build: fix race when generating conf.mk + +This patch fixes the following error triggered by a heavily parallel build: + + echo sm := ta_arm64 > .../export-ta_arm64/mk/conf.mk.tmp + /bin/bash: .../export-ta_arm64/mk/conf.mk.tmp: No such file or directory + +Fixes: https://github.com/OP-TEE/optee_os/issues/3999 +Signed-off-by: Jerome Forissier <[email protected]> +--- + ta/ta.mk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ta/ta.mk b/ta/ta.mk +index 59ed87f71d..ad97edaf08 100644 +--- a/ta/ta.mk ++++ b/ta/ta.mk +@@ -190,6 +190,7 @@ define mk-file-export + .PHONY: $(conf-mk-file-export) + $(conf-mk-file-export): + @$$(cmd-echo-silent) ' CHK ' $$@ ++ $(q)mkdir -p $$(dir $$@) + $(q)echo sm := $$(sm-$(conf-mk-file-export)) > [email protected] + $(q)echo sm-$$(sm-$(conf-mk-file-export)) := y >> [email protected] + $(q)($$(foreach v, $$(ta-mk-file-export-vars-$$(sm-$(conf-mk-file-export))), \meta-arm/recipes-security/optee/optee-os_git.bb +1
-0@@ -21,6 +21,7 @@ SRC_URI = " \ file://0004-Cleanup-unused-comp-cflags-sm-from-libgcc-lookup-com.patch \ file://0005-Fixup-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \ file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \ + file://missing-mkdir.patch \ " S = "${WORKDIR}/git"Signature · 1 line
2.26.2