This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers] Fix sanitizer_linux_libcdep.cc compilation on Solaris
ClosedPublic

Authored by ro on Mar 31 2019, 2:53 AM.

Details

Summary

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 `<stdlib.h>` which declares that function. With that
patch, compilation continues.

Diff Detail

Repository
rL LLVM

Event Timeline

ro created this revision.Mar 31 2019, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2019, 2:53 AM
Herald added subscribers: Restricted Project, jdoerfert, fedor.sergeev, kubamracek. · View Herald Transcript

Ping. Another Solaris-specific patch which might be considered obvious?

eugenis accepted this revision.Apr 4 2019, 11:29 AM
eugenis added a subscriber: eugenis.

LGTM

This revision is now accepted and ready to land.Apr 4 2019, 11:29 AM
This revision was automatically updated to reflect the committed changes.