<div id="appVersion:飞书-4.8.1-editorVersion:0.9.6"></div><div><div style="line-height:1.68"><div style="font-family:arial,helvetica,sans-serif;color:rgb(31,35,41);line-height:1.68"><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">Hi, I'm from ByteDance.</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">I was confused when I built LLVM with gcc toolchain.</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">===================================================================</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">Here is my first command:</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">CXX=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/g++ \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">CC=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/gcc \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">cmake -G Ninja \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-DCMAKE_BUILD_TYPE=Release  \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-DLLVM_BUILD_LLVM_DYLIB=ON \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-DLLVM_LINK_LLVM_DYLIB=ON \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">-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/</span><span class="outer-u-container "><span class=" hyperlink-href:ld-linux-x86-64.so fontsize " style="font-size:14px"><a href="http://ld-linux-x86-64.so" rel="noopener" target="_blank" style="text-decoration:none;color:rgb(51,112,255)">ld-linux-x86-64.so</a></span></span><span class=" fontsize " style="font-size:14px">.2 -I/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-494/sysroot/usr/include" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">../llvm</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">result:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize " style="font-size:14px">/usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found.</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">===================================================================</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">===================================================================</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">I tried to solve it by ’-I‘. But it failed.</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">Here is my second command:</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">CXX=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/g++ \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">CC=/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/bin/gcc \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">-DCMAKE_BUILD_TYPE=Release  \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">-DLLVM_BUILD_LLVM_DYLIB=ON \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">-DLLVM_LINK_LLVM_DYLIB=ON \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">-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/</span><span class="outer-u-container "><span class=" hyperlink-href:ld-linux-x86-64.so backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329"><a href="http://ld-linux-x86-64.so" rel="noopener" target="_blank" style="text-decoration:none;color:rgb(51,112,255)">ld-linux-x86-64.so</a></span></span><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">.2 -I/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-494/sysroot/usr/include" \</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">../llvm</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">result:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">/usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found.</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">$ ls /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/usr/include/sys/cdefs.h</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">toolchain/x86_64-x86_64-gcc-830/sysroot/usr/include/sys/cdefs.h</span></div><div class="" dir="auto" style="margin:4px 0px"><br></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">'sys/cdefs.h' exists in gcc toolchain, </span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">===================================================================</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" backgroundcolor fontweight  fontsize fontcolor " style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">Looking forward to your reply. Thanks!</span></div></div></div></div>