From 53242cdf9ef17c502ebd541e84370e7c158639c1 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 1 Jul 2024 06:37:09 +0000 Subject: [PATCH] 8335283: Build failure due to 'no_sanitize' attribute directive ignored Reviewed-by: shade, tschatzl, kbarrett, jwaters --- src/hotspot/share/sanitizers/ub.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/share/sanitizers/ub.hpp b/src/hotspot/share/sanitizers/ub.hpp index 23e8ef4576c..66cd014c35c 100644 --- a/src/hotspot/share/sanitizers/ub.hpp +++ b/src/hotspot/share/sanitizers/ub.hpp @@ -32,9 +32,11 @@ // following function or method. // Useful if the function or method is known to do something special or even 'dangerous', for // example causing desired signals/crashes. +#ifdef UNDEFINED_BEHAVIOR_SANITIZER #if defined(__clang__) || defined(__GNUC__) #define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined"))) #endif +#endif #ifndef ATTRIBUTE_NO_UBSAN #define ATTRIBUTE_NO_UBSAN