[compiler-rt] [compiler-rt][nsan] Add `-fno-rtti` to compile flags (PR #98768)

Dmitriy Chestnykh via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 13 13:08:32 PDT 2024


https://github.com/chestnykh created https://github.com/llvm/llvm-project/pull/98768

Other runtime libraries build scripts
like asan, dfsan, msan etc.
use this flag to avoid vtables in the runtime library
Fix #98767

>From 61750a121e4516bccbc9d6bc06b9845e11156f11 Mon Sep 17 00:00:00 2001
From: Dmitry Chestnykh <dm.chestnykh at gmail.com>
Date: Sat, 13 Jul 2024 23:01:56 +0300
Subject: [PATCH] [compiler-rt][nsan] Add `-fno-rtti` to compile flags

Other runtime libraries build scripts
like asan, dfsan, msan etc.
use this flag to avoid vtables in the runtime library
Fix #98767
---
 compiler-rt/lib/nsan/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler-rt/lib/nsan/CMakeLists.txt b/compiler-rt/lib/nsan/CMakeLists.txt
index 1e138d4560c89..ed2fce495a1d9 100644
--- a/compiler-rt/lib/nsan/CMakeLists.txt
+++ b/compiler-rt/lib/nsan/CMakeLists.txt
@@ -28,6 +28,8 @@ append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC NSAN_CFLAGS)
 set(NSAN_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
 
 set(NSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
+append_rtti_flag(OFF NSAN_CFLAGS)
+
 set(NSAN_DYNAMIC_CFLAGS ${NSAN_CFLAGS})
 
 set(NSAN_COMMON_RUNTIME_OBJECT_LIBS



More information about the llvm-commits mailing list