The test/asan/TestCases/asan_and_llvm_coverage_test.cc failed to link on Solaris
since libclang_rt.profile was missing. Instead of trying to document that requirement
in the test, I just tried to enable the library on Solaris instead.
Most changes are probably straightforward, but two bear explanation:
- The getpid prototype in lib/profile/InstrProfilingFile.c conflicted with the system one (returning pid_t instead of instead), so I removed it.
- While parts of the profile library prefer fcntl(F_SETLCKW) over flock(LOCK_EX) if available, others unconditionally use flock. flock just doesn't exist on Solaris, so I moved the locking to common code.
Why not migrate O_BINARY to the common header as well?