diff mbox series

[v3] time64.inc: Simplify GLIBC_64BIT_TIME_FLAGS usage

Message ID 20240725115932.3459266-1-tom.hochstein@oss.nxp.com
State Accepted, archived
Commit e8177827f92e71c80c5b63453d8bbd1defbe1fbc
Headers show
Series [v3] time64.inc: Simplify GLIBC_64BIT_TIME_FLAGS usage | expand

Commit Message

Tom Hochstein July 25, 2024, 11:59 a.m. UTC
The implementation uses the append operator to include
GLIBC_64BIT_TIME_FLAGS in TARGET_CC_ARCH, but it places the space in
the GLIBC_64BIT_TIME_FLAGS assignment in order to avoid a 'spurious
space' when the value is empty.

68b50d3 time64: Remove leading whitespace from GLIBC_64BIT_TIME_FLAGS

The problem with this is it requires anyone wishing to assign a value
to GLIBC_64BIT_TIME_FLAGS to add the leading space, otherwise this is
the error:

cc1: error: '-Werror=format-security-D_TIME_BITS=64': no option '-Wformat-security-D_TIME_BITS=64'

Add a new constant variable to capture the value needed for the 32-bit
special case, including the space.

Signed-off-by: Tom Hochstein <tom.hochstein@oss.nxp.com>
---
 meta/conf/distro/include/time64.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/conf/distro/include/time64.inc b/meta/conf/distro/include/time64.inc
index 510da11039..9d556bac16 100644
--- a/meta/conf/distro/include/time64.inc
+++ b/meta/conf/distro/include/time64.inc
@@ -8,10 +8,11 @@ 
 #
 # Working to address those (before Y2038 rolls in) will be appreciated.
 
-GLIBC_64BIT_TIME_FLAGS = " -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
+GLIBC_64BIT_TIME_FLAGS = "${GLIBC_64BIT_TIME_FLAGS_WHEN_NEEDED}"
 
 # Only needed for some 32-bit architectures, some relatively newer
 # architectures do not need it ( e.g. riscv32 )
+GLIBC_64BIT_TIME_FLAGS_WHEN_NEEDED = " -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
 TARGET_CC_ARCH:append:arm = "${GLIBC_64BIT_TIME_FLAGS}"
 TARGET_CC_ARCH:append:armeb = "${GLIBC_64BIT_TIME_FLAGS}"
 TARGET_CC_ARCH:append:mipsarcho32 = "${GLIBC_64BIT_TIME_FLAGS}"