[llvm] [Triple] Add "swift" as a vendor. (PR #85094)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 19:52:47 PDT 2024


MaskRay wrote:

> I'll dig out some links to PRs I have open on Swift. But it's probably helpful to explain what I'm up to — I'm trying to get Swift into a state where it's possible to build fully statically linked binaries for Linux, and I'm using musl as part of that, but I'm not using the same software stack that a typical musl distro would use (so I'm using compiler-rt and LLVM libunwind, not libgcc, and I'm using libc++ rather than libstdc++), plus everything is statically linked. For the most part for the Clang side of things, the config file will work (at least for the moment, though in the long term it might be useful to teach the driver the right settings), but Swift has no equivalent to that and needs to make various decisions in its code that wouldn't be appropriate for a normal musl distro.
> I don't want to rule out Swift on e.g. Alpine, and I certainly don't want to break Clang for anywhere it works currently on musl-based systems, hence the desire to distinguish the fully-static Swift set-up from some musl-based distro or other.

Thanks for stating your motivation. It's helpful. 

Using compiler-rt / libunwind / libc++ is not that atypical.
Both Gentoo and Chimera Linux provide such setting.
Changing rtlib/unwind/stdlib can be done with a configuration file as your PR demonstrates.

Have you thought about not coupling these decisions with a new vendor?
A normal musl target triple can use static linking as well.


https://github.com/llvm/llvm-project/pull/85094


More information about the llvm-commits mailing list