Skip to content

Commit

Permalink
Fix duplicate symbols for downstream CAPIObjects users (#2711)
Browse files Browse the repository at this point in the history
Should fix failure in openxla/xla#22438

I need just a bit more time to validate this entirely on Linux
  • Loading branch information
cerisier authored Feb 12, 2025
1 parent 04c5a34 commit debd620
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,35 @@ cc_library(
],
)

# Header-only target, used when using the C API from a separate shared library.
cc_library(
name = "stablehlo_dialect_capi_headers",
hdrs = STABLEHLO_DIALECT_CAPI_HEADERS,
strip_include_prefix = ".",
deps = [
"@llvm-project//mlir:CAPIIRHeaders",
],
)

# Alwayslink target, used when exporting the C API from a shared library.
cc_library(
name = "stablehlo_dialect_capi_objects",
srcs = STABLEHLO_DIALECT_CAPI_SOURCES,
hdrs = STABLEHLO_DIALECT_CAPI_HEADERS,
strip_include_prefix = ".",
deps = [
":stablehlo_ops",
":stablehlo_portable_api",
":stablehlo_serialization",
":version",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:CAPIIRObjects",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Support",
],
alwayslink = True,
)

STABLEHLO_UNIFIED_CAPI_SOURCES = [
"stablehlo/integrations/c/StablehloPasses.cpp",
"stablehlo/integrations/c/StablehloUnifiedApi.cpp",
Expand Down Expand Up @@ -1010,7 +1039,7 @@ cc_library(
":linalg_passes",
":reference_api",
":reference_configuration",
":stablehlo_dialect_capi",
":stablehlo_dialect_capi_objects",
":stablehlo_ops",
":stablehlo_passes",
":stablehlo_portable_api",
Expand Down

0 comments on commit debd620

Please sign in to comment.