<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div style="margin: 0px;" class=""><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class="">PoYao Chang <<a href="mailto:rzhboyao@gmail.com" class="">rzhboyao@gmail.com</a>><br class=""></span></div><div style="margin: 0px;" class=""><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class=""><b class="">Re: [llvm-dev] How can I build LLVM with my gcc toolchain exactly</b><br class=""></span></div><div style="margin: 0px;" class=""><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class="">November 24, 2021 at 1:06:21 AM GMT+8<br class=""></span></div><div style="margin: 0px;" class=""><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, "Helvetica Neue", Helvetica, sans-serif;" class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class=""></span></div><br class=""><div class="">Give “-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON” a try. </div></blockquote><div class=""><a href="https://lists.llvm.org/pipermail/llvm-dev/2021-November/153909.html" class="">https://lists.llvm.org/pipermail/llvm-dev/2021-November/153909.html</a></div><div class=""><br class=""></div>Have you tried it as I told you a week ago. <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 1, 2021, at 2:29 PM, 刘可 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="appVersion:飞书-4.8.1-editorVersion:0.9.6" class=""></div><div class=""><div style="line-height:1.68" class=""><div style="font-family:arial,helvetica,sans-serif;color:rgb(31,35,41);line-height:1.68" class=""><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">Hi, </span><span class=" fontsize fontcolor backgroundcolor fontweight" style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">I got an error when I specified gcc8.3 toolchain to build LLVM13. </span><span class=" fontsize" style="font-size:14px">Here is my host environment:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">Debian9</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">gcc6.3</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">Manully built toolchain: gcc8.3</span></div><div class="" dir="auto" style="margin:4px 0px"><br class=""></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 command:</span></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++ 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_LINK_FLAGS="-Wl,-rpath /home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/lib64 -L/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 -L/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=" fontsize hyperlink-href:ld-linux-x86-64.so" 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)" class="">ld-linux-x86-64.so</a></span></span><span class=" fontsize" style="font-size:14px">.2 -L/home/liuke.gehry/toolchain/x86_64-x86_64-gcc-830/sysroot/lib64/</span><span class="outer-u-container "><span class=" fontsize hyperlink-href:ld-linux-x86-64.so" 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)" class="">ld-linux-x86-64.so</a></span></span><span class=" fontsize" style="font-size:14px">.2" ../llvm</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">$ ninja</span></div><div class="" dir="auto" style="margin:4px 0px"><br class=""></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">[99/302] Building C object CMakeFiles/clang_rt.builtins-i386.dir/floatsisf.c.o</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">FAILED: CMakeFiles/clang_rt.builtins-i386.dir/floatsisf.c.o</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">/home/liuke.gehry/llvm/llvm-project/build_with_gcc/./bin/clang --target=x86_64-unknown-linux-gnu -DVISIBILITY_HIDDEN  -O3 -DNDEBUG    -m32 -std=c11 -fPIC -fno-builtin -fvisibility=hidden -MD -MT CMakeFiles/clang_rt.builtins-i386.dir/floatsisf.c.o -MF CMakeFiles/clang_rt.builtins-i386.dir/floatsisf.c.o.d -o CMakeFiles/clang_rt.builtins-i386.dir/floatsisf.c.o   -c /home/liuke.gehry/llvm/llvm-project/compiler-rt/lib/builtins/floatsisf.c</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">In file included from /home/liuke.gehry/llvm/llvm-project/compiler-rt/lib/builtins/floatsisf.c:16:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">In file included from /home/liuke.gehry/llvm/llvm-project/compiler-rt/lib/builtins/fp_lib.h:23:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">In file included from /home/liuke.gehry/llvm/llvm-project/compiler-rt/lib/builtins/int_lib.h:93:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">In file included from /data00/home/liuke.gehry/llvm/llvm-project/build_with_gcc/lib/clang/13.0.1/include/limits.h:21:</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize" style="font-size:14px">In file included from /usr/include/limits.h:25:</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=" fontsize" style="font-size:14px">#  include <sys/cdefs.h></span></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">1 error generated.</span></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize fontcolor backgroundcolor fontweight" 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 class=""></div><div class="" dir="auto" style="margin:4px 0px"><span class=" fontsize fontcolor backgroundcolor fontweight" style="background-color:rgba(0,0,0,0);font-weight:400;font-size:14px;color:#1f2329">I know I can solve it through 'apt install'. But I do not need 32-bits binary . How can I disable '-m32' when building builtins? Or is it a necessary process?</span></div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>