aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
diff options
context:
space:
mode:
authorAiden Grossman <agrossman154@yahoo.com>2023-12-07 00:46:20 -0800
committerAiden Grossman <agrossman154@yahoo.com>2023-12-07 00:47:04 -0800
commit5058d738bae15d88acc3d2977c713f43f09cb7a8 (patch)
treef334fa8b4e745827ba9b1e70b117004b1397f0e1 /llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
parente462937173e7879d26c86595f234164d2ca397e7 (diff)
downloadllvm-5058d738bae15d88acc3d2977c713f43f09cb7a8.zip
llvm-5058d738bae15d88acc3d2977c713f43f09cb7a8.tar.gz
llvm-5058d738bae15d88acc3d2977c713f43f09cb7a8.tar.bz2
[llvm-exegesis] Add MAP_FIXED_NOREPLACE definiton
MAP_FIXED_NOREPLACE doesn't exist on older kernels, so we need to define it to be MAP_FIXED.
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
index d1b0a58..8e242cd 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -44,7 +44,14 @@
#define GLIBC_INITS_RSEQ
#endif
#endif
+
+// Before kernel 4.17, Linux did not support MAP_FIXED_NOREPLACE, so if it is
+// not available, simplfy define it as MAP_FIXED which performs the same
+// function but does not guarantee existing mappings won't get clobbered.
+#ifndef MAP_FIXED_NOREPLACE
+#define MAP_FIXED_NOREPLACE MAP_FIXED
#endif
+#endif // __linux__
namespace llvm {
namespace exegesis {