diff options
Diffstat (limited to 'compiler-rt/lib/xray/xray_init.cc')
| -rw-r--r-- | compiler-rt/lib/xray/xray_init.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/xray/xray_init.cc b/compiler-rt/lib/xray/xray_init.cc index 07f6924316d..864e77944a5 100644 --- a/compiler-rt/lib/xray/xray_init.cc +++ b/compiler-rt/lib/xray/xray_init.cc @@ -88,7 +88,8 @@ void __xray_init() XRAY_NEVER_INSTRUMENT { #endif } -#ifndef XRAY_NO_PREINIT +// Only add the preinit array initialization if the sanitizers can. +#if !defined(XRAY_NO_PREINIT) && SANITIZER_CAN_USE_PREINIT_ARRAY __attribute__((section(".preinit_array"), used)) void (*__local_xray_preinit)(void) = __xray_init; #endif |

