diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2019-06-19 08:59:05 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2019-06-19 08:59:05 +0000 |
commit | cd31e7868b3ee0f73486141498fb71959d235b25 (patch) | |
tree | 4dd456a5682cdc8655e46ef3a00df64a68b1b3ec /llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp | |
parent | b6e20937b38a5a55331c3ea56c5a053f9cae8509 (diff) | |
download | bcm5719-llvm-cd31e7868b3ee0f73486141498fb71959d235b25.tar.gz bcm5719-llvm-cd31e7868b3ee0f73486141498fb71959d235b25.zip |
[Sanitizers] Fix sanitizer_posix_libcdep.cc compilation on Solaris 11.5
A recent build of Solaris 11.5 Beta (st_047) gained madvise(MADV_DONTDUMP)
support for Linux compatibility. This broke the compiler-rt build:
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_comm/sanitizer_posix_libcdep.cc: In function ‘bool __sanitizer::DontDumpShadowMemory(__sanitizer::uptr, __sanitizer::uptr)’:
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc:81:18: error: invalid conversion from ‘void*’ to ‘caddr_t’ {aka ‘char*’} [-fpermissive]
81 | return madvise((void *)addr, length, MADV_DONTDUMP) == 0;
| ^~~~~~~~~~~~
| |
| void*
In file included from
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc:32:
/usr/include/sys/mman.h:231:20: note: initializing argument 1 of ‘int
madvise(caddr_t, std::size_t, int)’
231 | extern int madvise(caddr_t, size_t, int);
| ^~~~~~~
The obvious fix is to use the same solution that has already been used a
couple of lines earlier:
// In the default Solaris compilation environment, madvise() is declared
// to take a caddr_t arg; casting it to void * results in an invalid
// conversion error, so use char * instead.
This allowed the compiler-rt build to finish and was tested successfully on
i386-pc-solaris2.11 and x86_64-pc-linux-gnu.
Differential Revision: https://reviews.llvm.org/D62892
llvm-svn: 363778
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp')
0 files changed, 0 insertions, 0 deletions