[cfe-dev] Can't compile C++ complex type number example after building Clang with non-standard gcc installation (AARCH64)

Simone Atzeni via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 7 14:27:23 PDT 2020


Hi,

I built Clang using my own build of gcc-7.4.0.

My cmake command looks like this:

toolchain=/path/to/gcc-7.4.0/install
CC=${toolchain}/bin/gcc
CXX=${toolchain}/bin/g++
cmake -G "Ninja"
-DGCC_INSTALL_PREFIX=${toolchain}
-DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,${toolchain}/lib64 -L${toolchain}/lib64"
-DTARGET_TRIPLE=aarch64-unknown-linux-gnu
-DCMAKE_INSTALL_PREFIX="${install_dir}"
-DCMAKE_BUILD_TYPE="Release"
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt"
${src}

Then when I try to compile this example:

$ cat complex.cpp
#include <complex.h>

int main()
{
    typedef float complex kmp_cmplx32;
}

I get the the error below.
The include paths used by clang have `complex.h`, etc. The same example in "C" compiles fine.
What am I missing?

Thanks!
Simone

$ /home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/bin/clang++  complex.cpp -v
clang version 8.0.1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/bin
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
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
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/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
clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target aarch64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/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
/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
/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
/usr/local/include
/home/sw/thirdparty/llvm-project/install/Linux_aarch64/llvm-8.0/lib/clang/8.0.1/include
/usr/include/aarch64-linux-gnu
/usr/include
End of search list.
complex.cpp:5:26: error: expected ';' at end of declaration
    typedef float complex kmp_cmplx32;
                         ^
                         ;
1 error generated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200907/8cb7f568/attachment.html>


More information about the cfe-dev mailing list