triton icon indicating copy to clipboard operation
triton copied to clipboard

[BUILD] Add setup.py cmake options for lld standalone or mold for linking

Open plotfi opened this issue 1 year ago • 3 comments

TRITON_BUILD_WITH_CLANG_LLD already allows for changing the build to use clang+lld instead of gcc+bfd but it doesn't allow for leaving the C/C++ compiler on gcc and mixing and matching linkers like lld as well as mold. This patch allows for enabling only a different linker.

plotfi avatar May 14 '24 14:05 plotfi

This is just a draft PR, not sure what folks think about optionally enabling mold/lld standalone (with gcc still as the C/CXX cmake compiler).

plotfi avatar May 14 '24 14:05 plotfi

Thanks for the change. I like TRITON_LINK_WITH_MOLD which enables experimenting with the mold linker. I'm not sure about a separate TRITON_LINK_WITH_LLD which is mainly used for the combination gcc+lld, as it's generally not encouraged to cross-use the bits from different toolchains.

htyu avatar May 14 '24 15:05 htyu

it's generally not encouraged to cross-use the bits from different toolchains.

I think lld + GCC "should be" fine. lld is specifically an ld-compatible linker, it's supposed to work.

That said I am not sure that we want to add arbitrary flags to setup.py. If something is in there, then there's some expectation that "it should work". Triton core devs are not going to test mold, for example.

Perhaps we should add an envvar that lets you pass extra flags to cmake. Then you can locally do whatever you want (e.g. mold) but there's no expectation that it's supported.

jlebar avatar May 14 '24 16:05 jlebar