IRC channel logs

2025-07-01.log

back to list of logs

<lrvick> https://wiki.musl-libc.org/building-llvm.html was the last time a documented path to do this existed
<lrvick>And I mean, worst case, I could go back and build that version with those hacks and then build up to a modern version
<lrvick>last resort
<stikonas>lrvick: but does it have to be built from musl?\
<stikonas>i.e. what if you first build glibc
<lrvick>You mean try to first get a fully non-libgcc-dependent llvm toolchain based on glibc to bootstrap, then pivot to musl based llvm toolchain, at that point with the libgcc dependency long gone and compiler-rt already working
<lrvick>I have no idea why I never considered that, but that is potentially another path.
<lrvick>once compiler-rt is bootstrapped and llvm is dependent on it, then we broke the libgcc link, and then building llvm-musl with llvm-glibc should be ndb.
<stikonas>well, I wasn't specific about order, but yes, this could be one option
<stikonas>I guess what I had in mind is gcc[musl] -> gcc[glibc] -> llvm[glibc, libgcc] -> llvm[glibc,libstdc++]
<stikonas>which I think is the same you wrote
<lrvick>stagex is a musl distro so we would have to go back to llvm[musl,libstdc++] in the end, but yeah
<lrvick>would be a very awkward path, but an awkward path is better than no path
<stikonas>well, in the bootstrap you often have to compromise in the intermediate steps...
<stikonas>due to various bugs, etc...
<lrvick>but the good news is with a pile of hacks and patches I was able to bootstrap llvm w/ libunwind, libcxx/libcxxabi against musl so compiler-rt is really the last bossfight and I can do all of this in one pass
<lrvick>some of those can only be built with clang, but llvm ships with -DCLANG_BOOTSTRAP which actually works with musl with some patches
<lrvick>where it builds clang first then builds anything that requires clang with clang
<lrvick>I had to fully disable localization in libcxx to pull it off though which will probably not be a problem as this is still only an intermediate llvm in my "stage4" before I build $latest llvm for actual packages
<lrvick>localization w/ musl seems broken in a bunch of places and I am not that strong in c++
<lrvick>In addition to most of the Chimera patchset I had to make these changes to get this far: https://dpaste.org/3ZobY
<lrvick>Not sure why in most cases. Pile of hacks.
<lrvick>seems like a lot of musl detection logic just does not work
<lrvick>but yeah, -maybe- I can tack on compiler-rt to this build, or use this build to build one with compiler-rt. I don't actually understand the dependency graph here that well.
<lrvick>but failing all that glibc intermediate may be the play
<lrvick>I try to make up for the things I am woefully ignorant on with continuious experiments until shit works. Seems like the vibe around here anyway ^_^