mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
libc/uname: Add option to disable uname timestamp
Don't include the build timestamp into final binary when the symbol CONFIG_LIBC_UNAME_DISABLE_TIMESTAMP is defined. Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
eaeca78cc8
commit
97e217b0ff
@@ -81,6 +81,15 @@ config LIBC_FTOK_VFS_PATH
|
|||||||
---help---
|
---help---
|
||||||
The relative path to where ftok will exist in the root namespace.
|
The relative path to where ftok will exist in the root namespace.
|
||||||
|
|
||||||
|
config LIBC_UNAME_DISABLE_TIMESTAMP
|
||||||
|
bool "Disable uname timestamp support"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Currently uname command will print the timestamp
|
||||||
|
when the binary was built, and it generates an issue
|
||||||
|
because two identical built binaries will have differents
|
||||||
|
hashes/CRC.
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Select memfd implementation"
|
prompt "Select memfd implementation"
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,9 @@ endif
|
|||||||
# To ensure uname information is newest,
|
# To ensure uname information is newest,
|
||||||
# add lib_utsname.o to phony target for force rebuild
|
# add lib_utsname.o to phony target for force rebuild
|
||||||
|
|
||||||
|
#if !defined(CONFIG_LIBC_UNAME_DISABLE_TIMESTAMP)
|
||||||
.PHONY: lib_utsname$(OBJEXT)
|
.PHONY: lib_utsname$(OBJEXT)
|
||||||
|
#endif
|
||||||
|
|
||||||
# Add the misc directory to the build
|
# Add the misc directory to the build
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ int uname(FAR struct utsname *name)
|
|||||||
|
|
||||||
strlcpy(name->release, CONFIG_VERSION_STRING, sizeof(name->release));
|
strlcpy(name->release, CONFIG_VERSION_STRING, sizeof(name->release));
|
||||||
|
|
||||||
#if defined(__DATE__) && defined(__TIME__)
|
#if defined(__DATE__) && defined(__TIME__) && \
|
||||||
|
!defined(CONFIG_LIBC_UNAME_DISABLE_TIMESTAMP)
|
||||||
snprintf(name->version, VERSION_NAMELEN, "%s %s %s",
|
snprintf(name->version, VERSION_NAMELEN, "%s %s %s",
|
||||||
CONFIG_VERSION_BUILD, __DATE__, __TIME__);
|
CONFIG_VERSION_BUILD, __DATE__, __TIME__);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user