[PATCH] D60045: [Sanitizers] Provide __internal_dup on Solaris

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 31 03:03:01 PDT 2019


ro created this revision.
ro added a reviewer: kcc.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, jdoerfert, fedor.sergeev, kubamracek.
Herald added a project: LLVM.

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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D60045

Files:
  lib/sanitizer_common/sanitizer_solaris.cc


Index: lib/sanitizer_common/sanitizer_solaris.cc
===================================================================
--- lib/sanitizer_common/sanitizer_solaris.cc
+++ lib/sanitizer_common/sanitizer_solaris.cc
@@ -125,6 +125,10 @@
   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);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60045.193005.patch
Type: text/x-patch
Size: 453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190331/028a7bfa/attachment.bin>


More information about the llvm-commits mailing list