summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2021-09-25 17:24:55 +0000
committerTom Stellard <tstellar@redhat.com>2021-11-08 09:08:09 -0800
commitd5159b99105d2019ae0930ed09dae2eed0fede81 (patch)
treecb015b0b2ba321c87cb5ccd2a64e996177643c1f
parentff2cb6e400c3a130a9bb9f7be1e45beb9c316160 (diff)
downloadllvm-d5159b99105d2019ae0930ed09dae2eed0fede81.tar.gz
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 (cherry picked from commit c3aed0d395950c23d66c3ec0af4b1a2ec2534795)
-rw-r--r--mlir/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 54ea572ae5f3..b7ac3bdc543f 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)