File tree Expand file tree Collapse file tree 9 files changed +54
-19
lines changed
Expand file tree Collapse file tree 9 files changed +54
-19
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ option(BUILD_UNIT_TESTS "Build unit tests" OFF)
3232option (BUILD_UNIT_TESTS_HOST "Build unit tests for host" OFF )
3333option (BUILD_UNIT_TESTS_XTENSA_GCC "Build xtensa unit test using GCC" OFF )
3434option (BUILD_CLANG_SCAN "Build for clang's scan-build" OFF )
35+ option (BUILD_COUNTERS "Enable build counter(s), timestamps and any other
36+ non-deterministic build features" OFF )
3537
3638if (CONFIG_LIBRARY OR BUILD_UNIT_TESTS_HOST)
3739 set (ARCH host)
@@ -78,6 +80,12 @@ add_library(sof_options INTERFACE)
7880
7981target_link_libraries (sof_options INTERFACE sof_public_headers)
8082
83+ if (BUILD_COUNTERS)
84+ target_compile_definitions (sof_options INTERFACE BLD_COUNTERS=1)
85+ else ()
86+ target_compile_definitions (sof_options INTERFACE BLD_COUNTERS=0)
87+ endif ()
88+
8189# interface library that is used only as container for sof statically
8290# linked libraries
8391add_library (sof_static_libraries INTERFACE )
@@ -183,7 +191,9 @@ target_link_libraries(sof PRIVATE sof_ld_scripts)
183191target_link_libraries (sof PRIVATE sof_ld_flags)
184192target_link_libraries (sof PRIVATE sof_static_libraries)
185193
194+ if (BUILD_COUNTERS)
186195sof_add_build_counter_rule()
196+ endif ()
187197
188198add_subdirectory (src)
189199
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ BUILD_SOF_RIS := \
147147 ${UNSIGNED_list:%=${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri} \
148148 ${SIGNED_list:%=${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri}
149149
150- # The build is not deterministic; use this to reduce noise when testing
150+ # When the build is not deterministic use this to reduce noise when testing
151151# this Makefile.
152152# Also very useful with XCC, see next comment.
153153ifneq (true,${BUILD_ONLY_ONCE})
Original file line number Diff line number Diff line change 1616# USER_DESTDIR := ${_remote}:bin/
1717
1818# Define this empty for a plain sof/ directory and no sof -> sof-v1.2.3
19- # symbolic links.
19+ # symbolic links. This is _only_ to override the top-level directory
20+ # name; for version.h see version.cmake and try sof/.tarball-version
2021# SOF_VERSION :=
2122#
2223# SOF_VERSION := $(shell git describe --tags )
Original file line number Diff line number Diff line change @@ -24,11 +24,15 @@ const struct ext_man_fw_version ext_man_fw_ver
2424 .micro = SOF_MICRO ,
2525 .minor = SOF_MINOR ,
2626 .major = SOF_MAJOR ,
27- #if CONFIG_DEBUG
28- /* only added in debug for reproducibility in releases */
27+ /* opt-in; reproducible build by default */
28+ #if BLD_COUNTERS
2929 .build = SOF_BUILD ,
3030 .date = __DATE__ ,
3131 .time = __TIME__ ,
32+ #else
33+ .build = -1 ,
34+ .date = "dtermin.\0" ,
35+ .time = "extman\0" ,
3236#endif
3337 .tag = SOF_TAG ,
3438 .abi_version = SOF_ABI_VERSION ,
Original file line number Diff line number Diff line change @@ -64,11 +64,15 @@ static const struct sof_ipc_fw_ready ready
6464 .micro = SOF_MICRO ,
6565 .minor = SOF_MINOR ,
6666 .major = SOF_MAJOR ,
67- #if CONFIG_DEBUG
68- /* only added in debug for reproducability in releases */
69- .build = SOF_BUILD ,
67+ /* opt-in; reproducible build by default */
68+ #if BLD_COUNTERS
69+ .build = SOF_BUILD , /* See version-build-counter.cmake */
7070 .date = __DATE__ ,
7171 .time = __TIME__ ,
72+ #else
73+ .build = -1 ,
74+ .date = "dtermin.\0" ,
75+ .time = "fwready.\0" ,
7276#endif
7377 .tag = SOF_TAG ,
7478 .abi_version = SOF_ABI_VERSION ,
Original file line number Diff line number Diff line change @@ -50,11 +50,15 @@ static const struct sof_ipc_fw_ready ready
5050 .micro = SOF_MICRO ,
5151 .minor = SOF_MINOR ,
5252 .major = SOF_MAJOR ,
53- #if CONFIG_DEBUG
54- /* only added in debug for reproducability in releases */
55- .build = SOF_BUILD ,
53+ /* opt-in; reproducible build by default */
54+ #if BLD_COUNTERS
55+ .build = SOF_BUILD , /* See version-build-counter.cmake */
5656 .date = __DATE__ ,
5757 .time = __TIME__ ,
58+ #else
59+ .build = -1 ,
60+ .date = "dtermin.\0" ,
61+ .time = "fwready.\0" ,
5862#endif
5963 .tag = SOF_TAG ,
6064 .abi_version = SOF_ABI_VERSION ,
Original file line number Diff line number Diff line change @@ -49,11 +49,15 @@ static const struct sof_ipc_fw_ready ready
4949 .micro = SOF_MICRO ,
5050 .minor = SOF_MINOR ,
5151 .major = SOF_MAJOR ,
52- #ifdef DEBUG_BUILD
53- /* only added in debug for reproducability in releases */
54- .build = SOF_BUILD ,
52+ /* opt-in; reproducible build by default */
53+ #if BLD_COUNTERS
54+ .build = SOF_BUILD , /* See version-build-counter.cmake */
5555 .date = __DATE__ ,
5656 .time = __TIME__ ,
57+ #else
58+ .build = -1 ,
59+ .date = "dtermin.\0" ,
60+ .time = "fwready.\0" ,
5761#endif
5862 .tag = SOF_TAG ,
5963 .abi_version = SOF_ABI_VERSION ,
Original file line number Diff line number Diff line change @@ -48,11 +48,15 @@ static const struct sof_ipc_fw_ready ready
4848 .micro = SOF_MICRO ,
4949 .minor = SOF_MINOR ,
5050 .major = SOF_MAJOR ,
51- #ifdef DEBUG_BUILD
52- /* only added in debug for reproducability in releases */
53- .build = SOF_BUILD ,
51+ /* opt-in; reproducible build by default */
52+ #if BLD_COUNTERS
53+ .build = SOF_BUILD , /* See version-build-counter.cmake */
5454 .date = __DATE__ ,
5555 .time = __TIME__ ,
56+ #else
57+ .build = -1 ,
58+ .date = "dtermin.\0" ,
59+ .time = "fwready.\0" ,
5660#endif
5761 .tag = SOF_TAG ,
5862 .abi_version = SOF_ABI_VERSION ,
Original file line number Diff line number Diff line change @@ -60,11 +60,15 @@ static const struct sof_ipc_fw_ready ready
6060 .micro = SOF_MICRO ,
6161 .minor = SOF_MINOR ,
6262 .major = SOF_MAJOR ,
63- #if CONFIG_DEBUG
64- /* only added in debug for reproducability in releases */
65- .build = SOF_BUILD ,
63+ /* opt-in; reproducible build by default */
64+ #if BLD_COUNTERS
65+ .build = SOF_BUILD , /* See version-build-counter.cmake */
6666 .date = __DATE__ ,
6767 .time = __TIME__ ,
68+ #else
69+ .build = -1 ,
70+ .date = "dtermin.\0" ,
71+ .time = "fwready.\0" ,
6872#endif
6973 .tag = SOF_TAG ,
7074 .abi_version = SOF_ABI_VERSION ,
You can’t perform that action at this time.
0 commit comments