Chris Bieneman via llvm-dev
2015-Nov-02 18:38 UTC
[llvm-dev] [RFC] Strategies for Bootstrapping Compiler-RT builtins
> On Nov 2, 2015, at 10:10 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote: > >> Today building this toolchain with CMake is impossible because you cannot configure the cross-compiled builtins. The failure is a result of CMake’s try_compile function always testing a full compile then link operation. When bootstrapping a cross-compiler this will always fail because linking even the simplest applications fails when you don’t have libclang_rt prebuilt. > The situation is much worse, because it requires not only compiler-rt, > but also all the runtime libraries (libc, libc++, libc++abi) to be > available. > >> This is the most complicated approach, but I also think it is the best approach. > This won't work due to dependencies on libc / libc++ / libc++abi.That is not entirely correct. Only some of the builtins have dependencies on libc, and none of them should have dependencies on libc++ or libc++abi. I believe we can construct a working partial builtin library without libc, to make bootstrapping work. -Chris> > I think either (1) should be implemented. Or (4) - make the libraries > just to be "shimmed" on fly - proving empty libs for the configure > time just to pacify cmake. > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University
Anton Korobeynikov via llvm-dev
2015-Nov-02 18:48 UTC
[llvm-dev] [RFC] Strategies for Bootstrapping Compiler-RT builtins
> That is not entirely correct. Only some of the builtins have dependencies on libc, and none of them should have dependencies on libc++ or libc++abi. I believe we can construct a working partial builtin library without libc, to make bootstrapping work.It's not that the builtins depend on them, but cmake depends on them. Requiring the full compile & link cycle effectively requires the .a / .so . /.dylib files to be present. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Chris Bieneman via llvm-dev
2015-Nov-02 18:51 UTC
[llvm-dev] [RFC] Strategies for Bootstrapping Compiler-RT builtins
> On Nov 2, 2015, at 10:48 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote: > >> That is not entirely correct. Only some of the builtins have dependencies on libc, and none of them should have dependencies on libc++ or libc++abi. I believe we can construct a working partial builtin library without libc, to make bootstrapping work. > It's not that the builtins depend on them, but cmake depends on them. > Requiring the full compile & link cycle effectively requires the .a / > .so . /.dylib files to be present.The checks that cause this issue can be bypassed by setting CMAKE_C_COMPILER_WORKS=On and CMAKE_CXX_COMPILER_WORKS=On. That isn’t ideal, and I’m currently talking with members of the CMake development community to figure out a proper solution. -Chris> > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University