Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions compiler-rt/lib/profile/WindowsMMap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions compiler-rt/lib/profile/WindowsMMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down