Makefile: Add build time and compiler info string.
PATCH v2 1/1 Makefile: Add build time and compiler info string.
From: Wei Fu <[email protected]>
When we are doing opensbi development, we want to know the build time and compiler info for debug purpose.
To enable this message, please add "BUILD_INFO=y" , like:
``` make BUILD_INFO=y ```
NOTE: BUILD_INFO=y will violate "reproducible builds".
So it's ONLY for development and debug purpose, and should NEVER be used in a real product.
--- Makefile | 22 ++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ lib/sbi/sbi_init.c | 8 ++++++++ 3 files changed, 53 insertions(+)
Makefile +22 -0
@@ -150,6 +150,15 @@ endif # Check whether the linker supports creating PIEs OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) +# Build Info: +# OPENSBI_BUILD_TIME_STAMP -- the compilation time stamp +# OPENSBI_BUILD_COMPILER_VERSION -- the compiler version info +BUILD_INFO ?= n +ifeq ($(BUILD_INFO),y) +OPENSBI_BUILD_TIME_STAMP=$(shell date) +OPENSBI_BUILD_COMPILER_VERSION=$(shell $(CC) -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$$//') +endif + # Setup list of objects.mk files ifdef PLATFORM platform-object-mks=$(shell if [ -d $(platform_src_dir)/ ]; then find $(platform_src_dir) -iname "objects.mk" | sort -r; fi)
@@ -247,6 +256,10 @@ GENFLAGS += -I$(include_dir) ifneq ($(OPENSBI_VERSION_GIT),) GENFLAGS += -DOPENSBI_VERSION_GIT="\"$(OPENSBI_VERSION_GIT)\"" endif +ifeq ($(BUILD_INFO),y) +GENFLAGS += -DOPENSBI_BUILD_TIME_STAMP="\"$(OPENSBI_BUILD_TIME_STAMP)\"" +GENFLAGS += -DOPENSBI_BUILD_COMPILER_VERSION="\"$(OPENSBI_BUILD_COMPILER_VERSION)\"" +endif GENFLAGS += $(libsbiutils-genflags-y) GENFLAGS += $(platform-genflags-y) GENFLAGS += $(firmware-genflags-y)
@@ -398,6 +411,12 @@ $(build_dir)/%.dep: $(src_dir)/%.c $(build_dir)/%.o: $(src_dir)/%.c $(call compile_cc,$@,$<) +ifeq ($(BUILD_INFO),y) +$(build_dir)/lib/sbi/sbi_init.o: $(libsbi_dir)/sbi_init.c FORCE + $(call compile_cc,$@,$<) + $(warning 'BUILD_INFO=y' violates 'reproducible builds', for DEBUG ONLY.) +endif + $(build_dir)/%.dep: $(src_dir)/%.S $(call compile_as_dep,$@,$<)
@@ -551,3 +570,6 @@ ifeq ($(install_root_dir),$(install_root_dir_default)/usr) $(if $(V), @echo " RM $(install_root_dir_default)") $(CMD_PREFIX)rm -rf $(install_root_dir_default) endif + +.PHONY: FORCE +FORCE:
README.md +23 -0
@@ -254,6 +254,28 @@ to produce broken binaries with missing relocations; it is therefore currently recommended that this combination be avoided or *FW_PIC=n* be used to disable building OpenSBI as a position-independent binary. +Building with timestamp and compiler info +------------------------ + +When doing development, we may want to know the build time and compiler info +for debug purpose. OpenSBI can also be built with timestamp and compiler info. +To build with those info and print it out@boot time, we can just simply add +`BUILD_INFO=y`, like: +``` +make BUILD_INFO=y +``` + +But if you have used `BUILD_INFO=y`, and want to switch back to `BUILD_INFO=n`, +you must do +``` +make clean +``` +before the next build. + +NOTE: Using `BUILD_INFO=y` will violate [reproducible builds]. This definition +is ONLY for development and debug purpose. It should NEVER be used in a real +product. + Contributing to OpenSBI -----------------------
@@ -336,3 +358,4 @@ make I=<install_directory> install_docs [Doxygen manual]: http://www.doxygen.nl/manual/index.html [Kendryte standalone SDK]: https://github.com/kendryte/kendryte-standalone-sdk [third party notices]: ThirdPartyNotices.md +[reproducible builds]: https://reproducible-builds.org
lib/sbi/sbi_init.c +8 -0
@@ -48,6 +48,14 @@ static void sbi_boot_print_banner(struct sbi_scratch *scratch) OPENSBI_VERSION_MINOR);#endif +#ifdef OPENSBI_BUILD_TIME_STAMP +sbi_printf ("Build time: %s.\n" ,OPENSBI_BUILD_TIME_STAMP ); +#endif + +#ifdef OPENSBI_BUILD_COMPILER_VERSION +sbi_printf ("Build compiler: %s.\n" ,OPENSBI_BUILD_COMPILER_VERSION ); +#endif +sbi_printf (BANNER ); }
Signature · 1 line
2.25.4
PATCH v2 1/1 Makefile: Add build time and compiler info string.
Quoted 6 lines · tekkamanninja at gmail.com
From: Wei Fu <[email protected]>
When we are doing opensbi development, we want to know the build time and compiler info for debug purpose.
To enable this message, please add "BUILD_INFO=y" , like:
Quoted 7 lines
``` make BUILD_INFO=y ```NOTE:
BUILD_INFO=ywill violate "reproducible builds".
So it's ONLY for development and debug purpose, and should NEVER be used in a real product.
Thanks for the patch!
I don't think we need to say NEVER, there are lots of products that don't use reproducible builds :)
Quoted 43 lines
Signed-off-by Wei Fu <[email protected]>---
Makefile | 22 ++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ lib/sbi/sbi_init.c | 8 ++++++++ 3 files changed, 53 insertions(+)Makefile +9
-0@@ -150,6 +150,15 @@ endif # Check whether the linker supports creating PIEs OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) +# Build Info: +# OPENSBI_BUILD_TIME_STAMP -- the compilation time stamp +# OPENSBI_BUILD_COMPILER_VERSION -- the compiler version info +BUILD_INFO ?= n +ifeq ($(BUILD_INFO),y) +OPENSBI_BUILD_TIME_STAMP=$(shell date) +OPENSBI_BUILD_COMPILER_VERSION=$(shell $(CC) -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$$//') +endif + # Setup list of objects.mk filesifdef PLATFORM
platform-object-mks=$(shell if [ -d $(platform_src_dir)/ ]; then find $(platform_src_dir) -iname "objects.mk" | sort -r; fi)Makefile +0
-0@@ -247,6 +256,10 @@ GENFLAGS += -I$(include_dir) ifneq ($(OPENSBI_VERSION_GIT),)GENFLAGS += -DOPENSBI_VERSION_GIT="\"$(OPENSBI_VERSION_GIT)\"" endif
Makefile +4
-0+ifeq ($(BUILD_INFO),y) +GENFLAGS += -DOPENSBI_BUILD_TIME_STAMP="\"$(OPENSBI_BUILD_TIME_STAMP)\"" +GENFLAGS += -DOPENSBI_BUILD_COMPILER_VERSION="\"$(OPENSBI_BUILD_COMPILER_VERSION)\"" +endifGENFLAGS += $(libsbiutils-genflags-y)
GENFLAGS += $(platform-genflags-y)
GENFLAGS += $(firmware-genflags-y)Makefile +0
-0@@ -398,6 +411,12 @@ $(build_dir)/%.dep: $(src_dir)/%.c$(build_dir)/%.o: $(src_dir)/%.c
$(call compile_cc,$@,$<)
Makefile $(build_dir)/%.dep: $(src_dir)/%.c · line 418
Quoted 5 lines
Makefile +5
-0+ifeq ($(BUILD_INFO),y) +$(build_dir)/lib/sbi/sbi_init.o: $(libsbi_dir)/sbi_init.c FORCE + $(call compile_cc,$@,$<) + $(warning 'BUILD_INFO=y' violates 'reproducible builds', for DEBUG ONLY.) +endif
Do we need this?
Quoted 45 lines
+
$(build_dir)/%.dep: $(src_dir)/%.S
$(call compile_as_dep,$@,$<)Makefile +0
-0@@ -551,3 +570,6 @@ ifeq ($(install_root_dir),$(install_root_dir_default)/usr) $(if $(V), @echo " RM $(install_root_dir_default)") $(CMD_PREFIX)rm -rf $(install_root_dir_default)endif
Makefile +3
-0+ +.PHONY: FORCE +FORCE:README.md +0
-0@@ -254,6 +254,28 @@ to produce broken binaries with missing relocations; it is therefore currentlyrecommended that this combination be avoided or *FW_PIC=n* be used to disable building OpenSBI as a position-independent binary.
README.md +22
-0+Building with timestamp and compiler info +------------------------ + +When doing development, we may want to know the build time and compiler info +for debug purpose. OpenSBI can also be built with timestamp and compiler info. +To build with those info and print it out at boot time, we can just simply add +`BUILD_INFO=y`, like: +``` +make BUILD_INFO=y +``` + +But if you have used `BUILD_INFO=y`, and want to switch back to `BUILD_INFO=n`, +you must do +``` +make clean +``` +before the next build. + +NOTE: Using `BUILD_INFO=y` will violate [reproducible builds]. This definition +is ONLY for development and debug purpose. It should NEVER be used in a real +product. +Contributing to OpenSBI
-----------------------README.md +0
-0@@ -336,3 +358,4 @@ make I=<install_directory> install_docs
Quoted 5 lines
[Doxygen manual]: http://www.doxygen.nl/manual/index.html
[Kendryte standalone SDK]: https://github.com/kendryte/kendryte-standalone-sdk
[third party notices]: ThirdPartyNotices.md
+[reproducible builds]: https://reproducible-builds.org
\ No newline at end of file
Probably want a new line here.
Otherwise looks good.
Alistair
Quoted 23 lines
lib/sbi/sbi_init.c +8
-0@@ -48,6 +48,14 @@ static void sbi_boot_print_banner(struct sbi_scratch *scratch) OPENSBI_VERSION_MINOR);#endif +#ifdef OPENSBI_BUILD_TIME_STAMP +sbi_printf ("Build time: %s.\n" ,OPENSBI_BUILD_TIME_STAMP ); +#endif + +#ifdef OPENSBI_BUILD_COMPILER_VERSION +sbi_printf ("Build compiler: %s.\n" ,OPENSBI_BUILD_COMPILER_VERSION ); +#endif +sbi_printf (BANNER ); }Signature · 1 line
2.25.4
PATCH v2 1/1 Makefile: Add build time and compiler info string.
Hi Alistair
Great thanks for your review!
Alistair <[email protected]> ?2021?9?29??? ??6:50???
Quoted 12 lines · tekkamanninja at gmail.com
Quoted 10 lines
From: Wei Fu <[email protected]>
When we are doing opensbi development, we want to know the build time and compiler info for debug purpose.
To enable this message, please add "BUILD_INFO=y" , like:``` make BUILD_INFO=y ```
Quoted 7 lines
Quoted 3 lines
NOTE:
BUILD_INFO=ywill violate "reproducible builds".
So it's ONLY for development and debug purpose, and should NEVER be used in a real product.Thanks for the patch!
I don't think we need to say NEVER, there are lots of products that don't use reproducible builds :)
Sure , s/NEVER/NOT/, or maybe
So it's ONLY for development and debug purpose, and should NOT be used in a product which follows "reproducible builds".
Quoted 44 lines
Quoted 44 lines
Signed-off-by Wei Fu <[email protected]>---
Makefile | 22 ++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ lib/sbi/sbi_init.c | 8 ++++++++ 3 files changed, 53 insertions(+)Makefile +9
-0@@ -150,6 +150,15 @@ endif # Check whether the linker supports creating PIEs OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) +# Build Info: +# OPENSBI_BUILD_TIME_STAMP -- the compilation time stamp +# OPENSBI_BUILD_COMPILER_VERSION -- the compiler version info +BUILD_INFO ?= n +ifeq ($(BUILD_INFO),y) +OPENSBI_BUILD_TIME_STAMP=$(shell date) +OPENSBI_BUILD_COMPILER_VERSION=$(shell $(CC) -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$$//') +endif + # Setup list of objects.mk filesifdef PLATFORM
platform-object-mks=$(shell if [ -d $(platform_src_dir)/ ]; then find $(platform_src_dir) -iname "objects.mk" | sort -r; fi)Makefile +0
-0@@ -247,6 +256,10 @@ GENFLAGS += -I$(include_dir) ifneq ($(OPENSBI_VERSION_GIT),)GENFLAGS += -DOPENSBI_VERSION_GIT="\"$(OPENSBI_VERSION_GIT)\"" endif
Makefile +4
-0+ifeq ($(BUILD_INFO),y) +GENFLAGS += -DOPENSBI_BUILD_TIME_STAMP="\"$(OPENSBI_BUILD_TIME_STAMP)\"" +GENFLAGS += -DOPENSBI_BUILD_COMPILER_VERSION="\"$(OPENSBI_BUILD_COMPILER_VERSION)\"" +endifGENFLAGS += $(libsbiutils-genflags-y)
GENFLAGS += $(platform-genflags-y)
GENFLAGS += $(firmware-genflags-y)Makefile +0
-0@@ -398,6 +411,12 @@ $(build_dir)/%.dep: $(src_dir)/%.c$(build_dir)/%.o: $(src_dir)/%.c
$(call compile_cc,$@,$<)
Quoted 7 lines
Makefile $(build_dir)/%.dep: $(src_dir)/%.c · line 418
Quoted 5 lines
Makefile +5
-0+ifeq ($(BUILD_INFO),y) +$(build_dir)/lib/sbi/sbi_init.o: $(libsbi_dir)/sbi_init.c FORCE + $(call compile_cc,$@,$<) + $(warning 'BUILD_INFO=y' violates 'reproducible builds', for DEBUG ONLY.) +endifDo we need this?
yes, I have tested it. Without this, the time stamp will remain the time been built after 'make clean'
Because sbi_init.c may not been changed when you rebuild it . so this change is for recompiling sbi_init.c every time , then timestamp will be updated if you enable BUILD_INFO.
(I have mentioned below in the document)
But if you have used BUILD_INFO=y, and want to switch back to BUILD_INFO=n, you must do 'make clean' before the next build.
Quoted 81 lines
Quoted 46 lines
+
$(build_dir)/%.dep: $(src_dir)/%.S
$(call compile_as_dep,$@,$<)Makefile +0
-0@@ -551,3 +570,6 @@ ifeq ($(install_root_dir),$(install_root_dir_default)/usr) $(if $(V), @echo " RM $(install_root_dir_default)") $(CMD_PREFIX)rm -rf $(install_root_dir_default)endif
Makefile +3
-0+ +.PHONY: FORCE +FORCE:README.md +0
-0@@ -254,6 +254,28 @@ to produce broken binaries with missing relocations; it is therefore currentlyrecommended that this combination be avoided or *FW_PIC=n* be used to disable building OpenSBI as a position-independent binary.
README.md +22
-0+Building with timestamp and compiler info +------------------------ + +When doing development, we may want to know the build time and compiler info +for debug purpose. OpenSBI can also be built with timestamp and compiler info. +To build with those info and print it out at boot time, we can just simply add +`BUILD_INFO=y`, like: +``` +make BUILD_INFO=y +``` + +But if you have used `BUILD_INFO=y`, and want to switch back to `BUILD_INFO=n`, +you must do +``` +make clean +``` +before the next build. + +NOTE: Using `BUILD_INFO=y` will violate [reproducible builds]. This definition +is ONLY for development and debug purpose. It should NEVER be used in a real +product. +Contributing to OpenSBI
-----------------------README.md +0
-0@@ -336,3 +358,4 @@ make I=<install_directory> install_docsQuoted 5 lines
[Doxygen manual]: http://www.doxygen.nl/manual/index.html
[Kendryte standalone SDK]: https://github.com/kendryte/kendryte-standalone-sdk
[third party notices]: ThirdPartyNotices.md
+[reproducible builds]: https://reproducible-builds.org
\ No newline at end of fileProbably want a new line here.
Otherwise looks good.
Alistair
Quoted 23 lines
lib/sbi/sbi_init.c +8
-1@@ -48,6 +48,14 @@ static void sbi_boot_print_banner(struct sbi_scratch *scratch) OPENSBI_VERSION_MINOR);#endif +#ifdef OPENSBI_BUILD_TIME_STAMP +sbi_printf ("Build time: %s.\n" ,OPENSBI_BUILD_TIME_STAMP ); +#endif + +#ifdef OPENSBI_BUILD_COMPILER_VERSION +sbi_printf ("Build compiler: %s.\n" ,OPENSBI_BUILD_COMPILER_VERSION ); +#endif +sbi_printf (BANNER ); } --2.25.4
A message that is not in the archive (sent off-list or not yet received): CADWks+Y_7DXproeWFqjGhP+ThUyajuOP85R5t=dewOnDbaZbgg@mail.gmail.com
PATCH v2 1/1 Makefile: Add build time and compiler info string.
Hi Dimitri,
Great thanks for your info, so would you mind to provide more info about these macro for gcc and clang ?
Dimitri John Ledkov <[email protected]> ?2021?9?30??? ??6:21???
Quoted 7 lines
Surely one can make this reproducible.
If using compiler builtin macro, they respect environment variable of build time.
Or in the make file one can use the reproducible builds timestamp environment variable (if available) and only otherwise call out date.Lots of other software do that already. Meaning they both encode build time, but also remain reproducible.
I guess you have seen one of them if there are lots, would you mind to provide a example, I am curious about "encode build time" and "remain reproducible" at the same time.
Quoted 141 lines · On Wed, 29 Sep 2021, 11:20 , <[email protected]> wrote:
Quoted 139 lines
From: Wei Fu <[email protected]>
When we are doing opensbi development, we want to know the build time and compiler info for debug purpose.
To enable this message, please add "BUILD_INFO=y" , like:``` make BUILD_INFO=y ```NOTE:
BUILD_INFO=ywill violate "reproducible builds".
So it's ONLY for development and debug purpose, and should NEVER be used in a real product.Signed-off-by Wei Fu <[email protected]>--- Makefile | 22 ++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ lib/sbi/sbi_init.c | 8 ++++++++ 3 files changed, 53 insertions(+)Makefile +22
-0@@ -150,6 +150,15 @@ endif # Check whether the linker supports creating PIEs OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) +# Build Info: +# OPENSBI_BUILD_TIME_STAMP -- the compilation time stamp +# OPENSBI_BUILD_COMPILER_VERSION -- the compiler version info +BUILD_INFO ?= n +ifeq ($(BUILD_INFO),y) +OPENSBI_BUILD_TIME_STAMP=$(shell date) +OPENSBI_BUILD_COMPILER_VERSION=$(shell $(CC) -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$$//') +endif + # Setup list of objects.mk files ifdef PLATFORM platform-object-mks=$(shell if [ -d $(platform_src_dir)/ ]; then find $(platform_src_dir) -iname "objects.mk" | sort -r; fi)@@ -247,6 +256,10 @@ GENFLAGS += -I$(include_dir) ifneq ($(OPENSBI_VERSION_GIT),) GENFLAGS += -DOPENSBI_VERSION_GIT="\"$(OPENSBI_VERSION_GIT)\"" endif +ifeq ($(BUILD_INFO),y) +GENFLAGS += -DOPENSBI_BUILD_TIME_STAMP="\"$(OPENSBI_BUILD_TIME_STAMP)\"" +GENFLAGS += -DOPENSBI_BUILD_COMPILER_VERSION="\"$(OPENSBI_BUILD_COMPILER_VERSION)\"" +endif GENFLAGS += $(libsbiutils-genflags-y) GENFLAGS += $(platform-genflags-y) GENFLAGS += $(firmware-genflags-y)@@ -398,6 +411,12 @@ $(build_dir)/%.dep: $(src_dir)/%.c $(build_dir)/%.o: $(src_dir)/%.c $(call compile_cc,$@,$<) +ifeq ($(BUILD_INFO),y) +$(build_dir)/lib/sbi/sbi_init.o: $(libsbi_dir)/sbi_init.c FORCE + $(call compile_cc,$@,$<) + $(warning 'BUILD_INFO=y' violates 'reproducible builds', for DEBUG ONLY.) +endif + $(build_dir)/%.dep: $(src_dir)/%.S $(call compile_as_dep,$@,$<)@@ -551,3 +570,6 @@ ifeq ($(install_root_dir),$(install_root_dir_default)/usr) $(if $(V), @echo " RM $(install_root_dir_default)") $(CMD_PREFIX)rm -rf $(install_root_dir_default) endif + +.PHONY: FORCE +FORCE:README.md +23
-0@@ -254,6 +254,28 @@ to produce broken binaries with missing relocations; it is therefore currently recommended that this combination be avoided or *FW_PIC=n* be used to disable building OpenSBI as a position-independent binary. +Building with timestamp and compiler info +------------------------ + +When doing development, we may want to know the build time and compiler info +for debug purpose. OpenSBI can also be built with timestamp and compiler info. +To build with those info and print it out at boot time, we can just simply add +`BUILD_INFO=y`, like: +``` +make BUILD_INFO=y +``` + +But if you have used `BUILD_INFO=y`, and want to switch back to `BUILD_INFO=n`, +you must do +``` +make clean +``` +before the next build. + +NOTE: Using `BUILD_INFO=y` will violate [reproducible builds]. This definition +is ONLY for development and debug purpose. It should NEVER be used in a real +product. + Contributing to OpenSBI -----------------------@@ -336,3 +358,4 @@ make I=<install_directory> install_docs [Doxygen manual]: http://www.doxygen.nl/manual/index.html [Kendryte standalone SDK]: https://github.com/kendryte/kendryte-standalone-sdk [third party notices]: ThirdPartyNotices.md +[reproducible builds]: https://reproducible-builds.orglib/sbi/sbi_init.c +8
-1@@ -48,6 +48,14 @@ static void sbi_boot_print_banner(struct sbi_scratch *scratch) OPENSBI_VERSION_MINOR);#endif +#ifdef OPENSBI_BUILD_TIME_STAMP +sbi_printf ("Build time: %s.\n" ,OPENSBI_BUILD_TIME_STAMP ); +#endif + +#ifdef OPENSBI_BUILD_COMPILER_VERSION +sbi_printf ("Build compiler: %s.\n" ,OPENSBI_BUILD_COMPILER_VERSION ); +#endif +sbi_printf (BANNER ); } --2.25.4
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
PATCH v2 1/1 Makefile: Add build time and compiler info string.
Quoted 9 lines · Fu Wei
Hi Dimitri,
Great thanks for your info, so would you mind to provide more info about these macro for gcc and clang ?
Dimitri John Ledkov <[email protected]> ?2021?9?30??? ??6:21???
Quoted 3 lines
Surely one can make this reproducible.
Quoted 8 lines
Quoted 4 lines
If using compiler builtin macro, they respect environment variable of build time.
Or in the make file one can use the reproducible builds timestamp environment variable (if available) and only otherwise call out date.Lots of other software do that already. Meaning they both encode build time, but also remain reproducible.
I guess you have seen one of them if there are lots, would you mind to provide a example, I am curious about "encode build time" and "remain reproducible" at the same time.
Yes, it is possible to include a build time in a binary and still be reproducible. The build system can override the time and use a constant time.
This leads to confusion though, as the build time is then incorrect and makes packager jobs harder. The reproducible builds group has some more information on this:
https://reproducible-builds.org/docs/timestamps/
They recommend that software doesn't include the time in the build output. I agree with their argument that it provides little insight for released builds while adding an overhead.
That is why this approach of allowing developers to include it in their debug builds is a good compromise. It allows developers to see the build time if they want, while not complicating reproducible builds or confusing users with strange timestamps.
Alistair