Skip to content

Commit f6a6cf1

Browse files
committed
5-th try
Signed-off-by: hanhanW <[email protected]>
1 parent 31adcb6 commit f6a6cf1

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "externals/llvm-project"]
22
path = externals/llvm-project
3-
url = https://github.com/llvm/llvm-project.git
3+
url = https://github.com/iree-org/llvm-project.git
44
[submodule "externals/stablehlo"]
55
path = externals/stablehlo
66
url = https://github.com/openxla/stablehlo.git

externals/llvm-project

Submodule llvm-project updated 3094 files

python/CMakeLists.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ if(TORCH_MLIR_ENABLE_PYTORCH_EXTENSIONS)
109109
list(APPEND _source_components TorchMLIRPythonTorchExtensionsSources)
110110
endif()
111111

112-
# On Windows, aggregate libraries using object files cause CMake to generate corrupted
113-
# paths in the linker response file. Work around this by temporarily setting XCODE to TRUE,
114-
# which makes add_mlir_library use -force_load instead of object libraries. We'll convert
115-
# -force_load to /WHOLEARCHIVE after the target is created.
116-
if(WIN32)
117-
set(_original_xcode_value ${XCODE})
118-
set(XCODE TRUE)
119-
endif()
120-
121112
add_mlir_python_common_capi_library(TorchMLIRAggregateCAPI
122113
INSTALL_COMPONENT TorchMLIRPythonModules
123114
INSTALL_DESTINATION python_packages/torch_mlir/torch_mlir/_mlir_libs
@@ -126,11 +117,9 @@ add_mlir_python_common_capi_library(TorchMLIRAggregateCAPI
126117
DECLARED_SOURCES ${_source_components}
127118
)
128119

129-
# Restore XCODE variable and convert -force_load flags to /WHOLEARCHIVE
120+
# On Windows, MLIR's add_mlir_library (patched above) uses -force_load flags instead of
121+
# object libraries to avoid linker path corruption. Convert these to MSVC's /WHOLEARCHIVE.
130122
if(WIN32)
131-
set(XCODE ${_original_xcode_value})
132-
133-
# Get the link libraries which now contain -force_load flags
134123
get_target_property(_link_libs TorchMLIRAggregateCAPI LINK_LIBRARIES)
135124
if(_link_libs)
136125
set(_new_link_libs "")

0 commit comments

Comments
 (0)