ngtc
ngtc copied to clipboard
Compiler-rt not properly linking
libc++ doesnt properly link with compiler-rt. It leaves missing symbols such as "__divti3", "__muloti4", and "__udivti3" Using alpine-lxc on the latest alpine release 3.10
found the solution, you can compile compiler-rt from llvm9 and install it. it gives the crts we need. then install compiler-rt from llvm-8 over it, it doesnt overwrite the crts and gives proper builtins. from there, its just a matter of compiling clang-9 without stack protection(it crashes compiling itself) using gcc(alpines build crashes as above), then bootstrap with itself.
I wont impliment these, sorry. Already did it by hand.
I haven't updated NGTC in a while, possibly there are more issues with it. I will take a look soon.
Just had this error with libc++.so not linking properly (undefined reference to __udivti3
). I tried adding -lgcc
to the failing command and it worked. Now I'm building using gcc instead of clang, it generates ton of warnings, but links successfully.
you cant tell it to use compiler rt with gcc though
The workaround here is crude, but it works: manually edit build.ninja
and add -lgcc
to LINK_LIBRARIES of lib/libc++.so.1.0
.
I was finally able to compile working toolchain. Also, updated the latest binary build, it successfully compiled C and C++ test programs.