[sanitizer_common] Define wordexp_wrde_dooffs for Solaris
authorRainer Orth <ro@gcc.gnu.org>
Fri, 3 Sep 2021 08:02:31 +0000 (10:02 +0200)
committerRainer Orth <ro@gcc.gnu.org>
Fri, 3 Sep 2021 08:02:31 +0000 (10:02 +0200)
The Solaris buildbots have been broken for some time:

  In file included from /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/compiler-rt/lib/asan/asan_interceptors.cpp:174:
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:4000:19: error: use of undeclared identifier 'wordexp_wrde_dooffs'
          ((flags & wordexp_wrde_dooffs) ? p->we_offs : 0) + p->we_wordc;
                    ^

This was caused by D108646 <https://reviews.llvm.org/D108646>; the fix is
equivalent to D108838 <https://reviews.llvm.org/D108838>.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D109193

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.h

index 565b31f..a113cb0 100644 (file)
@@ -123,6 +123,7 @@ namespace __sanitizer {
   unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
 
   int glob_nomatch = GLOB_NOMATCH;
+  const int wordexp_wrde_dooffs = WRDE_DOOFFS;
 
   unsigned path_max = PATH_MAX;
 
index 85995e7..cbab577 100644 (file)
@@ -341,6 +341,7 @@ struct __sanitizer_glob_t {
 
 extern int glob_nomatch;
 extern int glob_altdirfunc;
+extern const int wordexp_wrde_dooffs;
 
 extern unsigned path_max;