-
Notifications
You must be signed in to change notification settings - Fork 322
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
Windows/Linux disassembly differences when using #include ../something.h? #9034
Comments
You have to click on the "Summary" / home button in the top-left to access the build artefacts. Don't ask me why. Then don't forget to run "dos2unix" before comparing text files.
I don't think there is a lot CI can do at this point. Based on this example and the previous ones I referenced above, I have a strong suspicion that some debug sections are "not as good" on Windows, likely because of some funky We can't automate the comparison of debug sections because they're almost always full of absolute paths. IF I'm guessing this correctly, then we have 2 approaches to solve this problem:
But again: the first thing is to prove my educated guess about debug sections. EDIT: I would start with comparing |
Strangely enough, dropping all of the i.e: Inside
to
and move the definition of (note: Results in https://github.com/thesofproject/sof/actions/runs/8689213734/job/23827370722?pr=9033 (ignore 8ULP which doesn't have this change). So far I wasn't able to find any ".." include paths in the sources/headers used for SOF.
The main issue that I have with 2) is that it's time consuming and I'm not sure it's worth the effort (like you said, who uses Windows?). These issues are (to me) somewhat annoying to debug (I don't have a Windows environment so I have to rely on the CI to test stuff out) and very unintuitive (I can't really tell you why the aforementioned fix works). |
It could also be a bug somewhere in the toolchain that gets triggered only on Windows somehow. So a 3rd option would be to try to update the SDK? As @dbaluta did in earlier and small commit 45cbf04. It's a minor release so it's unlikely to hurt anyway. Otherwise can you help with option 1. CONFIG_OUTPUT_DISASSEMBLE_WITH_SOURCE? It's CMake and Kconfig which very few enjoy but it looks pretty trivial. |
Small tangent: after optimization it's extremely hard to connect machine code with source code, anyone who has ever tried to debug optimized code knows this. Disassembly runs into the same issue. So maybe using -S on optimized code is too complex to be reliable? Now we're seeing a Windows-only bug, but how many "portable" -S bugs have we ignored so far? Maybe a lot. |
Yep, created zephyrproject-rtos/zephyr#71535. Results in: #9051 (ignore |
By default, the generated disassembly file (i.e: the .lst file) also contains inline source code. This has the potential to become problematic when attempting to compare the generated .lst files accross platforms since they may differ for various reasons. As such, add the option to control whether the disassembly file should contain inline source code or not. The need for this patch was sparked by the differences observed in the generated .lst file for Linux and Windows in one of SOF's CI jobs (details in thesofproject/sof/issues/9034), which were caused by the addition of the inline source code. With this, we can keep testing for reproducible builds while not having to deal with differences in the .lst files caused by things such as having ".." include paths. Signed-off-by: Laurentiu Mihalcea <[email protected]>
By default, the generated disassembly file (i.e: the .lst file) also contains inline source code. This has the potential to become problematic when attempting to compare the generated .lst files accross platforms since they may differ for various reasons. As such, add the option to control whether the disassembly file should contain inline source code or not. The need for this patch was sparked by the differences observed in the generated .lst file for Linux and Windows in one of SOF's CI jobs (details in thesofproject/sof/issues/9034), which were caused by the addition of the inline source code. With this, we can keep testing for reproducible builds while not having to deal with differences in the .lst files caused by things such as having ".." include paths. Signed-off-by: Laurentiu Mihalcea <[email protected]>
By default, the disassembly file (.lst) generated during the build process when enabling `CONFIG_OUTPUT_DISASSEMBLY` will also contain inline source code. This is not ideal for reproducible builds that compare the .lst files obtained on different platforms (i.e: Windows and Linux) because of the differences in the inline source code that may appear. One of the identified causes for such differences were the ".." include paths, which resulted in the Windows .lst omitting some bits of the inline source code that were present in the Linux .lst file. Because these issues are hard to debug and unintuitive, the solution is to disable the inline source code. This way, the CI can keep testing for reproductibility using just the assembly and machine code from the .lst file, which are more important than the inline source code. This fixes thesofproject/issues/9034. Signed-off-by: Laurentiu Mihalcea <[email protected]>
By default, the disassembly file (.lst) generated during the build process when enabling `CONFIG_OUTPUT_DISASSEMBLY` will also contain inline source code. This is not ideal for reproducible builds that compare the .lst files obtained on different platforms (i.e: Windows and Linux) because of the differences in the inline source code that may appear. One of the identified causes for such differences were the ".." include paths, which resulted in the Windows .lst omitting some bits of the inline source code that were present in the Linux .lst file. Because these issues are hard to debug and unintuitive, the solution is to disable the inline source code. This way, the CI can keep testing for reproductibility using just the assembly and machine code from the .lst file, which are more important than the inline source code. This fixes thesofproject/issues/9034. Signed-off-by: Laurentiu Mihalcea <[email protected]>
By default, the disassembly file (.lst) generated during the build process when enabling `CONFIG_OUTPUT_DISASSEMBLY` will also contain inline source code. This is not ideal for reproducible builds that compare the .lst files obtained on different platforms (i.e: Windows and Linux) because of the differences in the inline source code that may appear. One of the identified causes for such differences were the ".." include paths, which resulted in the Windows .lst omitting some bits of the inline source code that were present in the Linux .lst file. Because these issues are hard to debug and unintuitive, the solution is to disable the inline source code. This way, the CI can keep testing for reproductibility using just the assembly and machine code from the .lst file, which are more important than the inline source code. This fixes thesofproject/issues/9034. Signed-off-by: Laurentiu Mihalcea <[email protected]>
By default, the disassembly file (.lst) generated during the build process when enabling `CONFIG_OUTPUT_DISASSEMBLY` will also contain inline source code. This is not ideal for reproducible builds that compare the .lst files obtained on different platforms (i.e: Windows and Linux) because of the differences in the inline source code that may appear. One of the identified causes for such differences were the ".." include paths, which resulted in the Windows .lst omitting some bits of the inline source code that were present in the Linux .lst file. Because these issues are hard to debug and unintuitive, the solution is to disable the inline source code. This way, the CI can keep testing for reproductibility using just the assembly and machine code from the .lst file, which are more important than the inline source code. This fixes /issues/9034. Signed-off-by: Laurentiu Mihalcea <[email protected]>
By default, the generated disassembly file (i.e: the .lst file) also contains inline source code. This has the potential to become problematic when attempting to compare the generated .lst files accross platforms since they may differ for various reasons. As such, add the option to control whether the disassembly file should contain inline source code or not. The need for this patch was sparked by the differences observed in the generated .lst file for Linux and Windows in one of SOF's CI jobs (details in thesofproject/sof/issues/9034), which were caused by the addition of the inline source code. With this, we can keep testing for reproducible builds while not having to deal with differences in the .lst files caused by things such as having ".." include paths. (cherry picked from commit fb7e937) Original-Signed-off-by: Laurentiu Mihalcea <[email protected]> GitOrigin-RevId: fb7e937 Change-Id: I8fd219cb90ae3553bf81465b18835b85adf5eb0b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5474826 Tested-by: ChromeOS Prod (Robot) <[email protected]> Tested-by: Dawid Niedźwiecki <[email protected]> Reviewed-by: Dawid Niedźwiecki <[email protected]> Commit-Queue: Dawid Niedźwiecki <[email protected]>
By default, the disassembly file (.lst) generated during the build process when enabling `CONFIG_OUTPUT_DISASSEMBLY` will also contain inline source code. This is not ideal for reproducible builds that compare the .lst files obtained on different platforms (i.e: Windows and Linux) because of the differences in the inline source code that may appear. One of the identified causes for such differences were the ".." include paths, which resulted in the Windows .lst omitting some bits of the inline source code that were present in the Linux .lst file. Because these issues are hard to debug and unintuitive, the solution is to disable the inline source code. This way, the CI can keep testing for reproductibility using just the assembly and machine code from the .lst file, which are more important than the inline source code. This fixes thesofproject/issues/9034. Signed-off-by: Laurentiu Mihalcea <[email protected]>
Originally posted by @marc-hb in #9021 (comment)
Same, previously seen disassembly difference in https://github.com/thesofproject/sof/actions/runs/8630426621?pr=9021 already observed in #8863
I downloaded the files, did some inspection, jogged my memory and searched archives and I think I may have found something... Do you have any
..
in some#include
paths by any chance? We could have a situation similar to these:So the inline C code seems correct in both cases, but for some reason the same
zephyr-sdk/xtensa-...-objdump -S
is "not as good" when running on Windows and can't find the source of the inline function CLOCK_EnableClock() when disassembling LPUART_Init()... even though both Linux and Windows find that same source earlier in the binary when disassembling mcux_ccm_on()!There's one notable difference here: mcux_ccm_on() is located in Zephyr whereas LPUART_Init() is located in modules/hal/nxp! Which is why I'm suspecting
#include
paths?I think the simple reason it is appearing now is because you're now enabling some
lpuart
in this commit.The text was updated successfully, but these errors were encountered: