Skip to content

Commit 2c5bd24

Browse files
antiagainstliuyunqi20
authored andcommitted
[BUILD] Avoid using lld as the linker on macOS (#4827)
LLD is not supported on macOS. This addresses failures like > clang: error: invalid linker name in argument '-fuse-ld=lld' See https://github.com/triton-lang/triton/actions/runs/11099205977/job/30833066194#step:10:61
1 parent 7dcaade commit 2c5bd24

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

python/setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,14 @@ def build_extension(self, ext):
432432
cmake_args += [
433433
"-DCMAKE_C_COMPILER=clang",
434434
"-DCMAKE_CXX_COMPILER=clang++",
435-
"-DCMAKE_LINKER=lld",
436-
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld",
437-
"-DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld",
438-
"-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld",
439435
]
436+
if platform.system() != "Darwin":
437+
cmake_args += [
438+
"-DCMAKE_LINKER=lld",
439+
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld",
440+
"-DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld",
441+
"-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld",
442+
]
440443

441444
# Note that asan doesn't work with binaries that use the GPU, so this is
442445
# only useful for tools like triton-opt that don't run code on the GPU.

0 commit comments

Comments
 (0)