llvm-project/compiler-rt/lib
Etienne Bergeron 8c6eb1566c [compiler-rt] Fix warnings in interception code
Summary:
This patch is re-introducing the code to fix the
dynamic hooking on windows and to fix a compiler
warning on Apple.

Related patches:

* https://reviews.llvm.org/D22641
* https://reviews.llvm.org/D22610
* https://reviews.llvm.org/rL276311
* https://reviews.llvm.org/rL276490

Both architecture are using different techniques to
hook on library functions (memchr, strcpy,...). 

On Apple, the function is not dynamically hooked and
the symbol always points to a valid function 
(i.e. can't be null). The REAL macro returns the
symbol.

On windows, the function is dynamically patch and the
REAL(...) function may or may not be null. It depend
on whether or not the function was hooked correctly.
Also, on windows memcpy and memmove are the same.

```
#if !defined(__APPLE__)
[...]
# define REAL(x) __interception::PTR_TO_REAL(x)
# define ASSIGN_REAL(dst, src) REAL(dst) = REAL(src)
[...]
#else  // __APPLE__
[...]
# define REAL(x) x
# define ASSIGN_REAL(x, y)
[...]
#endif  // __APPLE__

Reviewers: rnk

Subscribers: kcc, hans, kubabrecka, llvm-commits, bruno, chrisha

Differential Revision: https://reviews.llvm.org/D22758

llvm-svn: 276885
2016-07-27 16:16:54 +00:00
..
BlocksRuntime Move tests for BlocksRuntime and builtins to corresponding directories under test/ 2014-02-14 09:47:31 +00:00
asan [compiler-rt] Fix warnings in interception code 2016-07-27 16:16:54 +00:00
builtins Revert "Enable cross-compilation across architectures on android" 2016-07-25 20:25:38 +00:00
cfi [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
dfsan [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
esan [esan|wset] Fix flaky sampling tests 2016-07-19 05:06:48 +00:00
interception [compiler-rt] Fix warnings in interception code 2016-07-27 16:16:54 +00:00
lsan [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
msan [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
profile Define compatibility flag if not defined with -std=c++ 2016-07-25 23:12:53 +00:00
safestack [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
sanitizer_common [compiler-rt] Fix warnings in interception code 2016-07-27 16:16:54 +00:00
scudo [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
stats [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
tsan tsan: don't deliver signals when they are blocked 2016-07-27 14:34:21 +00:00
ubsan [compiler-rt] Fix VisualStudio virtual folders layout 2016-07-11 21:51:56 +00:00
xray Use RAII for ensuring that mprotect calls are undone 2016-07-27 04:30:25 +00:00
CMakeLists.txt [compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due to extraneous and missing dependencies and attempts to build on unsupported OSes 2016-07-21 07:39:55 +00:00
Makefile.mk Remove autoconf support for building runtime libraries. 2016-01-26 21:31:12 +00:00