[compiler-rt] 2e1cfd0 - Fix Solaris build of ubsan.

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 12:06:41 PDT 2020


Author: Evgenii Stepanov
Date: 2020-04-21T12:06:30-07:00
New Revision: 2e1cfd02d0f1ca2c666c79b1162024bf77f02fc2

URL: https://github.com/llvm/llvm-project/commit/2e1cfd02d0f1ca2c666c79b1162024bf77f02fc2
DIFF: https://github.com/llvm/llvm-project/commit/2e1cfd02d0f1ca2c666c79b1162024bf77f02fc2.diff

LOG: Fix Solaris build of ubsan.

Summary: Broken in D78325.

Reviewers: ro

Subscribers: mgorny, fedor.sergeev, #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78510

Added: 
    

Modified: 
    compiler-rt/lib/ubsan/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/ubsan/CMakeLists.txt b/compiler-rt/lib/ubsan/CMakeLists.txt
index 174a216c8804..dca02a65e971 100644
--- a/compiler-rt/lib/ubsan/CMakeLists.txt
+++ b/compiler-rt/lib/ubsan/CMakeLists.txt
@@ -214,6 +214,11 @@ else()
                                       EXTRA ubsan.syms.extra)
         set(VERSION_SCRIPT_FLAG
             -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/clang_rt.ubsan_standalone-dynamic-${arch}.vers)
+        # The Solaris 11.4 linker supports a subset of GNU ld version scripts,
+        # but requires a special option to enable it.
+        if (OS_NAME MATCHES "SunOS")
+            list(APPEND VERSION_SCRIPT_FLAG -Wl,-z,gnu-version-script-compat)
+        endif()
         set_property(SOURCE
           ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
           APPEND PROPERTY


        


More information about the llvm-commits mailing list