-
Notifications
You must be signed in to change notification settings - Fork 349
logger: Make CC_DESC string length indivisible by four #2647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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) |
|
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. |
a7d3727 to
c97e93e
Compare
|
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) |
c97e93e to
b62abf0
Compare
jajanusz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check if can be fixed with ranlib.
scripts/cmake/xtensa-toolchain.cmake
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a few words in the code itself wouldn't hurt either, for now it's just pure maths :-)
b62abf0 to
7b260ec
Compare
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>
7b260ec to
467e4bf
Compare
|
Fixes #2507 |
|
Does anyone know why the exact same |
It's a good question, @xiulipan do you know the root cause? Locally I can create output logs without any problem but test failed. |
|
@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. |
|
Jenkins known issues. |
This patch should fix logger without ABI change.
Signed-off-by: Karol Trzcinski karolx.trzcinski@linux.intel.com