Uh oh!
There was an error while loading. Please reload this page.
logger: Make CC_DESC string length indivisible by four - #2647
Conversation
paulstelian97
commented
Mar 27, 2020
Why do we want it to not be divisible by 4? If it is divisible it would lack a NUL terminator or something? (or have an off-by-one calculation of size) |
jajanusz
commented
Mar 27, 2020
W/A for issue that should be finally solved by #2522, but is taking too long to get merged and makes logger unusable in CI for weeks. |
jajanusz
commented
Mar 27, 2020
Now I'm thinking if ranlib may be messing with it (it uses one from gcc instead of xtensa), can you try to repro issue with this change: diff --git a/scripts/cmake/xtensa-toolchain.cmake b/scripts/cmake/xtensa-toolchain.cmake
index c65caa2a9..bf2d6b362 100644
--- a/scripts/cmake/xtensa-toolchain.cmake+++ b/scripts/cmake/xtensa-toolchain.cmake@@ -56,6 +56,7 @@ endif()
find_program(CMAKE_LD NAMES "${CROSS_COMPILE}ld" PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_AR NAMES "${CROSS_COMPILE}ar" PATHS ENV PATH NO_DEFAULT_PATH)
+find_program(CMAKE_RANLIB NAMES "${CROSS_COMPILE}ranlib" PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_OBJCOPY NAMES "${CROSS_COMPILE}objcopy" PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_OBJDUMP NAMES "${CROSS_COMPILE}objdump" PATHS ENV PATH NO_DEFAULT_PATH) |
jajanusz
left a comment
There was a problem hiding this comment.
Need to check if can be fixed with ranlib.
There was a problem hiding this comment.
@ktrzcinx I'm totally puzzled by this PR.
Please explain in the commit message what is the ABI change that we are fixing. Also explain WHY this change is needed.
There was a problem hiding this comment.
I think a few words in the code itself wouldn't hurt either, for now it's just pure maths :-)
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>
mmaka1
commented
Mar 27, 2020
Fixes #2507 |
marc-hb
commented
Mar 28, 2020
Does anyone know why the exact same |
ktrzcinx
commented
Mar 30, 2020
It's a good question, @xiulipan do you know the root cause? Locally I can create output logs without any problem but test failed. |
xiulipan
commented
Mar 30, 2020
@ktrzcinx No, I can only figure out there is indeed some limitation when using flex structure in ELF files. The best solution is to avoid using this kind of structure in ELF sections. |
lgirdwood
commented
Mar 30, 2020
Jenkins known issues. |
This patch should fix logger without ABI change.
Signed-off-by: Karol Trzcinski karolx.trzcinski@linux.intel.com