cmake: ninja: Change how CMake names the kernelspace archives
The linker script places kernelspace and userspace archives in different sections. But the linker script itself does not determine what archives are in what space, that is done by CMake. CMake passes the list of kernelspace archives to the linker script through defines, like this: -DNUM_KERNEL_OBJECT_FILES=3 -DKERNEL_OBJECT_FILE_0=path/to/archive_a.a -DKERNEL_OBJECT_FILE_1=path/to/archive_b.a -DKERNEL_OBJECT_FILE_2=path/to/archive_c.a These paths are relative, and since Ninja and Make invoke the linker with different "working directories"[0], the relative paths need to be different. This patch rectifies the relative path when using Ninja. This fixes #5343 [0] https://gitlab.kitware.com/cmake/cmake/issues/17448 Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
a0b9129e85
commit
1c2de10c06
2 changed files with 13 additions and 3 deletions
|
@ -115,8 +115,8 @@
|
|||
archives like KBuild did.*/
|
||||
#endif
|
||||
|
||||
#define X(i, j) KERNEL_OBJECT_FILE_##i (j)
|
||||
#define Y(i, j) *KERNEL_OBJECT_FILE_##i
|
||||
#define X(i, j) KERNEL_OBJECT_FILE_##i (j)
|
||||
#define Y(i, j) KERNEL_OBJECT_FILE_##i
|
||||
|
||||
#define KERNEL_INPUT_SECTION(sect) \
|
||||
UTIL_LISTIFY(NUM_KERNEL_OBJECT_FILES, X, sect)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue