[compiler-rt] [safestack] Various Solaris fixes (PR #99290)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 15:35:48 PDT 2024


================
@@ -11,6 +11,8 @@
 // Linux-specific interception methods.
 //===----------------------------------------------------------------------===//
 
+#define SANITIZER_COMMON_NO_REDEFINE_BUILTINS
----------------
vitalybuka wrote:

this one is weird.
if we compile this into full sanitizers, we want redefine
if it's part of safe stack we want no-redefine

what if keep interception as is, but in safe stack use both:

1. #define SANITIZER_COMMON_NO_REDEFINE_BUILTINS

2. define *__sanitizer_internal_mem* forwarded to libc, to cover interception

```
extern "C" {
SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_internal_memcpy(void *dest,
                                                                const void *src,
                                                                uptr n) {
  return memcpy();
}

SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_internal_memmove(void *dest,
                                                                const void *src,
                                                                uptr n) {
  return memmove();
}

SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_internal_memmove(void *dest,
                                                                const void *src,
                                                                uptr n) {
  return memset();
}
```


https://github.com/llvm/llvm-project/pull/99290


More information about the llvm-commits mailing list