Skip to content

Conversation

@ktrzcinx
Copy link
Member

This patch should fix logger without ABI change.

Signed-off-by: Karol Trzcinski karolx.trzcinski@linux.intel.com

@paulstelian97
Copy link
Collaborator

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
Copy link
Contributor

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
Copy link
Contributor

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)

Copy link
Contributor

@jajanusz jajanusz left a 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.

Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Copy link
Collaborator

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 :-)

@ktrzcinx ktrzcinx requested review from dbaluta and jajanusz March 27, 2020 12:00
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
Copy link

mmaka1 commented Mar 27, 2020

Fixes #2507

@marc-hb
Copy link
Collaborator

marc-hb commented Mar 28, 2020

Does anyone know why the exact same check-sof-logger test row still fails with a different error? Just curious.

@ktrzcinx
Copy link
Member Author

Does anyone know why the exact same check-sof-logger test row still fails with a different error? Just curious.

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
Copy link
Contributor

@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
Copy link
Member

Jenkins known issues.

@lgirdwood lgirdwood merged commit d1b02d4 into thesofproject:master Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ABI ABI change involved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants