summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-os/0001-checkconf.mk-do-not-use-full-path-to-generate-guard-.patch
diff options
context:
space:
mode:
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-.patch44
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 @@
1From c8a2a6529dc3ff609281ef4fe5c5bc949c805b5c Mon Sep 17 00:00:00 2001
2From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
3Date: Thu, 6 Jun 2024 11:42:46 +0200
4Subject: [PATCH] checkconf.mk: do not use full path to generate guard symbol
5 in conf.h
6
7The combination of building with -g3 (which emits definitions of all
8defined preprocessor macros to the debug info) and using a full path
9to define the name of this preprocessor guard means that the output is
10not binary reproducible across different build hosts. For example, in
11my 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
15appears in several build artifacts. Another developer or buildbot
16would not build in some /home/ravi/... directory.
17
18In order to increase binary reproducibility, only use the path sans
19the $(out-dir)/ prefix of the conf.h file.
20
21Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
22Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
23---
24 mk/checkconf.mk | 3 ++-
25 1 file changed, 2 insertions(+), 1 deletion(-)
26
27Upstream-Status: Backport [c8a2a6529dc3ff609281ef4fe5c5bc949c805b5c]
28
29diff --git a/mk/checkconf.mk b/mk/checkconf.mk
30index 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--
442.34.1