mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 05:26:06 +00:00
[compiler-rt] Add a prefix on the windows mmap symbols (#78037)
For Windows, the compiler-rt profile library contains a polyfill reimplementation of the mmap family of functions. Previously, the runtime library exposed those symbols like, "mmap", in the user symbol namespace. This could cause misdetections by configure scripts that check for the "mmap" function just by linking, without including headers. Add a prefix on the symbols, and make an undeclared function static. This fixes such an issue reported at https://github.com/mstorsjo/llvm-mingw/issues/390.
This commit is contained in:
parent
407db48eb4
commit
c6a6547798
@ -124,8 +124,7 @@ int madvise(void *addr, size_t length, int advice)
|
||||
return 0;
|
||||
}
|
||||
|
||||
COMPILER_RT_VISIBILITY
|
||||
int lock(HANDLE handle, DWORD lockType, BOOL blocking) {
|
||||
static int lock(HANDLE handle, DWORD lockType, BOOL blocking) {
|
||||
DWORD flags = lockType;
|
||||
if (!blocking)
|
||||
flags |= LOCKFILE_FAIL_IMMEDIATELY;
|
||||
|
@ -60,6 +60,12 @@
|
||||
# define DWORD_LO(x) (x)
|
||||
#endif
|
||||
|
||||
#define mmap __llvm_profile_mmap
|
||||
#define munmap __llvm_profile_munmap
|
||||
#define msync __llvm_profile_msync
|
||||
#define madvise __llvm_profile_madvise
|
||||
#define flock __llvm_profile_flock
|
||||
|
||||
void *mmap(void *start, size_t length, int prot, int flags, int fd,
|
||||
off_t offset);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user