Strange this hasn't caused issues before, but LINK_FLAGS_* only applies to executables and shared libraries, so the /WHOLEARCHIVE link parameter got lost.
Ran into this in the 3.2 lib update which ran out of memory during the unit tests, root cause is either some brilliant engineering at pixar or pure random luck on their part.
Here's what's happening:
- USD Tries to figure out the calling overhead for their tracing functions over here it tries to estimate the the tick quantum noise by taking the ArchGetTickQuantum and multiplying it by 2000.
- WHOLEARCHIVE was not applied, and the ctor's have been eliminated by the linker, meaning Arch_InitTickTimer has not been called at this point.
- Meaning, Arch_TickQuantum still has it's default value ~0
- ~0 * 2000 = uh ow, and for every time the loop runs, TraceCollector add a sample to it's database, which runs ok for a few seconds, then runs out of memory and takes down the process.
- Fun!
Placing the whole archive link at the interface level fixes the issue.