--- b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -392,8 +392,8 @@
       target_link_libraries(${libname} PRIVATE ${builtins_${libname}})
     endif()
     if(${type} STREQUAL "SHARED")
+      if(COMMAND llvm_setup_rpath)
+        llvm_setup_rpath(${libname})
-      if(APPLE OR WIN32)
-        set_property(TARGET ${libname} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
       endif()
       if(WIN32 AND NOT CYGWIN AND NOT MINGW)
         set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
