Bug 743988 removed the rules we had to make some things link with $(CC) instead of $(CXX), which didn't matter much back then, but now that we have NSPR built with the Gecko build system, it means it's linked with $(CXX), which can have interesting consequences, like bug 1253299 comment 34.
On everything but Linux this is a non-issue since we don't build NSPR as a shared library anyway. We discussed this in bug 1256642, since config/external/sqlite/Makefile.in consists of entirely `LIB_IS_C_ONLY = 1`. It should be feasible to detect that everything in `SOURCES` is C sources and set this, but to fix the sqlite case we'd also need to propagate that transitively to the final lib.
:glandium do you know who might be able to work on this and in what timeframe? Trying to assess this as getting the ASAN builds on TC is a Q2 releng goal
As stated in bug 1253299, any one of bug 1272629 or this bug should fix the issue. Bug 1272629 is less involved and requires less build system knowledge (in fact, it requires none), so I'd say bug 1272629 has more chances to unblock bug 1253299. [FWIW, the tricky part here is that the build system would need to have a stronger connection between sources and libraries, which it doesn't have at the moment ; that's been on my TODO list for a long time and I have preliminary (outdated) patches in that direction sitting somewhere, but more work would be needed]
So in bug 1256642 I did that work that glandium mentioned--I made the build system able to tell if a library includes nothing but C sources (including transitively from things linked into it). Unfortunately in practice it's foiled by bug 1305960.