From b719a6a81c4c5007274f6cce96cd135b94d2f6b7 Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Fri, 15 Feb 2019 22:12:36 +0000 Subject: [Sanitizer] iOS: Pull up parallelism_group handling into common.lit.config Serial execution on iOS devices is not specific to sanitizers. We want to throttle all on-device tests. Pull the setting of the parallelism_group up into the common lit configuration file. Rename `darwin-ios-device-sanitizer` to `ios-device`. This group is not specific to sanitizers and (theoretically) independent from the host OS. Note that we don't support running unit tests on-device (there are no configurations generated for that). If that ever changes, we also need this configuration in `unittests/lit.common.unit.cfg`. Reviewers: delcypher Differential Revision: https://reviews.llvm.org/D58209 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354179 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tsan/lit.cfg | 2 -- 1 file changed, 2 deletions(-) (limited to 'test/tsan/lit.cfg') diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index 233d273f3..114e325ce 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -88,5 +88,3 @@ if config.android: if config.host_os == 'Darwin': if config.target_arch in ["x86_64", "x86_64h"]: config.parallelism_group = "darwin-64bit-sanitizer" - elif config.apple_platform != "osx" and not config.apple_platform.endswith("sim"): - config.parallelism_group = "darwin-ios-device-sanitizer" -- cgit v1.2.1 From bcc157dfbc24b73d6330ff25fdb14eecd9872f42 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Sun, 17 Feb 2019 12:16:20 +0000 Subject: [compiler-rt] Build custom libcxx with libcxxabi This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354212 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tsan/lit.cfg | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/tsan/lit.cfg') diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index 114e325ce..eb5bdb214 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -38,7 +38,7 @@ config.substitutions.append(('%env_tsan_opts=', # GCC driver doesn't add necessary compile/link flags with -fsanitize=thread. if config.compiler_id == 'GNU': - extra_cflags = ["-fPIE", "-pthread", "-ldl", "-lstdc++", "-lrt", "-pie"] + extra_cflags = ["-fPIE", "-pthread", "-ldl", "-lrt", "-pie"] else: extra_cflags = [] @@ -59,11 +59,10 @@ if config.has_libcxx and config.host_os != 'Darwin': "tsan", "libcxx_tsan_%s" % config.target_arch) libcxx_incdir = os.path.join(libcxx_path, "include", "c++", "v1") libcxx_libdir = os.path.join(libcxx_path, "lib") - libcxx_so = os.path.join(libcxx_libdir, "libc++.so") + libcxx_a = os.path.join(libcxx_libdir, "libc++.a") clang_tsan_cxxflags += ["-nostdinc++", "-I%s" % libcxx_incdir, - libcxx_so, - "-Wl,-rpath=%s" % libcxx_libdir] + libcxx_a] def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " -- cgit v1.2.1 From fb76b337196ad05c5047a9a981c448139d0090d8 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Sun, 17 Feb 2019 18:47:33 +0000 Subject: [compiler-rt] Fix broken sanitizer bots (hopefully) According to the logs and local debugging there were two issues: 1) tsan tests listed libc++.a before the source file. That's usually ok for shared libraries, but the linker will not add symbols from a static library unless needed at that time. As a result the tests that rely upon symbols from the library (and not only include the headers) had undefined references. To solve this I'm adding a new substitution %link_libcxx_tsan which expands to libc++.a if available. 2) The target Fuzzer-x86_64-Test linked in SANITIZER_TEST_CXX_LIBRARIES which defaults to -lstdc++. This resulted in error messages like hidden symbol '_ZdlPv' is not defined locally hidden symbol '_Znwm' is not defined locally when using GNU gold (ld.bfd and lld are fine). Removing the linkage is fine because we build a custom libc++ for that purpose. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354231 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tsan/lit.cfg | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/tsan/lit.cfg') diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index eb5bdb214..76d60cf41 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -61,8 +61,10 @@ if config.has_libcxx and config.host_os != 'Darwin': libcxx_libdir = os.path.join(libcxx_path, "lib") libcxx_a = os.path.join(libcxx_libdir, "libc++.a") clang_tsan_cxxflags += ["-nostdinc++", - "-I%s" % libcxx_incdir, - libcxx_a] + "-I%s" % libcxx_incdir] + config.substitutions.append( ("%link_libcxx_tsan", libcxx_a) ) +else: + config.substitutions.append( ("%link_libcxx_tsan", "") ) def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " -- cgit v1.2.1 From 6fd2c49ae63c9eb007df5f26f81890f28d8c4b66 Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Wed, 27 Feb 2019 19:06:20 +0000 Subject: [Darwin][NFC] Refactor throttling of 64bit sanitizer tests on Darwin Underlying condition for throttling is "has large mmap'd regions" (i.e., shadow memory) and not sanitizers in general (e.g., UBSan does not need to be throttled). Rename parallelism group `darwin-64bit-sanitizer` to `shadow-memory` and apply it unconditionally to all tests which require it. We can then have all the Darwin throttling logic in one place in the commen lit config. Throttle sanitizer_common unit tests. Configuration was previously missing from sanitizer_common/Unit/lit.site.cfg. Reviewed by: kubamracek Differential Revision: https://reviews.llvm.org/D58677 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355018 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tsan/lit.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'test/tsan/lit.cfg') diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index 76d60cf41..8dc522845 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -86,6 +86,4 @@ if config.host_os not in ['FreeBSD', 'Linux', 'Darwin', 'NetBSD']: if config.android: config.unsupported = True -if config.host_os == 'Darwin': - if config.target_arch in ["x86_64", "x86_64h"]: - config.parallelism_group = "darwin-64bit-sanitizer" +config.parallelism_group = 'shadow-memory' -- cgit v1.2.1 From d5529a9d32649863abd29c3f3bc2694e1bf5ff3c Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Thu, 28 Feb 2019 19:26:53 +0000 Subject: [Sanitizer] lit test config: Respect existing parallelism_group git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355128 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tsan/lit.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/tsan/lit.cfg') diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index 8dc522845..50c8a5eea 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -86,4 +86,5 @@ if config.host_os not in ['FreeBSD', 'Linux', 'Darwin', 'NetBSD']: if config.android: config.unsupported = True -config.parallelism_group = 'shadow-memory' +if not config.parallelism_group: + config.parallelism_group = 'shadow-memory' -- cgit v1.2.1