Skip to content

Commit 179062b

Browse files
authored
[mlir][bazel] add alwayslink=True to mlir-runner utils (#133787)
MacOS platforms using mlir-runner in lit tests consistently hit the following error: ``` # .---command stderr------------ # | JIT session error: Symbols not found: [ __mlir_ciface_printMemrefI32 ] # | Error: Failed to materialize symbols: { (main, { __mlir_printMemrefI32, ... }) } # `----------------------------- ``` google/heir#1521 (comment) confirms the issue is fixed by using `alwayslink` on these two targets, and I confirmed on a separate Apple M1 (OSX version Sequoia 15.3.2.). I'm not an expert on the mlir runner internals, but given the mlir-runner is purely for testing, and alwayslink at worst adds some overhead by not removing symbols, it seems low risk.
1 parent a03fce4 commit 179062b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10330,6 +10330,7 @@ cc_library(
1033010330
":mlir_float16_utils",
1033110331
"//llvm:Support",
1033210332
],
10333+
alwayslink = True,
1033310334
)
1033410335

1033510336
# Indirection to avoid 'libmlir_c_runner_utils.so' filename clash.
@@ -10359,6 +10360,7 @@ cc_library(
1035910360
":mlir_c_runner_utils",
1036010361
":mlir_float16_utils",
1036110362
],
10363+
alwayslink = True,
1036210364
)
1036310365

1036410366
# Indirection to avoid 'libmlir_runner_utils.so' filename clash.

0 commit comments

Comments
 (0)