[Mlir-commits] [mlir] c3aed0d - MLIR can't support -Bsymbolic link option, fail at CMake time with a helpful message instead of broken runtime

Mehdi Amini llvmlistbot at llvm.org
Sat Sep 25 17:36:50 PDT 2021


Author: Mehdi Amini
Date: 2021-09-26T00:36:31Z
New Revision: c3aed0d395950c23d66c3ec0af4b1a2ec2534795

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

LOG: MLIR can't support -Bsymbolic link option, fail at CMake time with a helpful message instead of broken runtime

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

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 54ea572ae5f34..b7ac3bdc543f5 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -37,6 +37,12 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
 
 include(AddMLIR)
 
+# -BSymbolic is incompatible with TypeID
+if("${CMAKE_SHARED_LINKER_FLAGS}" MATCHES "-Bsymbolic[^-]")
+  message(FATAL_ERROR " MLIR does not support `-Bsymbolic` (see http://llvm.org/pr51420 ),"
+          " try `-Bsymbolic-functions` instead.")
+endif()
+
 # Forbid implicit function declaration: this may lead to subtle bugs and we
 # don't have a reason to support this.
 check_c_compiler_flag("-Werror=implicit-function-declaration" C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION)


        


More information about the Mlir-commits mailing list