[compiler-rt] [compiler-rt] Add a prefix on the windows mmap symbols (PR #78037)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 21:26:36 PST 2024


petrhosek wrote:

> > While this solution works, it feels a bit hacky. I'd rather avoid using the standard POSIX names in the profile runtime implementation and instead provide our own runtime specific functions. Specifically, I'd define `__llvm_profile_mmap` etc. in `compiler-rt/lib/profile/InstrProfilingInternal.h` (or perhaps `lprofMmap`, we don't seem to be very consistent namewise). On Windows, we would use the existing polyfill implementation from `compiler-rt/lib/profile/WindowsMMap.h`. On POSIX systems we would just implement this as a simple wrapper around `mmap` (on ELF based systems it could be an alias).
> 
> That certainly looks like a better final solution, but are you ok with merging this for now, and leaving that cleanup for later (possibly for someone else, I’m not sure I have time to take it on right now), to have the issue fixed in the 18.x branch?

I'm fine landing this change and leaving the cleanup for later.

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


More information about the llvm-commits mailing list