This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer_common] Define wordexp_wrde_dooffs for Solaris
ClosedPublic

Authored by ro on Sep 2 2021, 1:53 PM.

Details

Summary

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; the fix is equivalent to D108838.

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

Diff Detail

Event Timeline

ro created this revision.Sep 2 2021, 1:53 PM
ro requested review of this revision.Sep 2 2021, 1:53 PM
Herald added a subscriber: Restricted Project. · View Herald TranscriptSep 2 2021, 1:53 PM
justincady accepted this revision.Sep 2 2021, 6:09 PM

Thanks for fixing this, and I apologize that I missed this platform as well.

This revision is now accepted and ready to land.Sep 2 2021, 6:09 PM
ro added a comment.Sep 3 2021, 1:00 AM

Thanks for fixing this, and I apologize that I missed this platform as well.

Thanks. However, I'd argue that the fault primarily lies with the way compiler-rt is configured:

  • The wordexp interceptor in sanitizer_common_interceptors.inc is guarded with SANITIZER_INTERCEPT_WORDEXP while...
  • ... we have 3 declarations/definitions now of wordexp_wrde_dooffs: one in sanitizer_platform_limits_posix.h/.cpp, which despite the filename is Linux and macOS only and now two more in sanitizer_platform_limits_freebsd.h/.cpp and sanitizer_platform_limits_solaris.h/.cpp.

It's almost impossible not to get lost in that impenetrable maze.

This revision was automatically updated to reflect the committed changes.