diff options
Diffstat (limited to 'recipes-security/optee-imx/optee-os/0001-checkconf.mk-do-not-use-full-path-to-generate-guard-.patch')
-rw-r--r-- | recipes-security/optee-imx/optee-os/0001-checkconf.mk-do-not-use-full-path-to-generate-guard-.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-security/optee-imx/optee-os/0001-checkconf.mk-do-not-use-full-path-to-generate-guard-.patch b/recipes-security/optee-imx/optee-os/0001-checkconf.mk-do-not-use-full-path-to-generate-guard-.patch new file mode 100644 index 00000000..7a12bff8 --- /dev/null +++ b/recipes-security/optee-imx/optee-os/0001-checkconf.mk-do-not-use-full-path-to-generate-guard-.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From c8a2a6529dc3ff609281ef4fe5c5bc949c805b5c Mon Sep 17 00:00:00 2001 | ||
2 | From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> | ||
3 | Date: Thu, 6 Jun 2024 11:42:46 +0200 | ||
4 | Subject: [PATCH] checkconf.mk: do not use full path to generate guard symbol | ||
5 | in conf.h | ||
6 | |||
7 | The combination of building with -g3 (which emits definitions of all | ||
8 | defined preprocessor macros to the debug info) and using a full path | ||
9 | to define the name of this preprocessor guard means that the output is | ||
10 | not binary reproducible across different build hosts. For example, in | ||
11 | my Yocto build, the string | ||
12 | |||
13 | __home_ravi_yocto_tmp_glibc_work_stm32mp135fdk_oe_linux_gnueabi_optee_os_stm32mp_3_19_0_stm32mp_r1_1_build_stm32mp135f_dk_include_generated_conf_h_ | ||
14 | |||
15 | appears in several build artifacts. Another developer or buildbot | ||
16 | would not build in some /home/ravi/... directory. | ||
17 | |||
18 | In order to increase binary reproducibility, only use the path sans | ||
19 | the $(out-dir)/ prefix of the conf.h file. | ||
20 | |||
21 | Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
22 | Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> | ||
23 | --- | ||
24 | mk/checkconf.mk | 3 ++- | ||
25 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
26 | |||
27 | Upstream-Status: Backport [c8a2a6529dc3ff609281ef4fe5c5bc949c805b5c] | ||
28 | |||
29 | diff --git a/mk/checkconf.mk b/mk/checkconf.mk | ||
30 | index 449b1c2b8..bb08d6b15 100644 | ||
31 | --- a/mk/checkconf.mk | ||
32 | +++ b/mk/checkconf.mk | ||
33 | @@ -17,7 +17,8 @@ define check-conf-h | ||
34 | cnf='$(strip $(foreach var, \ | ||
35 | $(call cfg-vars-by-prefix,$1), \ | ||
36 | $(call cfg-make-define,$(var))))'; \ | ||
37 | - guard="_`echo $@ | tr -- -/.+ _`_"; \ | ||
38 | + guardpath="$(patsubst $(out-dir)/%,%,$@)" \ | ||
39 | + guard="_`echo "$${guardpath}" | tr -- -/.+ _`_"; \ | ||
40 | mkdir -p $(dir $@); \ | ||
41 | echo "#ifndef $${guard}" >$@.tmp; \ | ||
42 | echo "#define $${guard}" >>$@.tmp; \ | ||
43 | -- | ||
44 | 2.34.1 | ||