[compiler-rt] r251447 - [asan] On OS X, log reports to syslog and os_trace

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 17:04:28 PDT 2015


On Tue, Oct 27, 2015 at 4:35 PM, Anna Zaks <ganna at apple.com> wrote:
> Thanks for helping out!!!
>
> Could you apply the following on top of that:
>
> diff --git a/lib/sanitizer_common/sanitizer_common_nolibc.cc
> b/lib/sanitizer_common/sanitizer_common_nolibc.cc
> index 65d1e37..4115167 100644
> --- a/lib/sanitizer_common/sanitizer_common_nolibc.cc
> +++ b/lib/sanitizer_common/sanitizer_common_nolibc.cc
> @@ -17,10 +17,8 @@
>
>
>
>  namespace __sanitizer {
>
>
>
> -#if SANITIZER_LINUX
>  void WriteToSyslog(const char *buffer) {}
> -#endif
> -
> +bool ShouldLogAfterPrintf() { return false; }
>  void Abort() { internal__exit(1); }
>
>
>
>  }  // namespace __sanitizer

I got

[ 96%] Generating ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.i686-inline.o
At global scope:
cc1plus: error: unrecognized command line option
\u2018-Wno-unknown-warning-option\u2019 [-Werror]
cc1plus: error: unrecognized command line option
\u2018-Wno-unused-const-variable\u2019 [-Werror]
cc1plus: all warnings being treated as errors


> On Oct 27, 2015, at 4:28 PM, H.J. Lu <hjl.tools at gmail.com> wrote:
>
> On Tue, Oct 27, 2015 at 3:57 PM, Kuba Brecka <jbrecka at apple.com> wrote:
>
> It caused:
>
> /tmp/gotsan.wmNri3GVMz/race_linux_amd64.syso: In function
> `__sanitizer::SharedPrintfCode(bool, char const*, __va_list_tag*)':
> gotsan.cc:(.text+0x4a85): undefined reference to
> `__sanitizer::WriteToSyslog(char const*)'
> collect2: error: ld returned 1 exit status
> @
>
> on Fedora 22.
>
>
> It looks like the issue is in lib/tsan/go/buildgo.sh, which doesn’t even
> build sanitizer_common_libcdep.cc...
>
> Could you try adding it to buildgo.sh’s list of Linux sources?  If the fix
> is not that easy, we can revert this patch, but since this looks like it’s a
> Go-specific Linux-specific failure, it would be great if you could help us
> with triaging the failure.
>
> Thanks,
> Kuba
>
>
> After applying:
>
> diff --git a/lib/tsan/go/buildgo.sh b/lib/tsan/go/buildgo.sh
> index a7e12f1..f34b23c 100755
> --- a/lib/tsan/go/buildgo.sh
> +++ b/lib/tsan/go/buildgo.sh
> @@ -40,6 +40,7 @@ if [ "`uname -a | grep Linux`" != "" ]; then
>   SRCS="
>      $SRCS
>      ../rtl/tsan_platform_linux.cc
> +     ../../sanitizer_common/sanitizer_common_libcdep.cc
>      ../../sanitizer_common/sanitizer_posix.cc
>      ../../sanitizer_common/sanitizer_posix_libcdep.cc
>      ../../sanitizer_common/sanitizer_procmaps_common.cc
>
> Also, I think we should unconditionally include sanitizer_common_libcdep.cc
> like this. (But the error below is unrelated.)
> diff --git a/lib/tsan/go/buildgo.sh b/lib/tsan/go/buildgo.sh
> index a7e12f1..8c89d8f 100755
> --- a/lib/tsan/go/buildgo.sh
> +++ b/lib/tsan/go/buildgo.sh
> @@ -20,6 +20,7 @@ SRCS="
>         ../rtl/tsan_sync.cc
>         ../../sanitizer_common/sanitizer_allocator.cc
>         ../../sanitizer_common/sanitizer_common.cc
> +       ../../sanitizer_common/sanitizer_common_libcdep.cc
>         ../../sanitizer_common/sanitizer_deadlock_detector2.cc
>         ../../sanitizer_common/sanitizer_flag_parser.cc
>         ../../sanitizer_common/sanitizer_flags.cc
>
> I got
>
> libRTSanitizerCommon.test.nolibc.x86_64.a(sanitizer_printf.cc.o): In
> function `__sanitizer::SharedPrintfCode(bool, char const*,
> __va_list_tag*)':
> /export/gnu/import/git/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc:281:
> undefined reference to `__sanitizer::ShouldLogAfterPrintf()'
> clang-3.8: error: linker command failed with exit code 1 (use -v to
> see invocation)
> projects/compiler-rt/lib/sanitizer_common/tests/CMakeFiles/Sanitizer-x86_64-Test-Nolibc.dir/build.make:59:
> recipe for target
> 'projects/compiler-rt/lib/sanitizer_common/tests/CMakeFiles/Sanitizer-x86_64-Test-Nolibc'
> failed
> gmake[4]: ***
> [projects/compiler-rt/lib/sanitizer_common/tests/CMakeFiles/Sanitizer-x86_64-Test-Nolibc]
> Error 1
>
>
>
> --
> H.J.
>
>



-- 
H.J.


More information about the llvm-commits mailing list