summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRainer Orth <ro@gcc.gnu.org>2019-04-05 08:42:21 +0000
committerRainer Orth <ro@gcc.gnu.org>2019-04-05 08:42:21 +0000
commita7711fa84e0f8d030541d23f0394eec240572fab (patch)
tree098adb4f98be02d251063669a40472abe4da37e8 /lib
parent94c8d247231cf12a528c73f0c4fb3ac844240c49 (diff)
downloadcompiler-rt-a7711fa84e0f8d030541d23f0394eec240572fab.tar.gz
[Sanitizers] Provide __internal_dup on Solaris
Both LLVM 8.0.0 and current trunk fail to link libclang_rt.ubsan.standalone-*.so on Solaris 11/x86 with GCC 8.1.0: Undefined first referenced symbol in file Scanning dependencies of target clang_rt.asan_cxx-x86_64 __sanitizer::internal_dup(int) ../sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_posix.cc.o ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-i386.dir/build.make:233: lib/clang/9.0.0/lib/sunos/libclang_rt.ubsan_standalone-i386.so] Error 1 Fixed by providing an implementation, which allowed the i386-pc-solaris2.11 build to finish. Differential Revision: https://reviews.llvm.org/D60045 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@357753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/sanitizer_common/sanitizer_solaris.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_solaris.cc b/lib/sanitizer_common/sanitizer_solaris.cc
index db89d08b3..12d03fab8 100644
--- a/lib/sanitizer_common/sanitizer_solaris.cc
+++ b/lib/sanitizer_common/sanitizer_solaris.cc
@@ -125,6 +125,10 @@ uptr internal_filesize(fd_t fd) {
return (uptr)st.st_size;
}
+DECLARE__REAL_AND_INTERNAL(uptr, dup, int oldfd) {
+ return _REAL(dup)(oldfd);
+}
+
DECLARE__REAL_AND_INTERNAL(uptr, dup2, int oldfd, int newfd) {
return _REAL(dup2)(oldfd, newfd);
}