Skip to content

Commit

Permalink
MLIR can't support -Bsymbolic link option, fail at CMake time with a …
Browse files Browse the repository at this point in the history
…helpful message instead of broken runtime

Differential Revision: https://reviews.llvm.org/D110483
  • Loading branch information
joker-eph committed Sep 26, 2021
1 parent 320832c commit c3aed0d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c3aed0d

Please sign in to comment.