[compiler-rt] [rtsan] Add include guards around posix interceptors, tests (PR #113188)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 09:56:28 PDT 2024


davidtrevelyan wrote:

> > Is there strong motivation for doing this in the source rather than in the CMake configuration?
> 
> There seems to be strong precedent to do it via ifdefs. Take for instance the platform specific malloc files in asan:
> 
> https://github.com/llvm/llvm-project/blob/54c93aabec965469fe7db1f4391a190e3d640feb/compiler-rt/lib/asan/asan_malloc_mac.cpp#L15
> 
> https://github.com/llvm/llvm-project/blob/54c93aabec965469fe7db1f4391a190e3d640feb/compiler-rt/lib/asan/asan_malloc_win.cpp#L16
> 
> https://github.com/llvm/llvm-project/blob/54c93aabec965469fe7db1f4391a190e3d640feb/compiler-rt/lib/asan/asan_malloc_linux.cpp#L17
> 
> I'm not opposed to doing this in CMake (and it would be my first gut reaction in a project I controlled) but this seems to be the way I've seen around the codebase.

OK cool - thanks for summarising these. I'll leave it to others with more experience in the codebase to weigh in here then :)

https://github.com/llvm/llvm-project/pull/113188


More information about the llvm-commits mailing list