Commit 735a022
committed
examples/sotest: fix xxd symbol name mismatch in CMake ROMFS generation
xxd -i derives the generated array/length identifier names from the
exact path string it's given. The CMake build passed the absolute
${SOTEST_ROMFS_IMG} path to xxd, so every non-alphanumeric character
in the build directory path (e.g. every '/') got folded into the
symbol name instead of producing plain 'sotest_romfs_img'/
'sotest_romfs_img_len' - the names sotest_main.c actually declares
extern and links against. This built fine with the Makefile build
(which already only ever passes xxd a bare relative filename) but
failed to link on any CMake-built configuration with
CONFIG_EXAMPLES_SOTEST_BUILTINFS enabled, e.g.:
undefined reference to `sotest_romfs_img_len'
undefined reference to `sotest_romfs_img'
Fix by extracting just the bare filename (get_filename_component
... NAME) and running xxd with WORKING_DIRECTORY set to
CMAKE_CURRENT_BINARY_DIR, matching what the Makefile path already
does correctly.
Reported-by: Alan (CI failure on Linux arm64 qemu-armv8a/sotest)
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>1 parent 40329b7 commit 735a022
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
94 | 105 | | |
95 | 106 | | |
96 | | - | |
97 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
| |||
0 commit comments