刘可 via llvm-dev
2021-Nov-19 12:28 UTC
[llvm-dev] How can I build LLVM with my gcc toolchain exactly
Hi, I'm from ByteDance. I was confused when I built LLVM with gcc toolchain. ==================================================================Here is my first command: CXX=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/g++ \ CC=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/gcc \ cmake -G Ninja \ -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp" \ -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \ -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DCMAKE_CXX_FLAGS="-Wl,-rpath /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/lib64 -Wl,-rpath /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64 -Wl,-dynamic-linker /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64/ ld-linux-x86-64.so.2 -I/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-494/sysroot/usr/include" \ ../llvm result: /usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found. ================================================================== ==================================================================I tried to solve it by ’-I‘. But it failed. Here is my second command: CXX=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/g++ \ CC=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/gcc \ cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp" \ -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \ -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DCMAKE_CXX_FLAGS="-Wl,-rpath /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/lib64 -Wl,-rpath /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64 -Wl,-dynamic-linker /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64/ ld-linux-x86-64.so.2 -I/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-494/sysroot/usr/include" \ ../llvm result: /usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found. $ ls /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/usr/include/sys/cdefs.h toolchain/x86_64-x86_64-gcc-830/sysroot/usr/include/sys/cdefs.h 'sys/cdefs.h' exists in gcc toolchain, ==================================================================Looking forward to your reply. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211119/2931ead1/attachment.html>
Nemanja Ivanovic via llvm-dev
2021-Nov-22 13:31 UTC
[llvm-dev] How can I build LLVM with my gcc toolchain exactly
This is just a guess as you haven't included the full invocation or output of the failing command, but perhaps you need -DGCC_INSTALL_PREFIX/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830 On Fri, Nov 19, 2021 at 8:38 PM 刘可 via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hi, I'm from ByteDance. > I was confused when I built LLVM with gcc toolchain. > > ==================================================================> Here is my first command: > > CXX=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/g++ \ > CC=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/gcc \ > cmake -G Ninja \ > -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp" \ > -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \ > -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ > -DCMAKE_BUILD_TYPE=Release \ > -DLLVM_BUILD_LLVM_DYLIB=ON \ > -DLLVM_LINK_LLVM_DYLIB=ON \ > -DCMAKE_CXX_FLAGS="-Wl,-rpath > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/lib64 -Wl,-rpath > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64 > -Wl,-dynamic-linker > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64/ > ld-linux-x86-64.so.2 > -I/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-494/sysroot/usr/include" \ > ../llvm > > result: > /usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found. > ==================================================================> > ==================================================================> I tried to solve it by ’-I‘. But it failed. > > Here is my second command: > > CXX=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/g++ \ > CC=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/gcc \ > cmake -G Ninja > -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp" \ > -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \ > -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ > -DCMAKE_BUILD_TYPE=Release \ > -DLLVM_BUILD_LLVM_DYLIB=ON \ > -DLLVM_LINK_LLVM_DYLIB=ON \ > -DCMAKE_CXX_FLAGS="-Wl,-rpath > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/lib64 -Wl,-rpath > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64 > -Wl,-dynamic-linker > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64/ > ld-linux-x86-64.so.2 > -I/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-494/sysroot/usr/include" \ > ../llvm > > result: > /usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found. > $ ls > /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/usr/include/sys/cdefs.h > toolchain/x86_64-x86_64-gcc-830/sysroot/usr/include/sys/cdefs.h > > 'sys/cdefs.h' exists in gcc toolchain, > ==================================================================> Looking forward to your reply. Thanks! > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211122/6269a053/attachment.html>