|
|
80b9904 |
From 4e657713e97a0e0b0ea907d5f8348fc3fedad70a Mon Sep 17 00:00:00 2001
|
|
|
80b9904 |
From: cryptoad <cryptoad@91177308-0d34-0410-b5e6-96231b3b80d8>
|
|
|
80b9904 |
Date: Thu, 9 Aug 2018 20:01:11 +0000
|
|
|
80b9904 |
Subject: [PATCH] [sanitizer] Remove rsp from the clobber list in
|
|
|
80b9904 |
internal_clone
|
|
|
80b9904 |
|
|
|
80b9904 |
Summary:
|
|
|
80b9904 |
When compiling with WERROR=ON, a new fatal warning started popping up recently
|
|
|
80b9904 |
(due to -Werror,-Winline-asm):
|
|
|
80b9904 |
```
|
|
|
80b9904 |
.../lib/sanitizer_common/sanitizer_linux.cc:1214:24: error: inline asm clobber list contains reserved registers: RSP [-Werror,-Winline-asm]
|
|
|
80b9904 |
"syscall\n"
|
|
|
80b9904 |
^
|
|
|
80b9904 |
<inline asm>:1:1: note: instantiated into assembly here
|
|
|
80b9904 |
syscall
|
|
|
80b9904 |
^
|
|
|
80b9904 |
.../lib/sanitizer_common/sanitizer_linux.cc:1214:24: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
|
|
|
80b9904 |
"syscall\n"
|
|
|
80b9904 |
^
|
|
|
80b9904 |
<inline asm>:1:1: note: instantiated into assembly here
|
|
|
80b9904 |
syscall
|
|
|
80b9904 |
^
|
|
|
80b9904 |
```
|
|
|
80b9904 |
|
|
|
80b9904 |
Removing `rsp` from the clobber list makes the warning go away, and does not
|
|
|
80b9904 |
appear to have a functional impact. If there is another way to solve this, let
|
|
|
80b9904 |
me know.
|
|
|
80b9904 |
|
|
|
80b9904 |
Reviewers: eugenis, vitalybuka
|
|
|
80b9904 |
|
|
|
80b9904 |
Reviewed By: eugenis
|
|
|
80b9904 |
|
|
|
80b9904 |
Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers
|
|
|
80b9904 |
|
|
|
80b9904 |
Differential Revision: https://reviews.llvm.org/D50519
|
|
|
80b9904 |
|
|
|
80b9904 |
git-svn-id: http://llvm.org/svn/llvm-project/compiler-rt/trunk@339370 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
80b9904 |
---
|
|
|
80b9904 |
lib/sanitizer_common/sanitizer_linux.cc | 2 +-
|
|
|
80b9904 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
80b9904 |
|
|
|
80b9904 |
diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc
|
|
|
80b9904 |
index 6b8b9fd2e..8d39c4d90 100644
|
|
|
80b9904 |
--- a/lib/sanitizer_common/sanitizer_linux.cc
|
|
|
80b9904 |
+++ b/lib/sanitizer_common/sanitizer_linux.cc
|
|
|
80b9904 |
@@ -1244,7 +1244,7 @@ uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
|
|
|
80b9904 |
"d"(parent_tidptr),
|
|
|
80b9904 |
"r"(r8),
|
|
|
80b9904 |
"r"(r10)
|
|
|
80b9904 |
- : "rsp", "memory", "r11", "rcx");
|
|
|
80b9904 |
+ : "memory", "r11", "rcx");
|
|
|
80b9904 |
return res;
|
|
|
80b9904 |
}
|
|
|
80b9904 |
#elif defined(__mips__)
|
|
|
80b9904 |
--
|
|
|
80b9904 |
2.19.2
|
|
|
80b9904 |
|