search for: c_compiler_works

Displaying 4 results from an estimated 4 matches for "c_compiler_works".

2020 Nov 10
1
Building an LLVM cross-compiler
Just a note about this: >I like this. I hope you don't mind if I borrow some of these ideas to >play with. C_COMPILER_WORKS is something I've never heard of. I'm also working on building a clang-based toolchain from scratch. To avoid CMake bailing out when a binary can't be linked, I use: -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY Along with: -DCMAKE_SYSTEM_NAME="Generic" -DCMAKE_SYSTEM_PRO...
2020 Nov 10
0
Building an LLVM cross-compiler
Hi everyone, Just a quick update. Here's what worked for me here*: 1. Get the sources. 2. Build clang, llvm, lld. 3. Install libc headers to a sysroot. 4. Build compiler-rt builtins and crt with the freshly-built clang. One need to set C_COMPILER_WORKS to skip the checks. 5. Build libc.a/libc.so Now the freshly-built clang can compile a "Hello, World" program. @Martin Storsjö @Chris Bieneman Thanks for the hints! * - instead of previously supposed 1. Get the sources (llvm, lld, compiler-rt, libunwind, libcxx...). 2. Build an LLV...
2020 Nov 10
0
Building an LLVM cross-compiler
...ss-compiler > > Hi everyone, > > Just a quick update. Here's what worked for me here*: > 1. Get the sources. > 2. Build clang, llvm, lld. > 3. Install libc headers to a sysroot. > 4. Build compiler-rt builtins and crt with the freshly-built clang. > One need to set C_COMPILER_WORKS to skip the checks. > 5. Build libc.a/libc.so > > Now the freshly-built clang can compile a "Hello, World" program. Can this recipe be documented somewhere in the building-llvm pages? It's clearly not an obvious procedure. Thanks, --paulr > > @Martin Storsjö > @C...
2020 Nov 06
1
Building an LLVM cross-compiler
...) and static libraries, so libclang_rt isn't needed yet. (The autoconf scripts for these bits define AC_NO_EXECUTABLES, which avoids bailing out due to the compiler not being able to link an executable.) After this step, I build the compiler-rt builtins, and this is configured with -DCMAKE_C_COMPILER_WORKS=1 to (iirc) make it not bail out even though the toolchain still can't link anything. After building the compiler-rt builtins, and installing them, the toolchain finally is complete enough to link a working C program. After this stage, higher level runtimes like libc++ can be built on top,...