Commit 9df8885
committed
re-export tbbmalloc from RcppParallel.dll on windows
downstream packages on windows link with '-lRcppParallel' alone, and so
can only use tbb symbols that RcppParallel.dll exports. the tbb runtime
symbols come along implicitly -- RcppParallel references them, so those
archive members are linked in and re-exported via their '-export:'
directives -- but nothing references the tbbmalloc entry points, so
packages using the scalable allocator (e.g. via RcppArmadillo's
ARMA_USE_TBB_ALLOC) fail to link with undefined references to
scalable_malloc and scalable_free.
link tbbmalloc with --whole-archive so its objects are always included
and re-exported. tbbmalloc must precede tbb on the link line: both
archives bundle an itt_notify object defining the same symbols, and
with tbbmalloc's copy already linked, tbb's is never pulled in.
older (non-oneTBB) toolchains like rtools42 keep the plain link: there,
tbb and tbbmalloc both define DllMain and so cannot be linked wholesale,
and their objects carry no '-export:' directives to re-export anyhow.1 parent d637cbe commit 9df8885
2 files changed
Lines changed: 43 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
229 | 263 | | |
230 | 264 | | |
231 | 265 | | |
232 | 266 | | |
233 | 267 | | |
234 | 268 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 269 | + | |
240 | 270 | | |
241 | 271 | | |
242 | 272 | | |
| |||
0 commit comments