Commit 9207001
authored
pico2: link executorch_core after kernel libs to fix --whole-archive resolution (#19163)
### Summary
The Pico2 firmware link fails with an undefined reference to
BoxedEvalueList<std::optional<Tensor>>::get() from
RegisterCodegenUnboxedKernelsEverything.cpp.obj inside
libportable_ops_lib.a. ld walks the link line once: by the time
--whole-archive pulls the codegen TU's reference into the link,
libexecutorch_core.a (which contains the evalue.cpp specialization) has
already been processed.
Pico2 was green until #18962 (TOB-EXECUTORCH-31 fix), which removed
EValue::~EValue's inline call to BoxedEvalueList::get(). Before that
commit, libexecutorch_core.a had its own use of the symbol that forced
evalue.cpp.o to be pulled early; the link-order bug was always latent
and the destructor change unmasked it.
Move libexecutorch_core.a to after the kernel archives in all four
USE_CMSIS_NN x USE_SELECTIVE_BUILD branches so the codegen TUs can still
resolve their references after --whole-archive.
Authored with Claude.
### Test plan
CI1 parent 0852840 commit 9207001
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
150 | | - | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | | - | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
182 | | - | |
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
| 190 | + | |
187 | 191 | | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
194 | | - | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| 202 | + | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| |||
0 commit comments