<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, 7 Sep 2020, 14:27 Simone Atzeni via cfe-dev, <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_-2969707074173978667WordSection1">
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I built Clang using my own build of gcc-7.4.0.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My cmake command looks like this:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">toolchain=/path/to/gcc-7.4.0/install<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">CC=${toolchain}/bin/gcc
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">CXX=${toolchain}/bin/g++
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">cmake -G "Ninja"
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-DGCC_INSTALL_PREFIX=${toolchain}
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,${toolchain}/lib64 -L${toolchain}/lib64"
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-DTARGET_TRIPLE=aarch64-unknown-linux-gnu
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-DCMAKE_INSTALL_PREFIX="${install_dir}"
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-DCMAKE_BUILD_TYPE="Release"
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-DLLVM_ENABLE_PROJECTS="clang;compiler-rt"
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">${src}
<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Then when I try to compile this example:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">$ cat complex.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">#include <complex.h><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">int main()<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">{<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> typedef float complex kmp_cmplx32;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">}<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I get the the error below.<u></u><u></u></p>
<p class="MsoNormal">The include paths used by clang have `complex.h`, etc. The same example in “C” compiles fine.<u></u><u></u></p>
<p class="MsoNormal">What am I missing?</p></div></div></blockquote></div><div dir="auto"><complex.h> in C++ has nothing to do with <complex.h> in C, and in particular does not define a "complex" macro expanding to _Complex.</div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div class="m_-2969707074173978667WordSection1">
<p class="MsoNormal">Thanks!<u></u><u></u></p>
<p class="MsoNormal">Simone<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">$ /home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/bin/clang++ complex.cpp -v<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">clang version 8.0.1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Target: aarch64-unknown-linux-gnu<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Thread model: posix<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">InstalledDir: /home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/bin<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Found candidate GCC installation: /home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Selected GCC installation: /home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Candidate multilib: .;@m64<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Selected multilib: .;@m64<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">"/home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/bin/clang-8" -cc1 -triple aarch64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name complex.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -fallow-half-arguments-and-returns -dwarf-column-info
-debugger-tuning=gdb -v -resource-dir /home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/lib/clang/8.0.1 -internal-isystem /home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0
-internal-isystem /home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0/aarch64-unknown-linux-gnu -internal-isystem /home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward
-internal-isystem /usr/local/include -internal-isystem /home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/aarch64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem
/usr/include -fdeprecated-macro -fdebug-compilation-dir /home/satzeni -ferror-limit 19 -fmessage-length 191 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/complex-b60b10.o -x c++ complex.cpp
-faddrsig<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target aarch64-unknown-linux-gnu<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">ignoring nonexistent directory "/include"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">#include "..." search starts here:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">#include <...> search starts here:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0/aarch64-unknown-linux-gnu<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/home/sw/thirdparty/llvm-project/toolchains/install/Linux_aarch64/gcc-7.4.0/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/usr/local/include<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/lib/clang/8.0.1/include<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/usr/include/aarch64-linux-gnu<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">/usr/include<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">End of search list.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">complex.cpp:5:26: error: expected ';' at end of declaration<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> typedef float complex kmp_cmplx32;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> ^<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> ;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">1 error generated.<u></u><u></u></span></p>
</div>
</div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>