Move code from a header to a .c file - #1005
Conversation
I guess you just have some artifacts from the old buildsystem maybe .tarball-version in repo? |
|
Is this the reason for this build failure: ? This seems to be not a "normal" build, but something cmocka-related. How do I reproduce it locally or why is it failing? |
|
@lyakh
Yes, it's unit-test build, if you changed location of symbols they will not run until you update them |
|
@jajanusz ah, at least now I see what's failing, thanks! I don't have xt-xcc, but it seems relatively easy to "guess" what has to be done to fix this. Only it's a pity it takes so long to get a result... But anyway, I'll probably need a couple of iterations with the CI to get this right, sorry about the electricity bill :-) |
You can try to play with UTs as it may be helpful later, however it may be challenging to fix when you use UTs first time. Feel free to merge that: lyakh#1 +You can feel like a maintainer ;) It should automatically update also this PR, I guess it can be the first PR in this repo with multiple commiters, so may be interesting as example for others - for example when one PR depends on another PR |
|
@jajanusz thanks a lot! Looking at the patch it would take me a bit more than a couple of rounds ;-) I thought I would have to create a mock up for the missing symbol. |
You can create stubs when dependencies are 1 level, but I guess there are some spagetthi inside so it's easier to strip unused references |
jajanusz
left a comment
There was a problem hiding this comment.
Please change commit message from 'Move code from a header to a .c file ' to topic: what's changes format
|
@jajanusz sorry, what do you mean "what's changes format?" The patch isn't introducing any functional changes, it only moves code to a .c file to prevent it from being built multiple times. The only thing I can imagine that might be worth adding to the description is what code has been moved, i.e. maybe adding an "idc:" prefix, is that what you meant? |
Yes. Something like |
|
@jajanusz sure, can do that, but I've just pushed one more similar PR, and that one moves several headers... So there such a prefix would be difficult |
|
@jajanusz There we go: separate commits, with prefixes, one cmacka problem fixed by you, more expected... I'll close the other PR. |
|
@lyakh It looks like there are some fixes needed for GCC compilers. I'll fix unit tests after you fix compilation for travis/jenkis cis |
lgirdwood
left a comment
There was a problem hiding this comment.
Please just keep this to larger functions.
There was a problem hiding this comment.
please keep the small functions inline, this way we can avoid unnecessary calls and window exceptions on xtensa
src/arch/xtensa/smp/include/arch/idc.h has way too much code for a header, it is included by platform/idc.h on various platforms, and that header in turn is included by bultiple .c files, which builds the code multiple times into the firmware. Move it to a C file. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Many functions in src/include/sof/panic.h are too large to be inlined and repeated every time the header is included. Move them out to src/lib/panic.c Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Move large functions from src/arch/xtensa/include/arch/task.h to src/arch/xtensa/smp/init.c to avoid building them multiple times. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Move large functions from src/include/sof/wait.h to src/lib/wait.c to avoid building them multiple times. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
|
@jajanusz presumably your UT fixes have to go in simultaneously with this PR? |
Yes they have to be in the same PR. Otherwise QB CI check will fail what is merge-blocker. I'll try to add commit for fixing UTs later today |
|
@jajanusz that would be great, thanks! Otherwise we might have to rebase again, and then again, and... :-) |
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
|
@lyakh CI scan |
@lgirdwood Nice, all the issues I've looked at so far are (logically) not mine - I only copied them over from .h to .c. That being said, many of them are real and have to be fixed. Some are also false positives, e.g. an infinite loop in the panic() implementation ;-) What I'm wondering though: hasn't the complete SOF source base been verified by KW? It seems to be a bit strange to me to use it for new submissions without having applied it to the existing code. |
|
@lyakh yes incremental should be fine. |
compile- and run-tested on Up^2 with a couple of days old "master" branch. The current "master" doesn't build for me - "8d408eb cmake: add dist target" broke it.