aboutsummaryrefslogtreecommitdiffstats
path: root/dist
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2017-07-10 11:59:53 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-07-13 13:23:41 +0000
commit7acbef5a904a509f07b4df45f7431d887995c7c0 (patch)
treeba4edab1b60a97091575abe5f97ee7ad339be7d4 /dist
parentf2041c788144c8625ce264e35e5e813676868d6c (diff)
Clang: Add patch fixing locked files for windows
This clang patch makes llvm avoid using memory map which makes llvm work without locking files. Without that patch the user is sometimes unable to save files in qt creator. Task-number: QTCREATORBUG-15449 Change-Id: Iab77a758174d153f860edb2f419b6ab767571964 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'dist')
-rw-r--r--dist/clang/patches/QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/dist/clang/patches/QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch b/dist/clang/patches/QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch
new file mode 100644
index 0000000000..0075d3daba
--- /dev/null
+++ b/dist/clang/patches/QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch
@@ -0,0 +1,16 @@
+diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
+index b935cbf1ae7..3c9a25062f5 100644
+--- a/lib/Support/MemoryBuffer.cpp
++++ b/lib/Support/MemoryBuffer.cpp
+@@ -286,6 +286,11 @@ static bool shouldUseMmap(int FD,
+ bool RequiresNullTerminator,
+ int PageSize,
+ bool IsVolatileSize) {
++#ifdef _WIN32
++ // Do not use mmap on Windows in order to avoid file locking
++ return false;
++#endif
++
+ // mmap may leave the buffer without null terminator if the file size changed
+ // by the time the last page is mapped in, so avoid it if the file size is
+ // likely to change.