From a0524521eafee30e3bd809033e93cc2f1efd8b83 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Fri, 5 Apr 2019 08:40:08 +0000 Subject: [PATCH] [Sanitizers] Fix sanitizer_linux_libcdep.cc compilation on Solaris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both LLVM 8.0.0 and current trunk fail to compile on Solaris 11/x86 with GCC 8.1.0: /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc: In function ‘void __sanitizer::ReExec()’: /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: error: ‘getexecname’ was not declared in this scope pathname = getexecname(); ^~~~~~~~~~~ /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: note: suggested alternative: ‘gethostname’ pathname = getexecname(); ^~~~~~~~~~~ gethostname This is easily fixed by including which declares that function. With that patch, compilation continues. Differential Revision: https://reviews.llvm.org/D60044 llvm-svn: 357751 --- compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc index c7fa9141eb5f..0608898a1464 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc @@ -52,6 +52,7 @@ #endif #if SANITIZER_SOLARIS +#include #include #endif