Re-commit of r238201 with fix for building with shared libraries.

llvm-svn: 238739
16 files changed