[PATCH] D47819: [compiler-rt] [test] Support using libtirpc on Linux

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 23 15:25:54 PST 2018


mgorny updated this revision to Diff 179455.
mgorny added a comment.

Fix bug in previous patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D47819/new/

https://reviews.llvm.org/D47819

Files:
  cmake/base-config-ix.cmake
  lib/sanitizer_common/CMakeLists.txt
  test/msan/lit.cfg
  test/msan/lit.site.cfg.in
  test/tsan/lit.cfg
  test/tsan/lit.site.cfg.in


Index: test/tsan/lit.site.cfg.in
===================================================================
--- test/tsan/lit.site.cfg.in
+++ test/tsan/lit.site.cfg.in
@@ -6,6 +6,7 @@
 config.apple_platform = "@TSAN_TEST_APPLE_PLATFORM@"
 config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@"
 config.target_arch = "@TSAN_TEST_TARGET_ARCH@"
+config.libtirpc_include_dirs = "@Libtirpc_INCLUDE_DIRS@"
 
 # Load common config for all compiler-rt lit tests.
 lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
Index: test/tsan/lit.cfg
===================================================================
--- test/tsan/lit.cfg
+++ test/tsan/lit.cfg
@@ -49,7 +49,8 @@
                       [config.target_cflags] +
                       config.debug_info_flags +
                       extra_cflags +
-                      ["-I%s" % tsan_incdir])
+                      ["-I%s" % tsan_incdir] +
+                      [("-I" + x) for x in config.libtirpc_include_dirs.split(';')])
 clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags + ["-std=c++11"] + ["-I%s" % tsan_incdir]
 # Add additional flags if we're using instrumented libc++.
 # Instrumented libcxx currently not supported on Darwin.
Index: test/msan/lit.site.cfg.in
===================================================================
--- test/msan/lit.site.cfg.in
+++ test/msan/lit.site.cfg.in
@@ -6,6 +6,7 @@
 config.target_arch = "@MSAN_TEST_TARGET_ARCH@"
 config.use_lld = @MSAN_TEST_USE_LLD@
 config.use_thinlto = @MSAN_TEST_USE_THINLTO@
+config.libtirpc_include_dirs = "@Libtirpc_INCLUDE_DIRS@"
 
 # Load common config for all compiler-rt lit tests.
 lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
Index: test/msan/lit.cfg
===================================================================
--- test/msan/lit.cfg
+++ test/msan/lit.cfg
@@ -14,7 +14,8 @@
                       "-fno-omit-frame-pointer",
                       "-fno-optimize-sibling-calls"] +
                       [config.target_cflags] +
-                      config.debug_info_flags)
+                      config.debug_info_flags +
+                      [("-I" + x) for x in config.libtirpc_include_dirs.split(';')])
 # Some Msan tests leverage backtrace() which requires libexecinfo on FreeBSD.
 if config.host_os == 'FreeBSD':
   clang_msan_cflags += ["-lexecinfo", "-fPIC"]
Index: lib/sanitizer_common/CMakeLists.txt
===================================================================
--- lib/sanitizer_common/CMakeLists.txt
+++ lib/sanitizer_common/CMakeLists.txt
@@ -193,8 +193,6 @@
 
 set(SANITIZER_COMMON_DEFINITIONS)
 
-find_package(Libtirpc)
-
 if (Libtirpc_FOUND)
   include_directories(${Libtirpc_INCLUDE_DIRS})
   list(APPEND SANITIZER_COMMON_DEFINITIONS HAVE_RPC_XDR_H=1)
Index: cmake/base-config-ix.cmake
===================================================================
--- cmake/base-config-ix.cmake
+++ cmake/base-config-ix.cmake
@@ -8,6 +8,9 @@
 
 check_include_file(unwind.h HAVE_UNWIND_H)
 
+# used in sanitizer_common and tests
+find_package(Libtirpc)
+
 # Top level target used to build all compiler-rt libraries.
 add_custom_target(compiler-rt ALL)
 add_custom_target(install-compiler-rt)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47819.179455.patch
Type: text/x-patch
Size: 3225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181223/9ed82d9c/attachment.bin>


More information about the llvm-commits mailing list