Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp +++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp @@ -202,7 +202,8 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr); CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum); -CHECK_TYPE_SIZE(glob_t); +// There are non posix additional fields +COMPILER_CHECK(sizeof(__sanitizer_glob_t) <= sizeof(glob_t)); CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc); CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv); CHECK_SIZE_AND_OFFSET(glob_t, gl_offs); Index: compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp +++ compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp @@ -24,6 +24,12 @@ #include "sanitizer_posix.h" #include "sanitizer_procmaps.h" +#if SANITIZER_SOLARIS +#ifdef _XOPEN_SOURCE +#undef _XOPEN_SOURCE +#endif +#endif + #include #include #include Index: compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp +++ compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp @@ -35,7 +35,8 @@ char *last = data_.proc_self_maps.data + data_.proc_self_maps.len; if (data_.current >= last) return false; - prxmap_t *xmapentry = (prxmap_t*)data_.current; + prxmap_t *xmapentry = + const_cast(reinterpret_cast(data_.current)); segment->start = (uptr)xmapentry->pr_vaddr; segment->end = (uptr)(xmapentry->pr_vaddr + xmapentry->pr_size);