[compiler-rt] [compiler-rt] Fix build breakage (PR #96235)

Alexander Shaposhnikov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 13:48:05 PDT 2024


https://github.com/alexander-shaposhnikov created https://github.com/llvm/llvm-project/pull/96235

Add missing flags in Cmake.
Follow-up to cae6d458a.

>From 3e2874b00a9a30ff31aa429639aec2f6845a57ec Mon Sep 17 00:00:00 2001
From: Alexander Shaposhnikov <ashaposhnikov at google.com>
Date: Thu, 20 Jun 2024 16:12:59 +0000
Subject: [PATCH] [compiler-rt] Fix build breakage

Add missing flags in Cmake.
Follow-up to cae6d458a.
---
 compiler-rt/lib/nsan/tests/CMakeLists.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/lib/nsan/tests/CMakeLists.txt b/compiler-rt/lib/nsan/tests/CMakeLists.txt
index e6674e12b548b..3d962e70a7bf0 100644
--- a/compiler-rt/lib/nsan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/nsan/tests/CMakeLists.txt
@@ -3,12 +3,19 @@ include(CompilerRTCompile)
 set(NSAN_UNITTEST_CFLAGS
   ${COMPILER_RT_UNITTEST_CFLAGS}
   ${COMPILER_RT_GTEST_CFLAGS}
-  -I${COMPILER_RT_SOURCE_DIR}/lib/
+  ${SANITIZER_TEST_CXX_CFLAGS}
+  -I${COMPILER_RT_SOURCE_DIR}/include
+  -I${COMPILER_RT_SOURCE_DIR}/lib
   -DSANITIZER_COMMON_REDEFINE_BUILTINS_IN_STD
   -O2
   -g
   -fno-omit-frame-pointer)
 
+set(NSAN_UNITTEST_LINK_FLAGS
+  ${COMPILER_RT_UNITTEST_LINK_FLAGS}
+  ${COMPILER_RT_UNWINDER_LINK_LIBS}
+  ${SANITIZER_TEST_CXX_LIBRARIES})
+
 file(GLOB NSAN_HEADERS ../*.h)
 set(NSAN_UNITTESTS
 	NSanUnitTest.cpp



More information about the llvm-commits mailing list