Skip to content

Commit 467e4bf

Browse files
committed
logger: Make CC_DESC string length indivisible by four
When variable length array, filled with string will be placed in sucha manner that null terminator address will be divisible by four, then it will be lost in output binary file. It leads to troubles during scanning content of such a section. Such a problem occur in firmware and produce logger and FW debug ABI mismatch and it's why logger output is broken. After change length of XCC_TOOLS_VERSION to be none of number four multiplication problem with logger disappear. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
1 parent 6c58333 commit 467e4bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/cmake/xtensa-toolchain.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,9 @@ if(XCC)
8181
else()
8282
string(REGEX MATCH "([^\/\\]+)$" XCC_TOOLS_VERSION "${TOOLCHAIN}")
8383
endif()
84+
85+
string(LENGTH "${XCC_TOOLS_VERSION}" XCC_TOOLS_VERSION_STR_LEN)
86+
math(EXPR XCC_TOOLS_VERSION_PADDING "(${XCC_TOOLS_VERSION_STR_LEN} + 1) % 4")
87+
if(XCC_TOOLS_VERSION_PADDING EQUAL 0)
88+
set(XCC_TOOLS_VERSION "<${XCC_TOOLS_VERSION}>")
89+
endif()

0 commit comments

Comments
 (0)